[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: entities and text nodes [was: no subject]

Subject: RE: entities and text nodes [was: no subject]
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Tue, 26 Aug 2003 18:55:18 +0100
character entities in text nodes
MSXML is non-conformant in that it allows the data model to contain
several adjacent sibling text nodes. It does this in particular when the
original text contains entity references. You should therefore be very
careful about using <xsl:value-of select="text()"/> which only selects
the first child text node. Using <xsl:apply-templates select="text()"/>
would do the trick in this case.

Michael Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx 
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of 
> Whitney, Dan (CanWest Interactive)
> Sent: 26 August 2003 17:30
> To: 'mulberry - xsl'
> Subject: 
> 
> 
> I have the following XML fragment:
> 
> <RECORDITEM sqlsource="cityprov" 
> colname="col4">Montr&eacute;al, 
> QC<RECORDREF>specialannual</RECORDREF></RECORDITEM>
> 
> I want my output to be:
> 
> <td>Montr&eacute;al</td><td>specialannual</td>
> My xsl is:
>         <xsl:for-each select="RECORDITEM">
>           <td align="right">
>             <font face="verdana" size="1">
>             <xsl:value-of select="text()"/>
>             </font>
>           </td>
>           <td align="right">
>             <font face="verdana" size="1">
>             <xsl:value-of select="RECORDREF"/>
>             </font>
>           </td>
>         </xsl:for-each>
> When I use ie 6.0 to open this the entity "&eacute;" is not 
> interpreted as text? so I get something like the following: 
> <td align="right>Montr</td><td 
> align="right">specialannual</td> When I translate it with 
> saxon everything comes out as I want. Which is correct and 
> can I write my XSL to overcome the discrepancy?
> 
> 
> Thanks in advance,
> 
> Dan Whitney
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.