[jdom-interest] Parsing a MODS-document with validation fails

Thomas Scheffler thomas.scheffler at uni-jena.de
Sun Aug 7 23:00:20 PDT 2011


Am 08.08.2011 05:58, schrieb Rolf:
> But, as for the ns0 'default' name, I think that is a poor solution, and
> that it should be possible to scan up the tree to find a real prefix for
> that namespace... If the parser is not going to provide it, I think the
> JDOM SAX Handler can fall back on a work-around solution that does not
> 'lose' the attribute - a solution that is a combination of Thomas's fix,
> and a smarter prefix determination routine.

Hi,

that is exactly what "nsURIMapping" and "usedNamespaces" does. On 
"startPrefixMapping()" a prefixMapping is assigned and kept until 
"endPrefixMapping()" called. In unpatched state SAXHandler cleaned those 
mappings after every element, there was no "endPrefixMapping" handler.
The "ns[0-9]+" case is a fallback that is not even used in the MODS-case 
as "xlink" could be resolved properly. It is just in the code to 
definitively not overwrite an attribute in the default namespace.

Hope that clarifies my 2nd patch (2001-07-25) a bit.

regards,

Thomas



More information about the jdom-interest mailing list