You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Ganesh Gella <Ga...@Siebel.com> on 2004/11/11 23:25:48 UTC

Question on Xalan's DOM and creating a custom DOM structures.

Hi All,
 
I am planning to use Xalan's transform methods and build my own custom
type DOM structure. (DOM Node, Element are different from xerces).
 
Here, I saw that Xalan is using DocumentHandler for SAX and also using
AttributeList classes.
 
I have a infrastructure, that prepares my DOM using ContentHandler,
which required Attributes class.
 
Can some one tell me, is there a version of Xalan that uses
ContentHandler class and Attributes classses ?
 
Or if some one can tell me how to convert AttributeType objects to
Attributes object that also would be fine.
 
Here precisely, what I am planning to do is, 
 
1) Xalan's transform method requires XSLTResultTarget
2) XSLTResultTarget can be made from FormatterToXercesDOM (derived from
FormatterLister which is derived from DocumentHandler).
3) I am creating my own class that derives from FormatterListener and
sends the requests to another class which is derived from
ContentHandler. ( I needed this bridge because my existing
infrastructure is using ContentHandler and Xalana's FormatterListener
works with DocumentHandler).
 
Any pointers from you on this is highly appreciated.
 
Thanks
Ganesh.
 

------------------------------------------------------------------------------
This e-mail message is for the sole use of the intended recipient(s) and contains confidential and/or privileged information belonging to Siebel Systems, Inc. or its customers or partners.  Any unauthorized review, use, copying, disclosure or distribution of this message is strictly prohibited.  If you are not an intended recipient of this message, please contact the sender by reply e-mail and destroy all soft and hard copies of the message and any attachments.  Thank you for your cooperation.
====================================================

Re: Question on Xalan's DOM and creating a custom DOM structures.

Posted by da...@us.ibm.com.
Hi Ganesh,

You should make sure when you post to Xalan-Dev that you are explicit 
about which version of Xalan (C++, or Java) you are using, as this will 
ensure there isn't massive confusion about your post.

The question you're asking relates to a problem we already know about. 
Xalan-C currently uses a class that is based on the original SAX 
DocumentHandler class, and not the new SAX2 ContentHandler class.  It 
would be nice if we had an adapter that would take you from SAX1 to SAX2, 
but we don't have that right now.

However, we do have some pieces which will make your job easier should you 
choose to implement something like this.  Take a look at the 
StylesheetHandler class, which derives from FormatterListener, and look at 
how it works with the Stylesheet class to extract namespace declarations 
from the list of attributes.  That should at least give you a start on how 
you can keep track of the in-scope namespace bindings.

Dave





"Ganesh Gella" <Ga...@Siebel.com>
11/11/2004 02:25 PM
Please respond to xalan-dev
 
        To:     xalan-dev@xml.apache.org
        cc:     (bcc: David N Bertoni/Cambridge/IBM)
        Subject:        Question on Xalan's DOM and creating a custom DOM 
structures.

Hi All,
 
I am planning to use Xalan's transform methods and build my own custom 
type DOM structure. (DOM Node, Element are different from xerces).
 
Here, I saw that Xalan is using DocumentHandler for SAX and also using 
AttributeList classes.
 
I have a infrastructure, that prepares my DOM using ContentHandler, which 
required Attributes class.
 
Can some one tell me, is there a version of Xalan that uses ContentHandler 
class and Attributes classses ?
 
Or if some one can tell me how to convert AttributeType objects to 
Attributes object that also would be fine.
 
Here precisely, what I am planning to do is, 
 
1) Xalan's transform method requires XSLTResultTarget
2) XSLTResultTarget can be made from FormatterToXercesDOM (derived from 
FormatterLister which is derived from DocumentHandler).
3) I am creating my own class that derives from FormatterListener and 
sends the requests to another class which is derived from ContentHandler. 
( I needed this bridge because my existing infrastructure is using 
ContentHandler and Xalana's FormatterListener works with DocumentHandler).
 
Any pointers from you on this is highly appreciated.
 
Thanks
Ganesh.
 
------------------------------------------------------------------------------
This e-mail message is for the sole use of the intended recipient(s) and 
contains confidential and/or privileged information belonging to Siebel 
Systems, Inc. or its customers or partners. Any unauthorized review, use, 
copying, disclosure or distribution of this message is strictly 
prohibited. If you are not an intended recipient of this message, please 
contact the sender by reply e-mail and destroy all soft and hard copies of 
the message and any attachments. Thank you for your cooperation.
====================================================


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org