Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Leave " alone in transformation

From: Martin Honnen <mahotrash@-----.-->
To: NULL
Date: 11/15/2008 2:09:00 PM
LionelAndJen@g... wrote:
> I have an XML file that has a free form comment field in which the
> data provider, very kindly, already uses "&quot;" when writing
> "doesn't", I have doesn&apos;t .
> 
> it's PERFECT, because that xml is then fed to an XSLT sheet that
> transforms this text into a sql insert statement.  UNFORTUNATELY, XSLT
> translates  doesn&apos;t into doesn't in the output, which then
> destroys my sql statement.  How do I tell my XSLT to leave well-enough
> alone ?  I know it has to be easy, but I just don't get it right now
> in spite of looking online.

No, it is not easy. You can't preserve entity references when parsing 
XML and using XSLT as the XSLT data model does not know any entity 
references. So XSLT uses an XML parser to build its data model, an input 
tree, and then transforms that input tree into a result tree. The result 
tree can then optionally be serialized as XML or HTML or plain text.
If you want to ensure that certain characters are escaped with entity 
references in the output the XSLT processor creates then you need to 
look at processor specific extensions to do that. Or you can look into 
XSLT 2.0 and character maps http://www.w3.org/TR/xslt20/#character-maps. 
Note that both ways will not simply allow you to preserve entity 
references in the input, instead you will create entity references in 
the output.
-- 

	Martin Honnen
	http://JavaScript.FAQTs.com/


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent