Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] Ignore namespaces

From: Jeni Tennison <jeni@---------------->
To:
Date: 7/1/2002 5:27:00 AM
Hi Andrew,

>>Unfortunately not in XSLT 1.0. As far as XPath and XSLT are
>>concerned, an element with a namespace is completely different from
>>an element without a namespace. To change an XSLT 1.0 stylesheet
>>from working over a source document without namespaces to one with,
>>you have to change every XPath that refers to elements that now have
>>a namespace, so that they include prefixes pointing to that
>>namespace.
>
> sorry to join thread half-way....
>
> Is it not possible to do an indentity transform first to remove the
> namespaces on the nodes, then apply the usual stylesheet?

Yes; that two-phase approach was the second approach that Fillipe
suggested and I discussed. As I said, and as you've shown, it isn't
hard to filter out namespaces using XSLT, but (a) you can't do that in
a single stylesheet unless you're prepared to use a node-set()
extension function and (b) you have to be aware that this changes the
underlying meaning of the XML document (it's the same as doing some
preprocessing to change all the 'foo' elements to 'bar' elements in
order to make the processing easier). There's nothing inherently wrong
with that, but it does mean you lose information that might turn out
to be useful in the main transformation.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent