I would say the usual way to present a set of StaX events is to wrap them
using the standardized the XMLStreamReader [1][2][3] interface. Axiom works
on top of StaX and can use the XMLStreamReader to create an OM tree.. Axiom
will pull events out of the given StaXreader as an when needed.
> > My current code does this like follows for "normal" StAX:
> > ...
> > LinkedHashSet<XMLEvent> part = resultTree.get(element);
> > Object[] partResult = part.toArray();
> > for (int i = 0; i < partResult.length; i++) {
> > writer.add((XMLEvent) partResult[i]);
> > }
I'm sorry,I don't have much knowledge about DOM.. Is this XMLEvents are
part of DOM, cause I haven't seen them in the StaX world...
thanks,
Thilina
[1] http://edocs.bea.com/wls/docs90/xml/stax.html
[2] http://www.jcp.org/en/jsr/detail?id=173
[3] http://wso2.org/library/1844
On Tue, Sep 23, 2008 at 6:01 AM, Thorsten Scherler <
[EMAIL PROTECTED]> wrote:
> On Mon, 2008-09-22 at 21:48 +0530, Saliya Ekanayake wrote:
> > Hi,
> >
> > I am not sure exactly on your requirement, but normally Axiom builds
> OMNodes
> > from the XML events on requirement basis. Anyway you can access the
> > underlying StAX parser of Axiom. If you can elaborate more on your
> > requirement it will be helpful in answering your question.
>
> http://markmail.org/message/mwg5le6slrikjyak
>
> "Axiom builds OMNodes from the XML events on requirement basis" so is
> there no way to create a OMNode by passing a xmlevent array?
>
> salu2
>
> > Thanks,
> > Saliya
> >
> > On Mon, Sep 22, 2008 at 5:33 PM, Thorsten Scherler <
> > [EMAIL PROTECTED]> wrote:
> >
> > > Hi all,
> > >
> > > I am looking for the best way to create OMElements based on XMLEvents.
> > >
> > > My current code does this like follows for "normal" StAX:
> > > ...
> > > LinkedHashSet<XMLEvent> part = resultTree.get(element);
> > > Object[] partResult = part.toArray();
> > > for (int i = 0; i < partResult.length; i++) {
> > > writer.add((XMLEvent) partResult[i]);
> > > }
> > > ...
> > >
> > > How can I do something like this with AXIOM?
> > >
> > > salu2
> > > --
> > > Thorsten Scherler
> thorsten.at.apache.org
> > > Open Source Java consulting, training and
> solutions
> > >
> > >
> >
> >
> --
> Thorsten Scherler thorsten.at.apache.org
> Open Source Java consulting, training and solutions
>
>
--
Thilina Gunarathne - http://thilinag.blogspot.com