cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KOZLOV Roman <r-koz...@opencascade.com>
Subject Re: HELP PLEASE, HELP with Piece of code.
Date Thu, 21 Mar 2002 16:51:36 GMT
Hi,

It seems that the reason of the error is that as a result of
transformation you get several root elements like
<HTML>...</HTML>
<HTML>...</HTML>
...

- one HTML element per "Seleccion/Texto" element in source xml.

I don't know what for you need it, but I think that the root element
should be single or you have to point that you need not output as XML
but text. I don't know how is it possible in cocoon, because it seems
that xsl:output element doesn't work here.

Best regards
        Roman

Ivan Manuel Andrade Muñoz wrote:

> Hello to all.It wanted to request aid, to solve to this error when
> executing my page XML.My arhivo XML:Seleccion.xml<?xml version="1.0"
> encoding="ISO-8859-1" standalone="no"?>
>
> <?xml-stylesheet href="Seleccion.xsl" type="text/xsl"?>
>
> <?cocoon-process type="xslt"?>
>
> <Seleccion>
>
> <Texto>
>
> <titulo>
>
> Sobre Libros:
>
> </titulo>
>
> <opcion>
>
> De Internet.
>
> </opcion>
>
> <opcion>
>
> De Base de Datos.
>
> </opcion>
>
> </Texto>
>
> <Texto>
>
> <titulo>
>
> Un Formulario:
>
> </titulo>
>
> <opcion>
>
> De XML.
>
> </opcion>
>
> <opcion>
>
> De Futbol.
>
> </opcion>
>
> </Texto>
>
> </Seleccion>My archivo XSL:Seleccion.xsl<?xml version="1.0"
> encoding="ISO-8859-1"?>
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <xsl:template match="/">
>
>
>
> <xsl:processing-instruction name="cocoon-format">
>
> type="text/html"
>
> </xsl:processing-instruction>
>
> <xsl:for-each select="Seleccion/Texto">
>
> <HTML>
>
> <HEAD>
>
> <TITLE>
>
> Libro
>
> </TITLE>
>
> <link rel="stylesheet" type="text/css" href="Seleccion.css"
> title="Style"/>
>
> </HEAD>
>
> <BODY background="Arena.gif" aLink="#ff0000" bgColor="#ffffff"
> link="#213d89" text="#000000" vLink="#a15b2a">
>
> <P/>
>
> <CENTER>
>
> <IMG src="Linea.gif"/>
>
> <P/>
>
> <H1>
>
> UNA APLICACION XML
>
> </H1>
>
> <P/>
>
> <IMG src="Linea.gif"/>
>
> <P/>
>
> <H2>
>
> <xsl:value-of select="titulo"/>
>
> </H2>
>
> <H3>
>
> <A HREF="Libros.xml">
>
> <xsl:apply-templates select='opcion'/>
>
> </A>
>
> </H3>
>
> </CENTER>
>
> <CENTER>
>
> <IMG src="Linea.gif"/>
>
> <P/>
>
> <IMG src="Linea.gif"/>
>
> </CENTER>
>
> <P/>
>
> </BODY>
>
> </HTML>
>
> </xsl:for-each>
>
> </xsl:template>
>
> <xsl:template match='opcion'>
>
> <xsl:value-of select="."/>
>
> <P/>
>
> </xsl:template>
>
>
>
> </xsl:stylesheet>My
> error:--------------------------------------------------------------------------------------------------------------------------------------------------------------------Error
> found handling the
> request.---------------------------------------------------------------------------------------------------------------------------------------------------------------------org.apache.xalan.xslt.XSLProcessorException:
> Can't have more than one root on a DOM!
>         at
> org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1674)
>         at
> org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java:1638)
>         at
> org.apache.xalan.xslt.XSLTEngineImpl.process(XSLTEngineImpl.java:671)
>         at
> org.apache.cocoon.transformer.XalanTransformer.transform(XalanTransformer.java:107)
>
>         at
> org.apache.cocoon.processor.xslt.XSLTProcessor.process(XSLTProcessor.java:116)
>
>         at org.apache.cocoon.Engine.handle(Engine.java:384)
>         at org.apache.cocoon.Cocoon.service(Cocoon.java:183)
>         at javax.servlet.http.HttpS!
> ervlet.service(HttpServlet.java:865)
>         at
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
>
>         at org.apache.tomcat.core.Handler.service(Handler.java:287)
>         at
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
>
>         at
> org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
>
>         at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
>
>         at
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
>
>         at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
>
>         at org.apache.tomcat.util.ThreadPo!
> ol$ControlRunnable.run(ThreadPool.java:501)
>      ;    at java.lang.Thread.run(Thread.java:484)
> ---------
> org.xml.sax.SAXException: Can't have more than one root on a DOM!
>         aat
> org.apache.xalan.xpath.xml.FormatterToDOM.append(FormatterToDOM.java:155)
>
>         at
> org.apache.xalan.xpath.xml.FormatterToDOM.startElement(FormatterToDOM.java:260)
>
>         at
> org.apache.xalan.xslt.XSLTEngineImpl.flushPending(XSLTEngineImpl.java:3816)
>
>         at
> org.apache.xalan.xslt.XSLTEngineImpl$ResultTreeHandler.startElement(XSLTEngineImpl.java:3877)
>
>         at
> org.apache.xalan.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:211)
>
>         at
> org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElement.java:661)
>
>         at org.apache.xala!
> n.xslt.ElemLiteralResult.execute(ElemLiteralResult.java:254)
>         at
> org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElement.java:661)
>
>         at
> org.apache.xalan.xslt.ElemTemplateElement.transformChild(ElemTemplateElement.java:1199)
>
>         at
> org.apache.xalan.xslt.ElemTemplateElement.transformSelectedChildren(ElemTemplateElement.java:962)
>
>         at
> org.apache.xalan.xslt.ElemForEach.execute(ElemForEach.java:127)
>         at
> org.apache.xalan.xslt.ElemTemplateElement.executeChildren(ElemTemplateElement.java:661)
>
>         at
> org.apache.xalan.xslt.ElemTemplate.execute(ElemTemplate.java:145)
>         at
> org.apache.xalan.xslt.StylesheetRoot.process(StylesheetRoot.java:443)
>    &! nbsp;    at org.apache.xalan.xslt.XSLTEngineImpl.proces
> s(XSLTEngineImpl.java:647)
>         at
> org.apache.cocoon.transformer.XalanTransformer.transform(XalanTransformer.java:107)
>
>         at
> org.apache.cocoon.processor.xslt.XSLTProcessor.process(XSLTProcessor.java:116)
>
>         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:865)
>         at
> org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
>
>         at org.apache.tomcat.core.Handler.service(Handler.java:287)
>         at
> org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
>
>         ! at
> org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:812)
>
>         at
> org.apache.tomcat.core.ContextManager.service(ContextManager.java:758)
>
>         at
> org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)
>
>         at
> org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
>
>         at
> org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)
>
>         at
> java.lang.Thread.run(Thread.java:484)---------------------------------------------------------------------------------------------------------------------------------------------------------------------------Thank
> you very much, by its aid.
>
>
> -----------------------------------------------------------------------
> MSN Photos es la manera más sencilla de compartir e imprimir sus
> fotos. http://photos.latam.msn.com/Support/WorldWide.aspx
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. To unsubscribe, e-mail: For additional commands,
> e-mail:

Mime
View raw message