Hi All,
I started exploring on the output side and creating my own DOM
structure using Xalan's transform method.
As discussed in the group before, I am depending on XSLTResultTarget
class for this. This class accepts a FormatterToXercesDOM class in its
constructor. FormatterToXercesDOM is derived from an abstract class
FormatterLister, which is a class derived from DocumentHandler.
So here I created a new class that is derived from FormatterListener
and passes on the events to another clas that is derived from
ContentHandler. (The existing parser in my code is derived from
ContentHandler).
Here I came across following problem,
all parsers that derive from DocumentHandler are using AttributeList
objects and all those who derive from ContentHandler are using
Attributes class. The major difference is, Attributes does not have
URI,QName explicitely.
Now I need to bridge AttributeList class to Attributes class. I would
like to know whether any of you worked on a similar problem before and
have some clues on converting attributelist class to attributes ?
Any pointers and help is highly appreciated.
Thanks
Ganesh
Tjerk Wolterink <tjerk@wolterinkwebdesign.com> wrote in message news:<4180b49a$0$62020$ee9da40f@news.wanadoo.nl>.. .[color=blue]
> Ganesh Gella wrote:[color=green]
> > Hi,
> >
> > Thanks for your reply.
> > Let me try to explain the problem in some detail now.
> >
> > Yes, my intention is to xonvert one XML document to another using XLS.
> > And Xalan has some C++ APIs for it.[/color]
>
> I'm not excellent C++ programmer,
> but i know java well, and object oriented design principles,
> so i think i can help.
>[color=green]
> >
> > Xalan accepts a xml file, a stream and a xerces dom object also (using
> > parserliason,domsupport classes) as an input and gives the result in
> > XSLTResultTarget class.
> >
> > Here my problem is, our code is already having it's own DOM object
> > (different from xerces DOM) which is constructed based on SAX events.[/color]
>
> Ok, so: you have your own Node classes?
> Your own Element classes?
>
> Is that right?
>[color=green]
> >
> > I wanted to know how to plug-in this DOM object to Xalan's transform
> > methods so that I can use it's transform capabilities.[/color]
>
> Well, if you have your own Dom (Node, Element,Attribute) classes
> then that is impossible *i think*.
>
> Unless:
>
> first, why do you have your own Dom classes?
> Probably to give some extended functionality.
>
> But if you want to give Dom classes extended functionality,
> you should subclass the XalanNode classes [ XalanElement etc]
> wich you want to have more functionality.[color=green]
> >
> > It has built-in methods to transform, xerces doms, I wanted to know is
> > there any way we can plug in our own DOM objects and get the output in
> > may be xerces dom or in the same format that we need.[/color]
>
>
> Then *i think* you can transform it using Xalan XSLT processor.
> You get a Xerces dom in return.
>[color=green]
> >
> > Or in other words, my question can be phrased like this,
> >
> > Do xalan transform methods always require a already built-in DOM objects
> > ? Can transform methods accept SAX events ? such that it itself creates
> > the dom and throws us resultant sax events ? (Once it throws the sax
> > events, we can build our own DOM (like xerces DOM).[/color]
>
> I do not know much about events in xalan, so i cant help you there.
>[color=green]
> >
> > Your inputs and ideas are highly appreciated in this regard.
> >
> > Thanks and Regards
> > Ganesh Gella
> >
> > *** Sent via Developersdex
http://www.developersdex.com ***
> > Don't just participate in USENET...get rewarded for it![/color][/color]