Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XSL question

 
Jun Hong
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way to copy a node in source file to result file? I am using XSL to transform a source XML to a result XML. Most of my source nodes can be used as result nodes. Basically, I just remove some unrelated nodes and build the result tree. So I hope I can copy useful nodes direclty. Right now, I have to use template to copy tags, attributes, and texts one by one. I hope there is a function called copyNodeRecursively() to copy a node recursively for me. Because the child nodes of a node may change and templates are not dynamic, I really need this kind of function. Does it exit?
 
Shashank Tanksali
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use xsl:copy-of to do a deep (recursive) copy.
Hope this helps.
Shashank
 
Jun Hong
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much. I tried copy-of and it works. I do appreciate your help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic