Subject: Copying a portion of a subtree in its entirety including retaining the attribute and text info From: Mike Mahoney <mmahoney@xxxxxxxxxx> Date: Mon, 20 Nov 2000 09:23:52 -0700 |
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
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: my first question !, Heather Lindsay | Thread | Re: Copying a portion of a subtree , David Carlisle |
Re: xpath not.., David Carlisle | Date | Re: localization techniques and cod, Jeni Tennison |
Month |