• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Any way to specify nodes to copy without filtering?

 
Darrin Smith
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know how to do an identity transform, and I know how to filter specific nodes out of it, but how do I specify that you copy only specific nodes and everything else (comments, etc.)? The reason why I do that is because the XML that the XSLT is to be applied to may grow (new nodes) and I want to exclude all new nodes. A filter will only exclude a set of the current ones.

For example:




Suppose all I wanted to see was:




What should the xslt look like to accomplish that?

I thought that I could try to first copy over all non-nodes then focus on the nodes and list the specific ones I wanted to copy but I could not get it to work.

What I have now is just a filter like this



Again, I don't want to filter out specific nodes like this does. I just want to copy specific ones!

Thanks.
 
Paul Clapham
Sheriff
Posts: 21117
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you want to filter out all elements except for a certain list? Your XPath expression for that is something like this:
 
Darrin Smith
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Paul Clapham wrote:So you want to filter out all elements except for a certain list? Your XPath expression for that is something like this:


Yes that's pretty much it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic