You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by "Edwards, Jayme" <JC...@software.rockwell.com> on 2000/08/02 20:08:42 UTC

RE: URGENT: Bug/special case in document() function when Xalan is used inCocoon

This makes alot of sense to me. Part of the reason I need this functionality is I am developing XML schemas for a server application that uses XSL and SOAP to provide access to elements in documents as objects. Part of the grammar of instances of these documents allows some standard directory structures relative to a given instance, from which document() could be used to "include" other documents as in xsd:include and xsl:include.

Jayme

> -----Original Message-----
> From: Ed Staub [mailto:estaub@mediaone.net]
> Sent: Tuesday, August 01, 2000 11:49 PM
> To: xalan-dev@xml.apache.org
> Subject: RE: URGENT: Bug/special case in document() function 
> when Xalan
> is used inCocoon
> 
> 
> 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'" <xa...@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
> > >
> >
> 
> 
> 
>