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 20:37:29 GMT
Davanum Srinivas wrote :
> Scott,
> I don't know whether you want to make Xalan2 
> backward-compatible with exising XSL files or you
> want us to change all the XSL files.

Hum... I believe the problem has nothing to do with Xalan2. 

Indeed I ran the transform test of the foo.xml and foo.xsl with XT, Xalan1.2
and Xalan2, and they have the exact same behavior : 
* if the xmlns=".../status" exists in the foo.xml then they fails to
generate HTML since the templates have wrong matcher.
* if the xmlns=".../status" is removed then the correct HTML is generated.
* if the xmlns=".../status' exists and the matchers is revised such as
match="status:*", everything works fine.

So I think that the right question is : how can the hell status2html.xsl can
be working in cocoon2 ? 

I must admit that I'm damn perplexed.

Sebastien



> 
> Thanks Sebastien. So we *MUST* revisit all the XSL files and 
> make sure that the tags are all right
> to use Xalan2 as is. 
> 
> Thanks,
> dims
> 
> --- Sebastien Sahuc <ssahuc@imediation.com> wrote:
> > > 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/
> > > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
> http://photos.yahoo.com/
> 

Mime
View raw message