Re: Parsing a MODS-document with validation fails
Thomas Scheffler <[email protected]>
| Newsgroups | gmane.comp.java.jdom.general |
|---|---|
| Organization | Friedrich-Schiller-Universität Jena |
| Message-ID | <[email protected]> |
Am 14.08.2011 07:15, schrieb Jason Hunter: > I agree with Rolf's assessment. I too. It is important what comes out at the end. If the input is valid, than the output should be valid, too. Blaming the user for not providing a custom filter working around a erroneous specification, would not help the user and not help the JDOM project, as traffic on the mailing list will be higher. Hope to see 1.1.2. soon. regards, Thomas > On Aug 13, 2011, at 2:14 PM, Rolf Lear wrote: > >> Hi Brad. >> >> In this case I think the issue is too 'grey' to squarely lay the blame >> on any particular component. The use-case is such that it relies on a >> number of different shortcomings in a number of tools, including JDOM. >> >> Although the 'test cases' I put together illustrates the underlying >> problem (that there's no namespace prefix given to attributes that are >> 'sourced' from the XSD), the initial symptom as reported by Thomas >> is/was that JDOM was overwriting the value of his 'type' attribute >> with the value of the 'type' attrribute in the xlink namespace. >> >> In other words, if there is no change made to SAXHandler, then we make >> a 'broken' situation even worse. Saying "when XMLSchema specification >> is revised, and all the parsers do the 'right thing' we will give the >> right result" feels a little cheap. >> >> At a minimum, the SAXHandler has to be able to identify attributes >> that are in a namespace, but without a prefix, and then to ignore >> *that* attribute instead of potentially corrupting a different attribute. >> >> On the other hand, the fix/workaround for the problem is relatively >> trivial, easy to confine to just the scope of the issue, and it is >> safe for when we do (eventually) have parsers that provide a correct >> (or generated) prefix. >> >> The concept of the user having to apply a filter or wrapper to get >> sensible results is not pretty. >> >> One other thought, in order to get to this state, you have to declare >> your Parser to be namespace-aware... and then, after asking for the >> namspaces JDOM then does its processing based on the prefix, not the >> namespace... >> >> Rolf >> >> On Fri, 12 Aug 2011 17:51:21 Bradley S. Huffman wrote >> >>> However JDOM, or any other project can't and shouldn't be adding >>> kludges because another group won't fix there code and keeps 'passing >>> the buck'. Therefore, I support Michael's suggestion of handling it >>> with a filter or wrapper, but I do not support changing SAXHandler in >>> any way. >>> >>> On Wed, Aug 10, 2011 at 3:14 PM, Rolf Lear<[email protected]> wrote: >>> >>> > That issue is marked "Won't fix", with the comment: I agree it's a bug, but >>> > it's not that easy to fix. The problem is what prefix to use for the new >>> > attribute. I'll think about it more. _______________________________________________ To control your jdom-interest membership: http://www.jdom.org/mailman/options/jdom-interest/[email protected]