[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Réf. : RE : XML tags to XML attributes wit
Laurent,
Jarno suggested using xsl:copy-of, and you reported it placed the value of your attribute into element content. Are you sure you said copy-of, not value-of? xsl:value-of would give the result you reported, but xsl:copy-of would (as Jarno said) copy the attribute as an attribute (not place its value into the content). At 04:50 AM 10/22/2003, you wrote: I'done This works because you are selecting attributes (select="@*") and also matching them with the same template, which copies them. The line <xsl:apply-templates select="Attributes"/> is, however, spurious. It's not doing anything at all, since you don't have any child elements named "Attributes" -- and if you did, it would break your stylesheet and your actual attributes would fail to be copied, since they are being copied by the next instruction <xsl:apply-templates select="* | @* | text()"/>, and you can't add attributes to an element node after other things have been placed in its content (as would presumably happen if you had element children named "Attributes"). So you probably want to delete that line (try it; it will still work) ... and maybe go back to Jarno's idea as it's a bit tighter (albeit a little less adaptable). Cheers, Wendell
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
|