|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Copying a document except specific root attribute
> For starters, I use the identity transformation to copy all elements and > attributes of an XML document. Additionally, I have a rule like: > > <xsl:template match="/@myRootAttribute"/> Of course it's ignoring that attribute. It can't exist ;). / designates document root, the parent of the document element. See XPATH 1.0: "/ selects the document root (which is always the parent of the document element)" So say your xml looks like: <root> <foo> ... </foo> <bar> ... </bar> </root> What you are asking for is equivalent to saying, I want the @myRootAttribute of the parent of root. What I think you mean to say is: <xsl:template match="/root/@myRootAttribute"/> which would match the attribute below in the root element. <root @myRootAttribute="spiffy"> <foo>...</foo> </root> Of course, this more involved if by the root attribute you actually mean the namespace that is declared there. Is this the case? Jonathan Gorman
|
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








