I'm not an expert on jelly xml, but my guess is that its something to do
with loading sample1.xml twice. Are you sure the parameters on the transform
tag do what you think they do?

- Brett

> -----Original Message-----
> From: Pavel Sher [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, 17 September 2003 10:32 PM
> To: [EMAIL PROTECTED]
> Subject: XML tag library
> 
> 
> 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 "[EMAIL PROTECTED] 
> [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(TagScr
> ipt.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.TransformerFact
> ory','net.sf.saxon.TransformerFactoryImpl')}
> ${systemScope.setProperty('org.xml.sax.driver','org.apache.xer
ces.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, [EMAIL PROTECTED]
> 
> 

Reply via email to