From: Bob Hutchison Date: 2002-10-01T06:00:15+09:00 Subject: Re: REXML namespace support On 9/30/02 3:47 PM, "Matt Gushee" wrote: > On Tue, Oct 01, 2002 at 04:28:43AM +0900, Bob Hutchison wrote: [... discussion about XML documents with the same prefix referring to different namespaces (in different parts of the document) ...] >> >> Yes, actually, I have. I certainly don't recommend the practice, but I've >> seen it. If you are writing tools for XML you have to be prepared for it. > > Wow. Okay. Just out of curiousity, are you talking about documents > written by human authors, or generated XML, or both? It's hard to > understand why anyone would deliberately do that. I think it must have been cut and paste (or confusion??) that caused the human authored ones. I've seen documents generated by composition (as you mentioned) end up with it too. (Composition was a big thing where I was working a year or so ago). There are different ways of doing this. One where a prefix is re-defined (like in my example) and another where the prefix is used in different parts of the document. > > Though, now that I think about it, it would be pretty easy to get reused > prefixes in a composite document, if you didn't specifically provide a > means to uniquify the prefixes when assembling the components. > >>> Which means that, if a certain degree of doubt is acceptable (e.g. doing >>> a first-pass analysis of a large collection of XML documents, with >>> thorough testing to take place later), there shouldn't be a problem with >>> just pulling out the first available mapping (though I don't think I'd >>> choose that approach myself unless I were under extreme time pressure). >> >> I wouldn't recommend it. > > Nor would I. I guess I'm just resigned to living in a world full of > kludges. :-)