You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Andy Clark <an...@apache.org> on 2002/07/01 16:27:07 UTC

Re: TXElement & TXDocument equivalent in xerces.jar

Sampath K Settipalli wrote:
>     Thanks for the response. I still need to figure out what all methods

Please keep the entire thread on the mailing list. That way,
more people have a chance to help resolve the problems that
you are experiencing.

> are used in the existing application code. However most part seems to be
> like methods in TXElement like setAttribute, getAttribute, appendChild,
> getChildNodes .. so on. I've seen these methods are available in Interface
> org.w3c.dom.Element . But to create an object of Element (like for

I'm sure that you'll find that most methods you are using
are just inherited from the DOM interfaces, like Element.
There were other features that TX* included like being
able to serialize the document back to a stream and also
having programmatic access to the DTD through the Doctype
node. Are you using any of these features?

> TXElement = new TXElement()) with no arguments there isn't any constructor
> in ElementImpl class. Is there any provision in any higher level Impl

This convenience is not available using a vanilla DOM
implementation. And, to keep your code portable among
DOM implementations, you should not rely on this kind
of feature.

Instead, you need to create a Document instance and
then use *that* instance to create the elements,
attributes, and text nodes. (You'll find a whole
assortment of createXXX methods on Document.)

In order to create an empty document, you should use
the JAXP DocumentBuilderFactory/DocumentBuilder API.

You definitely have some porting to do but you'll
end up with code that is more portable and maintainable.
Good luck!

-- 
Andy Clark * andyc@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: TXElement & TXDocument equivalent in xerces.jar

Posted by "Mary H. Maslowski" <ma...@attbi.com>.
inline...
----- Original Message -----
From: "Andy Clark" <an...@apache.org>
To: <xe...@xml.apache.org>
Sent: Monday, July 01, 2002 11:54 PM
Subject: Re: TXElement & TXDocument equivalent in xerces.jar


> Mary H. Maslowski wrote:
> >in XML4J right now, I use the DTD *class* to get the
>  >DTD structure and content model
>
> Are you just looking at what the content model *looks*
> like or are you using it also to perform validation?
>

I use it right now for "what it looks like", to build DOM wrapper metadata
objects
we use a visitor that traverses through the CMNodes and create different
application-defined metadata elements depending on the DTD content model
element types
Any suggestions for this ?

> The "correct" way of doing validation in DOM will be
> the DOM L3 Abstract Schemas module (when done). But the
> Xerces impl currently only supports XML Schema.
>
> --
> Andy Clark * andyc@apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: TXElement & TXDocument equivalent in xerces.jar

Posted by Andy Clark <an...@apache.org>.
Mary H. Maslowski wrote:
>in XML4J right now, I use the DTD *class* to get the 
 >DTD structure and content model

Are you just looking at what the content model *looks*
like or are you using it also to perform validation?

The "correct" way of doing validation in DOM will be
the DOM L3 Abstract Schemas module (when done). But the
Xerces impl currently only supports XML Schema.

-- 
Andy Clark * andyc@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


Re: TXElement & TXDocument equivalent in xerces.jar

Posted by "Mary H. Maslowski" <ma...@attbi.com>.
see inline below with >>> preceding...

----- Original Message -----
From: "Andy Clark" <an...@apache.org>
To: <xe...@xml.apache.org>
Cc: "Sampath K Settipalli" <Sa...@genome.wi.mit.edu>
Sent: Monday, July 01, 2002 9:27 AM
Subject: Re: TXElement & TXDocument equivalent in xerces.jar


> Sampath K Settipalli wrote:
> >     Thanks for the response. I still need to figure out what all methods
>
> Please keep the entire thread on the mailing list. That way,
> more people have a chance to help resolve the problems that
> you are experiencing.
>
> > are used in the existing application code. However most part seems to be
> > like methods in TXElement like setAttribute, getAttribute, appendChild,
> > getChildNodes .. so on. I've seen these methods are available in
Interface
> > org.w3c.dom.Element . But to create an object of Element (like for
>
> I'm sure that you'll find that most methods you are using
> are just inherited from the DOM interfaces, like Element.
> There were other features that TX* included like being
> able to serialize the document back to a stream and also
> having programmatic access to the DTD through the Doctype
> node. Are you using any of these features?

>>> Andy,
>>> in XML4J right now, I use the DTD *class* to get the DTD structure and
content model
>>> Should I use your new DTD handler that you posted on your personal web
site ?
>>> Will that provide similar functionality as the DTD class ?
>>> Thanks, Chuck Maslowski

>
> > TXElement = new TXElement()) with no arguments there isn't any
constructor
> > in ElementImpl class. Is there any provision in any higher level Impl
>
> This convenience is not available using a vanilla DOM
> implementation. And, to keep your code portable among
> DOM implementations, you should not rely on this kind
> of feature.
>
> Instead, you need to create a Document instance and
> then use *that* instance to create the elements,
> attributes, and text nodes. (You'll find a whole
> assortment of createXXX methods on Document.)
>
> In order to create an empty document, you should use
> the JAXP DocumentBuilderFactory/DocumentBuilder API.
>
> You definitely have some porting to do but you'll
> end up with code that is more portable and maintainable.
> Good luck!
>
> --
> Andy Clark * andyc@apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-user-help@xml.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org