cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From AK...@burntsand.com
Subject RE: VoiceXML Application using Cocoon
Date Tue, 13 Feb 2001 22:10:26 GMT
Donald,

It works now - I had to include <![CDATA[
 after the <xsp:logic> tag.

Another problem was that I was passing the
wrong document type to cloneNode.  You need
to pass the "document" object which is available
to the xsp page and not your XML document.

The program is working fine now - I'm able
to translate the xml generated into a simpe
HTML page by using an appropriate transform.
Converting to VoiceXML is now a simple extension.

Thanks for you help.

-----Original Message-----
From: Ayub Khan 
Sent: Tuesday, February 13, 2001 1:00 PM
To: cocoon-users@xml.apache.org
Subject: RE: VoiceXML Application using Cocoon


Donald,

Thanks for your suggestion.

I tried out your idea of :
<xsp:logic>
  xspCurrentNode.appendChild(XSPUtil.cloneNode(yourRootElement,document));
</xsp:logic>

However, I'm getting an error message.

Basically,  the code does not invoke the XSLT processor - only the XSP
processor
is invoked.  Will doing this simply show the XML that is generated when the
XSP page is invoked.

Here's my code and following it is the error message.
The logic within the <xsp:logic> tags (except for the Cocoon
specific part )works perfectly when tested alone as a
standalone Java program.

Any help on this will be greatly appreciated.

Thanks

Ayub

=======================C O D E===========================

<?xml version="1.0"?>

<?cocoon-process type="xsp"?>

<xsp:page  xmlns:xsp="http://www.apache.org/1999/XSP/Core">
	<xsp:structure>
    		<xsp:include>java.net.URL</xsp:include>
    		<xsp:include>oracle.xml.parser.v2.XMLDocument</xsp:include>
  	</xsp:structure>

	<xmlfeed>
  		<xsp:logic>
			URL getXMLFeed = new
URL("http://p.moreover.com/cgi-local/page?c=Biotech%20news&o=xml");
			InputStream in = getXMLFeed.openStream();
			DOMParser dp = new DOMParser();
			dp.setValidationMode(false);
			dp.setPreserveWhitespace(true);
			dp.parse(in);
			XMLDocument xd = (XMLDocument)dp.getDocument();
			Element rootEl = xd.getDocumentElement();
			String  rootStr = rootEl.getTagName();
			NodeList nl = xd.getElementsByTagName(rootStr);
			Node ni = nl.item(0);
	
xspCurrentNode.appendChild(XSPUtil.cloneNode(ni,xd)); 
  		</xsp:logic>
	</xmlfeed>
</xsp:page>

=======================C O D E===========================




=======================E R R O R===========================

Error found handling the request.
org.xml.sax.SAXParseException: The reference to entity "o" must end with the
';' delimiter.
	at
org.apache.cocoon.parser.AbstractParser.fatalError(AbstractParser.java:105)
	at
org.apache.xerces.framework.XMLParser.reportError(XMLParser.java:1037)
	at
org.apache.xerces.framework.XMLDocumentScanner.reportFatalXMLError(XMLDocume
ntScanner.java:634)
	at
org.apache.xerces.framework.XMLDocumentScanner$ContentDispatcher.dispatch(XM
LDocumentScanner.java:1308)
	at
org.apache.xerces.framework.XMLDocumentScanner.parseSome(XMLDocumentScanner.
java:380)
	at org.apache.xerces.framework.XMLParser.parse(XMLParser.java:900)
	at org.apache.cocoon.parser.XercesParser.parse(XercesParser.java:85)
	at
org.apache.cocoon.parser.AbstractParser.parse(AbstractParser.java:83)
	at
org.apache.cocoon.producer.ProducerFromFile.getDocument(ProducerFromFile.jav
a:78)
	at org.apache.cocoon.Engine.handle(Engine.java:359)
	at org.apache.cocoon.Cocoon.service(Cocoon.java:183)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:208)
	at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:1127)
	at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:1529)
	at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
	at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)

=======================E R R O R===========================



Thanks




-----Original Message-----
From: Donald Ball [mailto:balld@webslingerZ.com]
Sent: Tuesday, February 13, 2001 11:11 AM
To: cocoon-users@xml.apache.org
Subject: RE: VoiceXML Application using Cocoon


On Tue, 13 Feb 2001 AKhan@burntsand.com wrote:

> My problem is that the XML info (which I've aquired from
> an XML News Feed ) is present in the form of
> and in-memory XML Document and not as the XML contents of the
> XSP file.
>
> So do I have to :
>
> 1) Traverse the in-memory XML Document and programmatically
> build up the XML contents of the XSP file

er, no, try <xsp:expr>yourRootElement</xsp:expr>

failing that (can't remember what the constraints are on xsp:expr), you
could do this:

<xsp:logic>
  xspCurrentNode.appendChild(XSPUtil.cloneNode(yourRootElement,document));
</xsp:logic>

or you could write your own producer, but i think will prove to be less
flexible than an xsp solution.

- 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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>

---------------------------------------------------------------------
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>

Mime
View raw message