• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Removing a href tags using XSL

 
Vineet Solabannavar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have an XML with HTML tags.
I want to remove the <a href> tags and keep the remaining XML as it is using XSL transformation.

How can I do it using xsl:copy-of?


The above code is the input xml.
 
Paul Clapham
Sheriff
Posts: 21155
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Okay, now that you know how to use an identity transformation, add to that a template that matches "a" and produces no output.
 
Vineet Solabannavar
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the suggestion.
I have one more problem, I want to just match the img tags in the XML and copy all the remaining HTML tags as they are to the output.

Please suggest a solution.

Thanks in advance

Vineet
 
Paul Clapham
Sheriff
Posts: 21155
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's the same problem, just with "a" replaced by "img".

Use an identity transformation plus a template that matches your <img> elements and does whatever you want to do with them.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic