Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Select specific tags in html using XSLT

 
sripadraj kudur
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all ,

I have been trying to parse the html and get/extract few tags from the html using xslt. My XSLT is as given below:




I need only few tags, like '<a>' and <img> in the above XSLT but the code outputs the entire html.
Can anybody point out what could have gone wrong. A sample code would be helpful.


Thank you
Sripad
 
Paul Clapham
Sheriff
Pie
Posts: 20758
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, yes, what you have there is basically the identity transformation, so naturally what you get as a result is basically the entire document. That's what the identity transformation does, it just copies the entire document.

So, if your desired output isn't a slightly-modified version of the entire document, then don't start with the identity transformation as the basis for your XSLT code.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic