This looks a bit like a variant of
http://sourceforge.net/tracker/index.php?func=detail&aid=462241&group_id=298
72&atid=397617
Could you let me know:
(a) what version of Saxon you are using
(b) what XML parser you are picking up
And try setting the JAXP properties to use a different parser.
Michael Kay
Software AG
home: Michael.H.Kay@...
work: Michael.Kay@...
> -----Original Message-----
> From: saxon-help-admin@...
> [mailto:saxon-help-admin@... Behalf Of
> jeand@...
> Sent: 19 February 2002 18:55
> To: saxon-help@...
> Subject: [saxon] Differences in Transformer vs TransformerHandler?
>
>
> Hi all,
>
> I'm trying to build a pipeline of handlers of which one is a
> SAXON transformer.
> But no matter how I do this, I don't get a proper transform.
>
> I precompile the stylesheet getting a Templates object. If I then do:
>
> templates.newTransformer().transform(xmlIn, xmlOut)
>
> xmlOut receives all of the proper events and everything is hunk-dory.
>
> However, if I create a TransformerHandler and then do this:
>
> th.setResult(xmlOut);
>
> XMLReader producer =
> SAXParserFactory.newInstance().newSAXParser().getXMLReader();
>
> producer.setContentHandler(th);
>
> producer.parse(xmlIn);
>
> I don't get the proper events. I've turned tracing on and it
> appears that the
> handler way isn't producing the right transform "events".
> Here's a sample of
> the templates trace:
> <Instruction element="messageIn" line="17">
> <Instruction element="header" line="18">
> <Instruction element="sendApp" line="19">
> <Instruction element="xs2:for-each" line="20">
> <Source node="/ZSE_ZW8[1]/MSH[1]/MSH.3[1]" line="-1"
> mode="*default*">
>
> <Instruction element="xs2:call-template" line="21">
> <Instruction element="xs2:template" line="4">
> <Instruction element="xs2:choose" line="5">
> <Instruction element="xs2:otherwise" line="10">
> <Instruction element="xs2:attribute" line="11">
> </Instruction> <!-- xs2:attribute -->
> <Instruction element="xs2:value-of" line="12">
> </Instruction> <!-- xs2:value-of -->
> </Instruction> <!-- xs2:otherwise -->
> </Instruction> <!-- xs2:choose -->
> </Instruction> <!-- xs2:template -->
> </Instruction> <!-- xs2:call-template -->
> </Source><!-- /ZSE_ZW8[1]/MSH[1]/MSH.3[1] -->
> </Instruction> <!-- xs2:for-each -->
> </Instruction> <!-- sendApp -->
>
> and here's the corresponding handler trace:
>
> <Instruction element="messageIn" line="17">
> <Instruction element="header" line="18">
> <Instruction element="sendApp" line="19">
> <Instruction element="xs2:for-each" line="20">
> </Instruction> <!-- xs2:for-each -->
> </Instruction> <!-- sendApp -->
>
>
> Is there something obvious that I'm not doing right? I can
> supply more info
> if required, but I didn't want to clog up everyone's email
> with all the code
> and traces if I didn't need to.
>
> Thanks in advance,
>
> Jean-Henri Duteau
> jeand@...
>
>
>
> _______________________________________________
> saxon-help mailing list
> saxon-help@...
> https://lists.sourceforge.net/lists/listinfo/saxon-help
|