That's excactly the kind of problems I'm also having. I was
using DOM input with Xalan 1.1 and ran into problems with
version 1.2 (see also older postings).
The samples didn't helped me a lot either, because I couldn't
find the interesting part.
Somebody mentioned, that the xalan/c/test directory contains
some hints how to implement DOM intput. That's something I will
give a closer look, as soon as I find the time.
I'm currently working around this problem by serializing the DOM
to a stream and transform from there as follows:

        std::strstream xmlStream;
        DOMSerializerFormatTarget* tgt = new DOMSerializerFormatTarget(xmlStream);
        DOMSerializer* ser = new DOMSerializer();
        ser->serialize(tgt, m_doc);
        XalanTransformer::initialize();
        XSLTInputSource     domIn(&xmlStream);
        XSLTInputSource         theXsl(xslFile);
        XalanDOMString          target(outFile);
        std::ofstream outStream;
        outStream.open(outFile);
        XalanTransformer theXalanTransformer;
        theXalanTransformer.transform(domIn, theXsl, outStream);

I'm using the DOMSerializer class from Evert Haasdijk
([EMAIL PROTECTED])
for that purpose.

Achim


-----Original Message-----
From: Bryan Mulvihill [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 04, 2001 11:36 PM
To: [EMAIL PROTECTED]
Subject: Re: DOM Input woes



The usage pattern doc was what I was using.  Unfortuneatly it stops after
the XSLTInputSource.  The TraceListen sample doesn't use a Xerces DOM so
mixing the two has given mysterious crashes and I'm not sure as to what does
what.  If anybody has working Xerces DOM conversion, then I would like to
see it.


>
> You can still transform a Xerces DOM instance dynamically, you just can't
> use a XalanTransformer instance to do it.
>
> If you're using the internal APIs, then nothing changes.  The TraceListen
> sample still uses the internal APIs, so you can look there for information
> on how to use those APIs.  You can also see this usage pattern which is in
> the doc for more information on how to substitute the Xerces DOM for our
> source tree:
>
>    http://xml.apache.org/xalan-c/usagepatterns.html#dom
>
> Dave
>
>
>
>
>                       "Bryan
>                       Mulvihill"               To:
<[EMAIL PROTECTED]>
>                       <bryan@amconrese         cc:      (bcc: David N
Bertoni/CAM/Lotus)
>                       arch.net>                Subject: DOM Input woes
>
>                       09/04/2001 01:30
>                       PM
>                       Please respond
>                       to xalan-dev
>
>
>
>
>
> I am trying to transform a xerces DOM that is created dynamically, but
> after going through the archieves, it appears that this cannot be
> accomplished in ver.1.2.
>
> Is there a way to serializer my DOM and pass that to xalan?  If so, can
you
> give a small code sample?
>
> Can a Xalan DOM be generated dynamically and then transformed? If so, can
> you give a small code sample?
>
> Any help would be much appreciated.
>
> Bryan Mulvihill
> Software Developer
> AMCon Research Inc., Ottawa, Ontario, Canada
> http://www.amconresearch.com
>
>


Reply via email to