commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@multitask.com.au
Subject [jelly] Re: XML tag library
Date Thu, 18 Sep 2003 01:18:36 GMT
This appears to be a Jelly problem.
--
dIon Gillard, Multitask Consulting
Blog:      http://blogs.codehaus.org/people/dion/


"Pavel Sher" <pavel@actimind.com> wrote on 17/09/2003 10:32:22 PM:

> Hello,
> 
> When I am trying to process the following Jelly script I've got the 
error:
> [java] org.apache.commons.jelly.JellyTagException: file:/C:
> /Work/SDS/templates/sample1.xhtml:31:105: <x:transform> The node 
> "org.dom4j.tree.DefaultElement@97d01f [Element: <h1 attributes: []
> />]" could not be added to the branch "null" because: Cannot add 
> another element to this Document as it already has  a root element of: 
h1
> [java]      at org.apache.commons.jelly.impl.TagScript.
> handleException(TagScript.java:683)
> 
> 
> Script:
> 
> <?xml version="1.0"?>
> <j:jelly xmlns="http://my.uri.com" xmlns:j="jelly:core" 
xmlns:x="jelly:xml">
> ${systemScope.setProperty('javax.xml.transform.
> TransformerFactory','net.sf.saxon.TransformerFactoryImpl')}
> ${systemScope.setProperty('org.xml.sax.driver','org.apache.xerces.
> parsers.SAXParser')}
> 
> <html>
> <head>
>     <title>The first sample</title>
> </head>
> <body>
> 
>     <x:transform xslt="${basedir}/stylesheets/sample1-toc.xsl" 
> xml="${basedir}/xml/sample1.xml" var="toc"/>
>     <x:transform xslt="${basedir}/stylesheets/sample1.xsl" 
> xml="${basedir}/xml/sample1.xml" var="book"/>
> 
>     <table border="1" cellspacing="0" cellpadding="0">
>     <tr>
>         <td>Table Of Contents</td>
>     </tr>
>     <tr>
>         <td>
>             <!-- TOC -->
>             <x:copyOf select="$toc"/>
>             <!-- TOC -->
>         </td>
>     </tr>
>     </table>
> 
>     <table border="0" cellspacing="0" cellpadding="0">
>     <tr>
>         <td>
>             <!-- BODY -->
>             <x:copyOf select="$book"/>
>             <!-- BODY -->
>         </td>
>     </tr>
>     </table>
> 
> </body>
> </html>
> </j:jelly>
> 
> If I use comment out second <x:transform var="book"/> and remove 
> second <x:copyOf/> then the script works fine.
> Maybe somebody knows why?
> 
> --
> Best regards
> 
> Pavel Sher, pavel@actimind.com
> 


Mime
View raw message