Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Attribute type CDATA vs. UNDECLARED: how to treat them as equal if they are equal?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Christoph LANGE <ch.lange AT jacobs-university.de>
  • To: elharo AT metalab.unc.edu
  • Cc: Normen Müller <n.mueller AT jacobs-university.de>, xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Attribute type CDATA vs. UNDECLARED: how to treat them as equal if they are equal?
  • Date: Mon, 21 Jan 2008 12:04:17 +0100

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




Archive powered by MHonArc 2.6.24.

Top of Page