[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: newbie problem - writing XSL for an XML with names
> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|