Re: DOM 2 Spec vs. Java Binding

WEBBER,JIM (HP-UnitedKingdom,ex1) wrote:

>But when I try to cast from CDATASection to CharacterData:
>
>System.Xml.XmlCharacterData cd = (System.Xml.XmlCharacterData)xc;
>
>things work just fine which I would have expected from the spec, but not
>from the Java bindings.
>
>Therefore perhaps my question should have been: Is the Microsoft
>interpretation of the DOM spec compatible with that of the Java camp? If
>not, which is authoritative (W3C I assume)? And how is DOM's cross-platform
>nature not compromised by this?
>  
>
I have no way of answering your question with respect to what Microsoft 
is doing.

The cast from CDataSection to CharacterData should work just fine, but 
would look very different from what you show above:

org.w3c.dom.CDATASection xc;
...
org.w3c.dom.CharacterData cd = xc;

Casting in this direction does not even require a casting operator 
because you are casting to the superclass.  correct me if I made an error.

The class names you used above indicated that it is not DOM or W3C.  If 
you value open public W3C standards and interoperability with other 
platforms, I believe the API you cite your examples from will not give 
you that.  In the past, Microsoft has supported interoperability through 
W3C DOM, Java, etc.  I have no idea what is available from that source 
today.  There are other publicly-available DOM's, such as the one from 
Apache, which support the standard, interoperable APIs which will run in 
your environment if it resembles enough of a Java environment.  It is 
your call.  There are many alternatives out there, depending upon your 
requirements.

Ray Whitmer
rayw@netscape.com

Received on Wednesday, 7 August 2002 12:29:06 UTC