cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roberto Viana <>
Subject Excluding elements in XSL, How?
Date Wed, 17 Jan 2001 16:56:08 GMT
This should be more a specific question for a XSL newsgroup but anyway...

How can I exclude XML elements using a XSL?

for example:
I have a xml file that I want to format pasing it to a XSL, I only want to
format the children elements from page1, page2 elements should not appear in
my formatted file. I tryed this with the XSL described below but I get some

Error found handling the request

org.apache.xalan.xslt.XSLProcessorException: Can't have more than one root
on a DOM!


So in one word what I want to do is: extract data from this XML file, show
this extracted data and the remaining data in the XML should not appear in
the result page.

Thank you for your feedbak!


=====XML file======
 <title>Hello 1</title>
  <paragraph>This is my first Cocoon page!</paragraph>
 <title>Hello 2</title>
  <paragraph>This is my second Cocoon page!</paragraph>

====XSL file======

<xsl:stylesheet version="1.0"

  <xsl:template match="page1">
      <xsl:value-of select="title"/>
    <body bgcolor="#ffffff">

  <xsl:template match="title">
   <h1 align="center">

  <xsl:template match="paragraph">
   <p align="center">



AGENCY.COM : Amsterdam
Eekholt 40, 112 XH Diemen
Postbus 23447
1100 DX  Amsterdam Z.O. The Netherlands
T +31 (0)20 7994000
F +31 (0)20 7994001
ICQ# 47478252


View raw message