Link to home
Start Free TrialLog in
Avatar of davidgordonhill
davidgordonhill

asked on

Strip xml-stylesheet and xmlns from an XML document with XSLT

I have an XML document that has a bad stylesheet and xmlns info.  I can't change the source systems, but I can't format the document with XSL without manually deleting the bad info first.  Can I strip that info using XSLT?
sterile_invoice_20150213_v1.xml
test.xsl
Avatar of ste5an
ste5an
Flag of Germany image

Sure. As long as "bad" doesn't mean you have non-well formed or invalid XML. For "bad" or invalid XML: Where's you schema (XSD) describing the "good" format? Without that, how can we now what "bad" is defined as?
Avatar of davidgordonhill
davidgordonhill

ASKER

Bad meaning the XSLT doesn't work for some invoices unless I remove the xml-stylesheet and xmlns items.  When I delete those lines manually, the XSLT works perfectly.  When I leave them in, I have issues.
I'm just using a text editor macro to find-replace the offending stuff with stuff that allows my XSLT to work, but was wondering if there was a way I could do that without resorting to a separate step and separate product to strip out the offending items.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.