|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Copying a portion of a subtree in its entirety including ret
Hi, I'm new to XSL and I'm trying to figure out how copy an entire
portion of a tree, starting at a sub-node, and includes everything below
that node (node, text, attributes, etc.). I've been able to figure out
how return the nodes or the text using the FAQ section but I haven't
been able to get it to return everything combined. Basically I want the
output to be as if I has just cut the xml out of the file myself and
pasted it elsewhere. Maintaining the white-space characters doesn't
matter to me, just the getting data.
An example of a sample xml input would be as follows:
<Config>
<Object1>
<stuff>
<data/>
</stuff>
<Filter>
<Item>
<data>
<mynode dt="mydatatype1"/>
text
</data>
</Item>
</Filter>
</Object1>
<Object2>
<Filter>
<Item>
<data>
<anothernode dt="mydatatype2"/>
moretext
</data>
</Item>
</Filter>
</Object2>
</Config>
For a given Object, which would be denoted by a variable (in this case
Object1), I want to get everything between the 'Filter' tags (including
'Filter') so that the output would be:
<Filter>
<Item dt=mydatatype>
<data>
<mynode dt="mydatatype1"/>
text
</data>
</Item>
</Filter>
I haven't figured out how to get xsl:copy or xsl:copy-of to return this
type of output. How would be the best way to accomplish this. I've tried
both saxon and sablot to get this to work.
Thanks,
Mike Mahoney
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
|

Cart








