aspose file tools*
The moose likes XML and Related Technologies and the fly likes Removing a href tags using XSL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Removing a href tags using XSL" Watch "Removing a href tags using XSL" New topic
Author

Removing a href tags using XSL

Vineet Solabannavar
Greenhorn

Joined: Aug 27, 2005
Posts: 14
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
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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

Joined: Aug 27, 2005
Posts: 14
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
Bartender

Joined: Oct 14, 2005
Posts: 18570
    
    8

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Removing a href tags using XSL