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

Re: recreating elements with attributes

Subject: Re: recreating elements with attributes
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 11 Feb 2004 00:01:04 GMT
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


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.