[XOM-interest] Attribute type CDATA vs. UNDECLARED: how to treat them as equal if they are equal?
Christoph LANGE
ch.lange at jacobs-university.de
Mon Jan 21 06:04:17 EST 2008
On Thursday 17 January 2008 13:30:39 Elliotte Rusty Harold wrote:
> > we have so far compared attributes by comparing local name, prefix, type,
> > and value. Could you give a recommendation how we should compare instead?
> > Just ignoring the type, if one of the two types to be compared is
> > UNDECLARED?
>
> Let me think about this one. What equals method are you using?
None, I'm talking about a custom data structure that is not an attribute in
itself but that we use to _hold_ some properties of an attribute. Then, we
compare these properties, namely:
* String localName
* String prefix
* String value
* Attribute.Type type
by their equals methods. (@Normen, BTW, what was again the reason for you to
consider the prefix instead of the URI? I remember there was something, but I
forgot.)
> Could your code simply
> compare the values of the attributes instead of the attributes themselves?
In the current trivial bugfix of our code, I've just commented the comparison
of the "type" field. @Normen, shall we leave it at that?
> "All attributes for which no declaration has been read SHOULD be treated
> by a non-validating processor as if declared CDATA." but apparently a
> validating processor should not treat such attributes as CDATA (or is
> that a spec bug?)
The strange thing in our case is that neither of the processors should be a
validating one. Our application does not (yet) validate; as I said before, we
both use the default parsers for DOM and XOM.
> I know I had a reason for distinguishing undeclared attributes. Right
> now I just can't remember exactly what it was. Let me look at the code.
> Hmm, nothing obvious there.
Thanks for investigating this!
Best,
Christoph
--
Christoph Lange, Jacobs Univ. Bremen, http://kwarc.info/clange, Skype duke4701
More information about the XOM-interest
mailing list