[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: recreating elements with attributes
> this code loops through all attributes for the TOLL_CDR node. The > problem is when I try and put "<TOLL_CDR" in there, because the parser > yells about the "<" sign in front of it. Any thoughts? XML does not allow a literal < in attribute values, so no XML system will allow such an attribute (so this isn't really an xslt issue) and xslt in its xml output method will always output a well formed value, so quoting the <. as mentioned in a parallel thread, you don't need/want the // here: <xsl:template match="//CDRS/TOLL_CDR"> The code posted clearly isn't xml at all so would not have got as far as the xslt system <TOLL_CDR <xsl:text> You can't have an xsl:text (or any element) element inside the start tag of an element. An XSL stylesheet has to be well formed XML. You appear to be trying to generate XML markup x="y" as text, but XSLT does not directly manipulate the markup at all, you need to construct a node tree, if the markup is generated at all t happens after the transformation when the result is serialised. I would guess that you want to copy teh attribute nodes so that is <TOLL_CDR> <xsl:copy-of select="@*"/> </TOLL_CDR> David -- http://www.dcarlisle.demon.co.uk/matthew 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
|