Hi everybody, I need to take an xml file and remove 2 certain namespaces from it using XSLT("scrubbing metadata"). Also, I believe I would need to use the Transformer class in combination with the XSLT. Can someone help me out? Possibly giving me an example with namespace "A" and namespace "B"? Thanks.
k.e.v
0
Newbie Poster
Recommended Answers
Jump to PostWorking with namespaces can be very easy most of the time. However, the specifics of the transformation will depend on what your input document looks like in detail. Can you make a small sample input and desired output XML document and I'll work something up. Please use Codebox as well.
Jump to PostThis should do what you want:
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:freshness="http://freshness" xmlns:history="http:history" xmlns:wo="http:hello"> <xsl:output method="xml" indent="no"/> <xsl:template match="/|comment()|processing-instruction()"> <xsl:copy> <!-- go process children (applies to root node only) --> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="*"> …
All 6 Replies
iceandrews
0
Junior Poster
k.e.v
0
Newbie Poster
fpmurphy
9
Junior Poster
k.e.v
0
Newbie Poster
fpmurphy
9
Junior Poster
k.e.v
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.