cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Piroumian" <KPiroum...@flagship.ru>
Subject Re: problem with <xsl:process-children/>
Date Thu, 26 Oct 2000 11:44:41 GMT
This works fine with your XML:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >

<xsl:output method="html"/>

<xsl:template match="root | collapsed_node">
 <div id="{normalize-space(text())}">
  <xsl:apply-templates select="leaf | collapsed_node"/>
 </div>
</xsl:template>

<xsl:template match="leaf">
 <xsl:value-of select="."/><br/>
</xsl:template>

</xsl:stylesheet>


----- Original Message -----
From: "Khomik Rostislav" <khomik@hotmail.com>
To: <cocoon-users@xml.apache.org>
Sent: 26 октября 2000 г., четверг 15:15
Subject: Re: problem with <xsl:process-children/>


> As I said before you can use this:
>
> <xsl:template match="root">
>     <DIV id="{text()}">
>     <xsl:apply-templates />
>    </DIV>
> </xsl:template>

In this case it works - I become:
<DIV id="root">
     Leaf1<BR>
     Leaf2<BR>
...

</DIV>

> <xsl:template match="collapsed_node>
>     <DIV id="{text()}">
>     <xsl:apply:templates />
>    </DIV>
> </xsl:template>

But here I become:

<DIV id="Node 1">Node1</DIV>

It seems like <xsl:apply:templates /> works onfy by the first occurence in
the stylesheet.
In <collapsed_node> I must to nest many <leaf/> and It could be nested more
<collapsed_node>.


>
> And so on.
>
> Regards,
>   Kot.
>
> P.S. I did not test it, but it must be like this.
>
> ----- Original Message -----
> From: "Khomik Rostislav" <khomik@hotmail.com>
> To: <cocoon-users@xml.apache.org>
> Sent: 25 октября 2000 г., среда 19:45
> Subject: Re: problem with <xsl:process-children/>
>
>
> > It does not work. Here is a situation:
> >
> > Consider In XML I have a structure
> > <root>Root
> >   <leaf>Leaf 1</leaf>
> >   <leaf>Leaf 2</leaf>
> >   <collapsed_node>Node 1
> >           <leaf>Leaf 3</leaf>
> >           <leaf>Leaf 4</leaf>
> >    </collapsed_node>
> > </root>
> >
> > to make it as showing/hidding text in Explorer I must convert it by XSL
in
> > the following HTML:
> >
> > <DIV id="Root">
> >     Leaf1<BR>
> >     Leaf2<BR>
> >     <DIV id="Node 1">
> >         Leaf3
> >         Leaf4
> >     </DIV>
> > </DIV>
> >
> > Question is: If I describe an XSL template for <root>, which
construction
> > will process
> > all nested in <root> tags? If someone will help me, I'll be very glad,
> > because I'm newbie with
> > Cocoon and XML.
> >
> > ----- Original Message -----
> > From: "Robin Green" <greenrd@hotmail.com>
> > To: <cocoon-users@xml.apache.org>
> > Sent: Wednesday, October 25, 2000 4:47 PM
> > Subject: Re: problem with <xsl:process-children/>
> >
> >
> > > "Khomik Rostislav" <khomik@hotmail.com> wrote:
> > > >org.apache.xalan.xslt.XSLProcessorException: Unknown XSL element:
> > > >process-children
> > > >
> > > >What should I do?!
> > >
> > > xsl:process-children does not exist in XSLT 1.0. Just use
> > >
> > > <xsl:apply-templates select="node()"/>
> > >
> > > instead.
> > >
> > >
> > >
> > >

---------------------------------------------------------------------
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