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 18:34:42 GMT
> Sebastien,
> 
> Let me clarify, Here's that i did.
> 
> Step 1: Use StatusGenerator and serialize the output to FOO.XML.

That where it hurts: you must set the namespaces feature to the reader, so
that the output elements remain exactly in the same namespace :

reader.setFeature("http://xml.org/sax/features/namespaces", true);

> Step 2: Use StatusGenerator and run a transform using FOO.XSL.
> Step 3: Use FOO.XML from Step #1 and run a transform using FOO.XSL.
> 
> The output from Step #2 and Step #3 Should be identical in my 
> opinion. That's what i meant.
> 
> Now my question to you is Should we change StatusGenerator 
> code? Or should Xalan2 handle Step#2
> and Step#3 in an identical fashion?????

Once you set the namespaces feature, Xalan2 will handle both processing in
the same fashion. Unfortunately it does not work because of the stylesheet
not handling the default namespace.. :-(

Sebastien

> 
> Thanks,
> dims
> 
> 
> --- Sebastien Sahuc <ssahuc@imediation.com> wrote:
> > 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
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
> http://photos.yahoo.com/
> 

Mime
View raw message