[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
Thu Jan 17 03:35:52 EST 2008


Dear XOM developers,

  in Attribute.Type, the values CDATA and UNDECLARED are distinguished -- a 
feature that causes a bug in our application. The bug occurs in a situation 
where some documents are originally accessed via DOM (and then converted to 
XOM), and others are originally accessed via XOM. In the document from the 
DOM source (parsed using the default DocumentBuilderFactory of Java 1.5) and 
in the document from the XOM source (parsed using the default builder of XOM 
1.2b2), there are two attributes with an identical XML representation. The 
one from the DOM source gets an Attribute.Type of UNDECLARED, whereas the 
other one is recognized as CDATA, which ultimately makes them unequal 
according to the equals() method.

In our application (the pattern matching of the mmlproc math renderer 
developed by Normen Müller (Cc); see http://kwarc.info/projects/mmlkit/), 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?

Thanks in advance,

Christoph

-- 
Christoph Lange, Jacobs Univ. Bremen, http://kwarc.info/clange, Skype duke4701


More information about the XOM-interest mailing list