|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: converting XML to XML problem
Abhijit,
It looks like you are trying to generate entity references on the fly, which is against the XSLT processing paradigm. Entities are part of XML considered as a lexical object (string of characters including markup), whereas XSLT operates on XML considered as a parsed data object (a tree of nodes). Once the document has been parsed into this tree, all entities have been resolved. Likewise, most XSLT serializers do not provide any means for generating entity references instead of the whatever-it-is that they refer to. Since most XSLT processors can serialize their output, however (i.e., since most, in practice, write their output as marked-up text to a file), there is a workaround that *may* be available to you. So instead of <xsl:template match="node2"> &<xsl:value-of select="@attr/>; </xsl:template> try <xsl:template match="node2"> <xsl:text disable-output-escaping="yes">&</xsl:text> <xsl:value-of select="@attr/>; </xsl:template> and see if it works better for you. Note that is ONLY works if your XSLT transformation is directly followed by a serialization (i.e. you are writing your output as a stream of characters somewhere), and if your processor implements this optional feature of the language. It will NOT work in many pipeline architectures or in some processors that are built to ply the straight-and-narrow, such as the Transformiix processor used in Mozilla. So beware! this is a trick you should use knowing the risks. -- Wendell At 06:13 PM 11/10/2003, you wrote: Hi, I am using xsl for xml to xml tranformation. I want to pring & character in my output xml....
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








