xsl-list
[Top] [All Lists]

Re: recreating elements with attributes

2004-02-10 17:01:04

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



<Prev in Thread] Current Thread [Next in Thread>