Altova Mailing List Archives


RE: [xsl] MSXML and unwanted entity output

From: "Michael Kay" <mhk@--------->
To:
Date: 5/27/2004 1:03:00 PM
If you want the output to be XML, then the special JavaScript characters
must be escaped according to XML conventions.

If you want the output to be HTML containing <script> elements, then use
method="html" on xsl:output, and the special rules for the <script> element
in HTML will be applied.

Michael Kay 

> -----Original Message-----
> From: Alex Scott [mailto:fastidious007@xxxxxxxxxxx] 
> Sent: 27 May 2004 10:15
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] MSXML and unwanted entity output
> 
> So how can I get a bit of javascript that is full of &&'s and <'s to
> output 
> as &&'s and <'s
> 
> Do I have to use something like (Example fromn FAQ) for every 
> instance of
> these characters in the Javascript?:
> <xsl:value-of select="'&lt;BR/&gt;'" disable-output-escaping="yes"/>
> 
> 
> 
> On Thu, 27 May 2004 10:20:54 +0100, "Alex Scott"
> <fastidious007@xxxxxxxxxxx> said:
> > Ok, 
> > 
> > So are you saying that this can't be change in the XSL as whatever
> > characters I use it will not make any difference to the output,
> > and this is therefore a problem (Supposedly further down 
> the line)in the
> > XML parser?
> > ---
> > Alex.
> > 
> > On Thu, 27 May 2004 10:05:51 +0100, "Michael Kay" 
> <mhk@xxxxxxxxx> said:
> > > > 
> > > > <![CDATA[&&]]>
> > > > Will out put as an entity:
> > > > &amp;&amp;
> > > > 
> > > > 
> > > > Does this look like a problem in the output type, or is there 
> > > > a way I can
> > > > alter the XSLT so that I can get 
> > > > the HTML returned as the same stuff I put in i.e. 
> > > > && or <
> > > 
> > > This is a FAQ. 
> > > 
> > > An XSLT transformation parses your source XML, creates a tree
> > > representation
> > > of the source, transforms it, and then serializes the result tree.
> > > Lexical
> > > details of the source XML, for example whether attributes 
> use single
> > > quotes
> > > or double quotes, are lost in this process. The difference between
> > > <![CDATA[&&]]> and &amp;&amp; is one of these lexical details.
> > > 
> > > You would want the test "contains(., '&amp;')" to work 
> regardless how the
> > > ampersand was written in the source, surely?
> > > 
> > > Michael Kay

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.