You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by lech <le...@hotmail.com> on 2004/03/27 11:11:31 UTC

Transformer lost the structure of input stream???

I tried to aggregate several xml streams and transform the aggregated stream by a xsl transformer. all goes well except that the markup, for example 
I want the output to be 
<FirstStream><name>     TheFirstName    </name>    <data>  TheFirstData   </data> /FirstStream>....

But the output I got is:    <FirstStream>    TheFirstName    TheFirstData  </FirstStream>....

the" <name>" and "<data>"is lost,  does anybody have some idea why?
here is my input streams, pipeline and transformer, thanks for your time and help ve~~~~~~~~ry much indeed

//lechael


<xsl:template match="overall">
<FirstStream><xsl:apply-templates select="stream1"/>
</FirstStream>
<SecondStream>
    <xsl:apply-templates select="stream2|stream3"/>
 <SecondStream></xsl:template>
 
Stream1.xml:
<stream1>
    <name>
        TheFirstName
    </name> 
      
    <data>
          TheFirstData
    </data>
</stream1>

Stream2.xml:
<stream2>
    <despt>
        here is the descript
    </despt> 
    <remark>
        Here is the remark
    </remark>
</stream2>
 
and here is my pipeline:
     <map:match pattern="aggregated">
 <map:aggregate element="overall">
  <map:part src="stream1.xml"/>
  <map:part src="stream2.xml"/>
<map:part src="stream3.xml"/>
</map:aggregate>
<map:transform src="stylesheet.xsl">
<map:serialize type="html" />
</map:match>

Re: Transformer lost the structure of input stream???

Posted by Lionel Crine <cr...@4dconcept.fr>.
This is an xslt question.

You should send a message to : xsl-list@lists.mulberrytech.com


But here is an hint.
The xslt transformer is not implicated in that case.

Your match overall is incomplete if you want to copy all the nodes.

try that :

<xsl:template match="overall">
<FirstStream>
<xsl:copy>
         <xsl:apply-templates select="stream1"/>
</xsl:copy>
</FirstStream>
<SecondStream>
<xsl:copy>
         <xsl:apply-templates select="stream2|stream3"/>
</xsl:copy>
</SecondStream>



Lionel


At 02:11 27/03/2004 -0800, you wrote:
>I tried to aggregate several xml streams and transform the aggregated 
>stream by a xsl transformer. all goes well except that the markup, for example
>I want the output to be
><FirstStream><name>     TheFirstName    </name>    <data>  TheFirstData 
></data> /FirstStream>....
>
>But the output I got 
>is:    <FirstStream>    TheFirstName    TheFirstData  </FirstStream>....
>
>the" <name>" and "<data>"is lost,  does anybody have some idea why?
>here is my input streams, pipeline and transformer, thanks for your time 
>and help ve~~~~~~~~ry much indeed
>
>//lechael
>
>
><xsl:template match="overall">
><FirstStream><xsl:apply-templates select="stream1"/>
></FirstStream>
><SecondStream>
>     <xsl:apply-templates select="stream2|stream3"/>
>  <SecondStream></xsl:template>
>
>Stream1.xml:
><stream1>
>     <name>
>         TheFirstName
>     </name>
>
>     <data>
>           TheFirstData
>     </data>
></stream1>
>
>Stream2.xml:
><stream2>
>     <despt>
>         here is the descript
>     </despt>
>     <remark>
>         Here is the remark
>     </remark>
></stream2>
>
>and here is my pipeline:
>      <map:match pattern="aggregated">
>  <map:aggregate element="overall">
>   <map:part src="stream1.xml"/>
>   <map:part src="stream2.xml"/>
><map:part src="stream3.xml"/>
></map:aggregate>
><map:transform src="stylesheet.xsl">
><map:serialize type="html" />
></map:match>

Lionel CRINE
Ingénieur Systèmes documentaires
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : 01.34.58.70.70 Fax : 01.39.58.70.70


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org