You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Philippe MOUAWAD <ph...@effix.fr> on 2000/07/11 17:55:36 UTC

Bug in getOwnerElement()


Hi all,
I may have found a bug in getOwnerElement() from Attr.
The bug occurs for this kind of declaration :

DTD :
<!ELEMENT BUG (A)>
<!ELEMENT A EMPTY>
<!ATTLIST A type NMTOKEN  #FIXED 'date'>


XML :
<?xml version="1.0"?>
<!DOCTYPE BUG SYSTEM "bug.dtd">
<BUG>
     <A />
</BUG>

I made a little snippet with this line code :
  Node ownerElement = ((Attr)attribute).getOwnerElement();
  System.out.println("attribute: " + attribute.getNodeName() + ", ownerElement : " + ((ownerElement != null) ?
  ownerElement.getNodeName():"null"));

It displays :
     attribute: type, ownerElement : null

Is this conform to what the spec says or not ?


Thanks all

(See attached file: bug.dtd)(See attached file: bug.xml)

Re: Errata in XHTML 1.0

Posted by Jim Clune <ji...@parasoft.com>.
On May 22, 2000, Elliotte Rusty Harold wrote:
> The ATTLIST declaration of xml:space given several times in the XHTML
> 1.0 strict DTD may be incorrect
> ...
> Either XHTML 1.0 or Xerces-J 1.1.0 needs to be fixed here. I don't know
> which one. A clarification from the XML folks would be appreciated.

I had this question as well, and recently received the following response
from François Yergeau through the w3c:
----
The XML Core WG has recently processed a (still unpublished) erratum on
exactly this case, found the language in the XML 1.0 spec (cf. section 2.10)
to be ambiguous, and decided that it was not an error to declare xml:space
the way XHTML does.  Unambiguous language will appear pretty soon in the
revised XML 1.0 spec (not a new version, just a re-edition with the numerous
errata folded in and a modernized look).
----

In light of this, it appears to me that current Xerces behaviour is (or soon
will be) incorrect.

Regards,

Jim Clune
ParaSoft Corporation           email: jim@parasoft.com
2031 S. Myrtle Ave.            voice: (626) 305-0041 x351
Monrovia, CA.  91016           fax  : (626) 305-9048