[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Embedding html within xml
At 02:08 PM 3/11/2004, it was written:
Hmm... What doesn't work? In the code below you should be able to just change the And ... today's little XPath lesson...: [0] "." is short for "self::node()" [1a] select="node()" is short for select="child::node()" (select all child nodes of the context node) [1b] select="./node()" is short for select="self::node()/child::node()" (select all child nodes of the context node itself) These are functionally equivalent, which makes this case very different from another apparently similar pairing: [2a] select="//node()" is short for select="/descendant-or-self::node()/child::node()" [2b] select=".//node()" is short for select="self::node()/descendant-or-self::node()/child::node()" That is, [2a] is the same as "/descendant::node()" (node descendants of the root), while [2b] is the same as "self::node()/descendant::node()" (node descendants of the context node) -- not the same thing at all. Back to the thread ... if you want to copy the current node (with all descendants), not just its children (with theirs), that's <xsl:copy-of select="."/> (expands as in [0]) ... or perhaps you really want to copy the node's children (with all descendants) but not the node itself: you can do this with copy-of select="node()" [1a]. I say "with all descendants" because that's what copy-of does. For the OP, that's how the <a> node in the source gets included when its parent's template says to copy node children. 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
|