This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: newbie problem - writing XSL for an XML with namespaces.


> Since we are likely to received files both with an without
> the namespace specified, I need to be able to display them
> with the same XSL in either case.
>
> So how can I process an incoming XML, without worrying about
> whether it's specified a namespace or not?

That's tricky: XSLT rather naively followed the design principles of
namespaces, which say that ABC in namespace N is completely unrelated to ABC
in namespace M, so why would you want to process both with the same logic?
Unfortunately you're not alone in using local names in two different
namespaces that actually have a strong relationship with each other, and I
know there's not much point telling you it's bad design.

An XSLT solution would make heavy use of things like
select=*[local-name()='ABC']; but my preference would be a SAX filter that
you apply before the stylesheet kicks in, to add the missing namespace
declarations.

Mike Kay
Software AG


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]