You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Drasko Kokic <dr...@yahoo.com> on 2001/02/01 09:13:49 UTC

RE: [C1.8.2] xinclude after xsp not working

If I exchange the PI for the XSP and XInclude than I
get error saying that the generated code is out of
64kB boundary (meaning it has to many XML nodes to
wrap into the Java code => XInclude works)
I will play with the XPointer path and try to figure
out what is triggering this bug ... maybe that could
help to pinpoint and fix the problem.

--- Kirk Woerner <ki...@stoneseeker.com> wrote:
> This looks like some kind of XPath bug in the
> XInclude engine and I'm going
> to pass.  Does this same xinclude work when not done
> after an XSP?  Because
> the patch I did really shouldn't change anything
> here.
> 
> Remember, this is a cludge,  Basically there is no
> concept of namespace so
> the attribute names HAVE TO BE EXACTLY
> "xinclude:href" and "xinclude:parse"
> case sensative, otherwise they won't be found.
> 
> > -----Original Message-----
> > From: Drasko Kokic [mailto:drasko_kokic@yahoo.com]
> > Sent: Wednesday, January 31, 2001 4:05 AM
> > To: cocoon-users@xml.apache.org
> > Subject: RE: [C1.8.2] xinclude after xsp not
> working
> >
> >
> > Thanks for your help Kirk ... I have tried your
> > suggestions and have moved one step forward ...
> now I
> > am getting following error message:
> >
> > java.lang.NullPointerException
> >               at
> >
>
org.apache.cocoon.xml.util.XPathAPI.eval(XPathAPI.java:207)
> >               at
> >
>
org.apache.cocoon.xml.util.XPathAPI.selectNodeList(XPathAPI.java:148)
> >               at
> >
>
org.apache.cocoon.xml.util.XPathAPI.selectNodeList(XPathAPI.java:132)
> >               at
> >
>
org.apache.cocoon.processor.xinclude.XIncludeProcessor$XIncludePro
>
cessorWorker.processXIncludeElement(XIncludeProcessor.java:388)
> >               at
> >
>
org.apache.cocoon.processor.xinclude.XIncludeProcessor$XIncludePro
> cessorWorker.process(XIncludeProcessor.java:227)
> >               at
> >
>
org.apache.cocoon.processor.xinclude.XIncludeProcessor.process(XIn
> cludeProcessor.java:139)
> >               at
> > org.apache.cocoon.Engine.handle(Engine.java:384)
> >               at
> > org.apache.cocoon.Cocoon.service(Cocoon.java:183)
> >               at
> >
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> >               at
> >
>
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> >               at
> >
>
org.apache.tomcat.core.Handler.service(Handler.java:286)
> >               at
> >
>
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> >               at
> >
>
org.apache.tomcat.core.ContextManager.internalService(ContextManag
> > er.java:797)
> >               at
> >
>
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> >               at
> >
>
org.apache.tomcat.service.http.HttpConnectionHandler.processConnec
> > tion(HttpConnectionHandler.java:210)
> >               at
> >
>
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> >               at
> >
>
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> >               at
> java.lang.Thread.run(Thread.java:484)
> >
> > Thanks a million for your kind help
> > Drasko
> >
> > --- Kirk Woerner <ki...@stoneseeker.com> wrote:
> > > In order for this to work you have to use
> > >
> > > <include xinclude:parse="xml"
> > >
> >
>
xinclude:href="konto-demo.xml#xpointer(/PAGE/PEPSi[@MSISDN='491793
> > 894939'])"
> > > />
> > >
> > > or
> > > <xinclude:include xinclude:parse="xml"
> > >
> >
>
xinclude:href="konto-demo.xml#xpointer(/PAGE/PEPSi[@MSISDN='491793
> > 894939'])"
> > > />
> > >
> > > rather than
> > >
> > > <PEPSi xinclude:parse="xml"
> > >
> >
>
xinclude:href="konto-demo.xml#xpointer(/PAGE/PEPSi[@MSISDN='491793
> > 894939'])"
> > > />
> > >
> > >
> > > This fix is a total hack but it's because for
> some
> > > reason the nodes created
> > > by XSP are not DOM2 still
> > >
> > > > -----Original Message-----
> > > > From: Donald Ball
> [mailto:balld@webslingerZ.com]
> > > > Sent: Tuesday, January 30, 2001 11:36 AM
> > > > To: cocoon-users@xml.apache.org
> > > > Cc: kirk@stoneseeker.com
> > > > Subject: Re: [C1.8.2] xinclude after xsp not
> > > working
> > > >
> > > >
> > > > On Tue, 30 Jan 2001, Drasko Kokic wrote:
> > > >
> > > > > Sorry ... here is the newest output:
> > > > >
> > > > > <?xml version="1.0" encoding="UTF-8"?>
> > > > > <PAGE
> > > > >
> > >
> >
>
xmlns:request="http://www.apache.org/1999/XSP/Request">
> > > > >
> > > > >     <TITLE>LOOP KontoCheck - MSISDN
> v0.3</TITLE>
> > > > >     <PEPSi
> > > > >
> > > >
> > >
> >
>
xinclude:href="konto-demo.xml#xpointer(/PAGE/PEPSi[@MSISDN=&apos;4
> > > > 91793894939&apos;])"
> > > > > xinclude:parse="xml"/>
> > > > >   <!--Processed by XInclude--></PAGE>
> > > > > <!-- This page was served in 6560
> milliseconds
> > > by
> > > > > Cocoon 1.8.2 -->
> > > >
> > > > i must confess puzzlement that this isn't
> working.
> > > i'm copying kirk
> > > > woerner on this since it's his patch that was
> > > supposed to fix this, maybe
> > > > he has some insight. i note with interest that
> the
> > > xinclude namespace is
> > > > not declared on this page. that's kind of
> strange.
> > > >
> > > > - donald
> > > >
> > >
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > Please check that your question has not already
> been
> > > answered in the
> > > FAQ before posting.
> > > <http://xml.apache.org/cocoon/faqs.html>
> > >
> > > To unsubscribe, e-mail:
> > > <co...@xml.apache.org>
> > > For additional commands, e-mail:
> > > <co...@xml.apache.org>
> > >
> >
> >
> > __________________________________________________
> > Get personalized email addresses from Yahoo! Mail
> - only $35
> > a year!  http://personal.mail.yahoo.com/
> >
> >
>
---------------------------------------------------------------------
> > Please check that your question has not already
> been answered in the
> > FAQ before posting.
> <http://xml.apache.org/cocoon/faqs.html>
> >
> > To unsubscribe, e-mail:
> <co...@xml.apache.org>
> 
=== message truncated ===


__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

RE: [C1.8.2] xinclude after xsp not working

Posted by Kirk Woerner <ki...@stoneseeker.com>.
What I really meant was, try the XInclude without the XSP at all.  Just put
it in an xml file and see what happens.

>
> If I exchange the PI for the XSP and XInclude than I
> get error saying that the generated code is out of
> 64kB boundary (meaning it has to many XML nodes to
> wrap into the Java code => XInclude works)
> I will play with the XPointer path and try to figure
> out what is triggering this bug ... maybe that could
> help to pinpoint and fix the problem.
>
> --- Kirk Woerner <ki...@stoneseeker.com> wrote:
> > This looks like some kind of XPath bug in the
> > XInclude engine and I'm going
> > to pass.  Does this same xinclude work when not done
> > after an XSP?  Because
> > the patch I did really shouldn't change anything
> > here.
> >
> > Remember, this is a cludge,  Basically there is no
> > concept of namespace so
> > the attribute names HAVE TO BE EXACTLY
> > "xinclude:href" and "xinclude:parse"
> > case sensative, otherwise they won't be found.
> >
> > > -----Original Message-----
> > > From: Drasko Kokic [mailto:drasko_kokic@yahoo.com]
> > > Sent: Wednesday, January 31, 2001 4:05 AM
> > > To: cocoon-users@xml.apache.org
> > > Subject: RE: [C1.8.2] xinclude after xsp not
> > working
> > >
> > >
> > > Thanks for your help Kirk ... I have tried your
> > > suggestions and have moved one step forward ...
> > now I
> > > am getting following error message:
> > >
> > > java.lang.NullPointerException
> > >               at
> > >
> >
> org.apache.cocoon.xml.util.XPathAPI.eval(XPathAPI.java:207)
> > >               at
> > >
> >
> org.apache.cocoon.xml.util.XPathAPI.selectNodeList(XPathAPI.java:148)
> > >               at
> > >
> >
> org.apache.cocoon.xml.util.XPathAPI.selectNodeList(XPathAPI.java:132)
> > >               at
> > >
> >
> org.apache.cocoon.processor.xinclude.XIncludeProcessor$XIncludePro
> >
> cessorWorker.processXIncludeElement(XIncludeProcessor.java:388)
> > >               at
> > >
> >
> org.apache.cocoon.processor.xinclude.XIncludeProcessor$XIncludePro
> > cessorWorker.process(XIncludeProcessor.java:227)
> > >               at
> > >
> >
> org.apache.cocoon.processor.xinclude.XIncludeProcessor.process(XIn
> > cludeProcessor.java:139)
> > >               at
> > > org.apache.cocoon.Engine.handle(Engine.java:384)
> > >               at
> > > org.apache.cocoon.Cocoon.service(Cocoon.java:183)
> > >               at
> > >
> >
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> > >               at
> > >
> >
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
> > >               at
> > >
> >
> org.apache.tomcat.core.Handler.service(Handler.java:286)
> > >               at
> > >
> >
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
> > >               at
> > >
> >
> org.apache.tomcat.core.ContextManager.internalService(ContextManag
> > > er.java:797)
> > >               at
> > >
> >
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
> > >               at
> > >
> >
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnec
> > > tion(HttpConnectionHandler.java:210)
> > >               at
> > >
> >
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
> > >               at
> > >
> >
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
> > >               at
> > java.lang.Thread.run(Thread.java:484)
> > >
> > > Thanks a million for your kind help
> > > Drasko
> > >
> > > --- Kirk Woerner <ki...@stoneseeker.com> wrote:
> > > > In order for this to work you have to use
> > > >
> > > > <include xinclude:parse="xml"
> > > >
> > >
> >
> xinclude:href="konto-demo.xml#xpointer(/PAGE/PEPSi[@MSISDN='491793
> > > 894939'])"
> > > > />
> > > >
> > > > or
> > > > <xinclude:include xinclude:parse="xml"
> > > >
> > >
> >
> xinclude:href="konto-demo.xml#xpointer(/PAGE/PEPSi[@MSISDN='491793
> > > 894939'])"
> > > > />
> > > >
> > > > rather than
> > > >
> > > > <PEPSi xinclude:parse="xml"
> > > >
> > >
> >
> xinclude:href="konto-demo.xml#xpointer(/PAGE/PEPSi[@MSISDN='491793
> > > 894939'])"
> > > > />
> > > >
> > > >
> > > > This fix is a total hack but it's because for
> > some
> > > > reason the nodes created
> > > > by XSP are not DOM2 still
> > > >
> > > > > -----Original Message-----
> > > > > From: Donald Ball
> > [mailto:balld@webslingerZ.com]
> > > > > Sent: Tuesday, January 30, 2001 11:36 AM
> > > > > To: cocoon-users@xml.apache.org
> > > > > Cc: kirk@stoneseeker.com
> > > > > Subject: Re: [C1.8.2] xinclude after xsp not
> > > > working
> > > > >
> > > > >
> > > > > On Tue, 30 Jan 2001, Drasko Kokic wrote:
> > > > >
> > > > > > Sorry ... here is the newest output:
> > > > > >
> > > > > > <?xml version="1.0" encoding="UTF-8"?>
> > > > > > <PAGE
> > > > > >
> > > >
> > >
> >
> xmlns:request="http://www.apache.org/1999/XSP/Request">
> > > > > >
> > > > > >     <TITLE>LOOP KontoCheck - MSISDN
> > v0.3</TITLE>
> > > > > >     <PEPSi
> > > > > >
> > > > >
> > > >
> > >
> >
> xinclude:href="konto-demo.xml#xpointer(/PAGE/PEPSi[@MSISDN=&apos;4
> > > > > 91793894939&apos;])"
> > > > > > xinclude:parse="xml"/>
> > > > > >   <!--Processed by XInclude--></PAGE>
> > > > > > <!-- This page was served in 6560
> > milliseconds
> > > > by
> > > > > > Cocoon 1.8.2 -->
> > > > >
> > > > > i must confess puzzlement that this isn't
> > working.
> > > > i'm copying kirk
> > > > > woerner on this since it's his patch that was
> > > > supposed to fix this, maybe
> > > > > he has some insight. i note with interest that
> > the
> > > > xinclude namespace is
> > > > > not declared on this page. that's kind of
> > strange.
> > > > >
> > > > > - donald
> > > > >
> > > >
> > > >
> > > >
> > >
> >
> ---------------------------------------------------------------------
> > > > Please check that your question has not already
> > been
> > > > answered in the
> > > > FAQ before posting.
> > > > <http://xml.apache.org/cocoon/faqs.html>
> > > >
> > > > To unsubscribe, e-mail:
> > > > <co...@xml.apache.org>
> > > > For additional commands, e-mail:
> > > > <co...@xml.apache.org>
> > > >
> > >
> > >
> > > __________________________________________________
> > > Get personalized email addresses from Yahoo! Mail
> > - only $35
> > > a year!  http://personal.mail.yahoo.com/
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > Please check that your question has not already
> > been answered in the
> > > FAQ before posting.
> > <http://xml.apache.org/cocoon/faqs.html>
> > >
> > > To unsubscribe, e-mail:
> > <co...@xml.apache.org>
> >
> === message truncated ===
>
>
> __________________________________________________
> Get personalized email addresses from Yahoo! Mail - only $35
> a year!  http://personal.mail.yahoo.com/
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
>
>


RE: [C1.8.2] xinclude after xsp not working

Posted by Donald Ball <ba...@webslingerZ.com>.
On Thu, 1 Feb 2001, Drasko Kokic wrote:

> NPE at the XIncludeProcessor.java:396 if I just
> specify     <include xinclude:parse="xml"
> xinclude:href="konto-demo.xml" />
>
> I have noticed that in the XIncludeProcessor.java
> around this place there is dubious code block:
>
> 	Document included_document = null;
> 	try {
> 		included_document = parser.parse(input,false);
>
> stripDocumentTypeNodes(included_document.getDocumentElement());
> 	} catch (Exception e) { }
>
> I suspect that the included_document variable remains
> null for some reason and the errors/exceptions remain
> unnoticed :-(

i'd bet your included xml file is not well formed, then. you could try
putting some debugging calls in the catch block, or try to parse it from
the command line.

> Has anybody got a simple XInclude code working (from
> the local file with or without XPath part) ?!
> How could I use the logger object to debug this code?

dunno, i don't know how to use the logger object *blush*.

- donald


RE: [C1.8.2] xinclude after xsp not working

Posted by Drasko Kokic <dr...@yahoo.com>.
Yeah sure ... I am not trying to produce a solution by
XInclud(e)-ing and than XSP-ing ... it was just a
reply to Kirk's question if XInclude works being
called before XSP.

Also I have to admit that I am NOT getting error
related to 64kB boundary ... the XInclude simply
doesn't work for me ANYMORE (since 1.8.2)  Just to be
sure that I am not dreaming I am now trying step by
step to find what is going on.  Till now I have found:

NPE at the XIncludeProcessor.java:396 if I just
specify     <include xinclude:parse="xml"
xinclude:href="konto-demo.xml" />

I have noticed that in the XIncludeProcessor.java
around this place there is dubious code block:

	Document included_document = null;
	try {
		included_document = parser.parse(input,false);
	
stripDocumentTypeNodes(included_document.getDocumentElement());
	} catch (Exception e) { }

I suspect that the included_document variable remains
null for some reason and the errors/exceptions remain
unnoticed :-(

Has anybody got a simple XInclude code working (from
the local file with or without XPath part) ?!
How could I use the logger object to debug this code?

HELP
Drasko

--- Donald Ball <ba...@webslingerZ.com> wrote:
> On Thu, 1 Feb 2001, Drasko Kokic wrote:
> 
> > If I exchange the PI for the XSP and XInclude than
> I
> > get error saying that the generated code is out of
> > 64kB boundary (meaning it has to many XML nodes to
> > wrap into the Java code => XInclude works)
> 
> you _absolutely_ want the xinclude coming _after_
> xsp if you can help it,
> if you're up against the 64k barrier.
> 
> - donald
> 
> 
>
---------------------------------------------------------------------
> Please check that your question has not already been
> answered in the
> FAQ before posting.
> <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail:
> <co...@xml.apache.org>
> For additional commands, e-mail:
> <co...@xml.apache.org>
> 


__________________________________________________
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

RE: [C1.8.2] xinclude after xsp not working

Posted by Donald Ball <ba...@webslingerZ.com>.
On Thu, 1 Feb 2001, Drasko Kokic wrote:

> If I exchange the PI for the XSP and XInclude than I
> get error saying that the generated code is out of
> 64kB boundary (meaning it has to many XML nodes to
> wrap into the Java code => XInclude works)

you _absolutely_ want the xinclude coming _after_ xsp if you can help it,
if you're up against the 64k barrier.

- donald