cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastien Sahuc <ssa...@imediation.com>
Subject RE: [C2][Xalan2] Transformation failure if SAX events generated p rogramatically
Date Sat, 07 Oct 2000 17:56:07 GMT
dims wrote :
> We have some code that generates SAX
> events which need to be fed to the Transformer (instead of 
> reading from an XML file). This
> produces invalid output. Enclosed is the code and sample 
> based on SAX2SAX. 

> Note that if you use
> foo.xml which is exactly the XML generated by the code 
> programatically then you get valid output.

Well not exactly the same. Indeed there are ONE BIG difference in the way
both method deal with namspaces :
If you put a simple filter between the StatusGenerator and the transfomer
that trace the contentHandler's methods, you'll get :

  startDocument
  startPrefixMapping(, http://apache.org/cocoon/2.0/status)
  startPrefixMapping(xlink, http://www.w3.org/1999/xlink)
  startElement(http://apache.org/cocoon/2.0/status, statusinfo, statusinfo
...
  startElement(http://apache.org/cocoon/2.0/status, group, group ...
[and so on ...]

Whereas if you put the same filter between the XMLReader (parser) and the
transformer the trace change a little bit:

  setDocumentLocator
  startDocument
  startElement(, statusinfo, statusinfo ...
  startElement(, group, group ...

So the output is not the same.. far away to be the same. I would even say
that they are completely different ! :-)

Sebastien

Mime
View raw message