[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: JDK 5 XSLTC handling of namespace prefixes
> drkm wrote: > > Julian Reschke wrote: > > > >> Because the whole point of the stylesheet is to get rid of prefixes, > >> because their output is used to compare test results (where prefixes > >> are > >> irrelevant). > > > > If I understand, you want to compare two XML documents > > (with diff(1) or similar), so you want to strip out the > > prefixes. IMHO, there are a lot of XML caracteristics that > > make it unusable with diff(1) (withespaces, namespaces, > > character entities, etc.). > > That's why I am running them through a normalization step (sigh). You have no chance unless you implement your own serializer because of many reasons, one being that attribute order isn't significant - the order in which they get written out is allowed to be different each time (others include the namespace prefix problem you've come across, entites and character references eg ' versus ', & #160; versus ' ' etc). XML canonicalization is a big topic and has its very own w3c rec: http://www.w3.org/TR/xml-c14n Could you not compare in memory structures and do the work in whatever tool is comparing the XML? That way serialization issues aren't involved. cheers andrew
|
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
|