cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scott Boag/CAM/Lotus" <Scott_B...@lotus.com>
Subject RE: URGENT: Bug/special case in document() function when Xalan is used inCocoon
Date Wed, 02 Aug 2000 13:31:43 GMT

OK, then I think that's all I can do from my end.  Sorry Jayme.

That patch should probably go in anyway.

-scott




                                                                                         
                         
                    "Ed Staub"                                                           
                         
                    <estaub@media        To:     <xalan-dev@xml.apache.org>     
                                  
                    one.net>             cc:     (bcc: Scott Boag/CAM/Lotus)          
                            
                                         Subject:     RE: URGENT: Bug/special case in document()
function when     
                    08/02/2000           Xalan is used inCocoon                          
                         
                    12:48 AM                                                             
                         
                    Please                                                               
                         
                    respond to                                                           
                         
                    xalan-dev                                                            
                         
                                                                                         
                         
                                                                                         
                         



Scott,

This would work if my analysis were correct - which it wasn't!
It was close, though.
More tracing reveals that the pain point is actually not in the inner
XMLParser, but in the transform() method in XalanTransformer.  Sorry for
the
mislead.
Here's the heart of the disconnect:

    public Document transform(Document in, String inBase, Document sheet,
...
        XSLTProcessor processor =
                     XSLTProcessorFactory.getProcessor(new
XMLParser(parser));
...
        XSLTInputSource i = new XSLTInputSource(in);
...
           /*insert new line*/ processor.setSourceDocument(??uri??,in)

        processor.process(i, s, o);

The setSourceDocument would cure the problem, I believe.
But unfortunately, the ??uri?? is not obviously obtainable.
The InputSource here is created from a Document (DeferredDocumentImpl),
which (I believe) reveals/retains no knowledge of whence it came.

Stepping back to the big picture... it seems like it would be really useful
if Documents (DocumentImpls) could hold onto their source URI when it's
meaningful.  I think it would simplify the rest of the plumbing for this
fix, and I think it would have much more general applicability, if only for
debugging and logging.  Make sense?

-Ed Staub

-----Original Message-----
From: Scott_Boag@lotus.com [mailto:Scott_Boag@lotus.com]
Sent: Tuesday, August 01, 2000 9:50 PM
To: xalan-dev@xml.apache.org
Subject: RE: URGENT: Bug/special case in document() function when Xalan
is used inCocoon



Jayme, I talked to Ed about this today.  The problem seems to be in the
XalanTransformer defined within Cocoon, in the XMLParser nested class,
relating to the findURIFromDoc function.  Based on Ed's description of the
issue, and my own *brief* glancing around, I think the fix is, inside
XalanTransformer.java, around line 121:

        public void parse(InputSource in) throws IOException, SAXException
{
          this.document = this.parser.parse(in, false);

          // The Xalan stylesheet is normally built from SAX events,
          // so if a DocumentHandler is specified, we need to produce
          // SAX events from the DOM tree.
          if (m_docHandler != null) {
            (new TreeWalker(m_docHandler)).traverse(this.document);

            // Note that when cocoon transitions to being more SAX based,
            // this function will be called recursivly while the parser is
            // still in the middle of a parse, and thus the parser will
have
            // created on the fly (or perhaps cloned) since the Xerces
parser
            // is not (to my knowledge) reentrant.
          }
          else if(null != in.getSystemId())
            getSourceDocsTable().put(in.getSystemId(), this.document);
        }

Ed, can you take a look at this, and see if it conforms to your analysis of
the problem?  I suspect it does.

Jayme, is it possible you can try and apply this patch to see if it works?
(I didn't try compiling the patch... I don't have Cocoon set up on my
machine... one of my many "todo" items)

-scott





                    "Edwards, Jayme"
                    <JCEdwards@software.roc        To:
"'xalan-dev@xml.apache.org'" <xalan-dev@xml.apache.org>
                    kwell.com>                     cc:     (bcc: Scott
Boag/CAM/Lotus)
                                                   Subject:     RE: URGENT:
Bug/special case in document() function when
                    08/01/2000 07:50 PM            Xalan is used in Cocoon
                    Please respond to
                    xalan-dev






P.S. I can repro this on Cocoon 1.4/Xalan 1.0.1 as well, this is just my
current setup.

Jayme

> -----Original Message-----
> From: Edwards, Jayme [mailto:JCEdwards@software.rockwell.com]
> Sent: Tuesday, August 01, 2000 6:48 PM
> To: 'xalan-dev@xml.apache.org'
> Subject: RE: URGENT: Bug/special case in document() function
> when Xalan
> is used in Cocoon
>
>
> What suggestions? Other than the quotes typo there is nothing
> else I can do to get this to work. As a side note I am using
> Cocoon 1.8 Dev (current CVS image) because I need support for
> the latest released Xerces (which supports XML Schema) and Xalan.
>
> Jayme
>
> > -----Original Message-----
> > From: Paul_Dick@lotus.com [mailto:Paul_Dick@lotus.com]
> > Sent: Tuesday, August 01, 2000 1:39 PM
> > To: xalan-dev@xml.apache.org
> > Subject: RE: URGENT: Bug/special case in document() function
> > when Xalan
> > is used in Cocoon
> >
> >
> >
> > Jayme,
> >
> > Have any of the latest suggestions solved your problems.
> > I've added additional tests to the testsuite and I have not
> > been able to reproduce your problem.  Let us know what's
> > going on!
> >
> > Paul
> >
>









Mime
View raw message