You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mygrp <md...@gmail.com> on 2005/01/08 07:59:06 UTC

xml and xsl

I have four xml files with the same format. They contain different
data but same tags.

I want to write an XSL that will read the data from the XML files and
produce an XHTML page.

Can a single XSL file be used to read from the different XML files
which have the same tags?  In this case how should the pipeline be ?

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


RE: xml and xsl

Posted by Mark Lundquist <ml...@wrinkledog.com>.
> From: alex.zirl@web.de [mailto:alex.zirl@web.de]
Subject: AW: xml and xsl
>
>
> If I understand you correctly >> No, there's no reasonable way of
> restricting the application of an xsl file. Why would you do that
> anyways? I
> mean, if you want to restrict it to a certain part, you need to know which
> parts, right? Knowing this, just choose a different xsl file before the
> transformation.

It sounds like what the OP really wants is, instead of aggregating the
sources themselves, to aggregate the output of several pipelines, each of
which applies the appropriate transformation to the appropriate source.

cheers,
-ml-


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


AW: xml and xsl

Posted by Alexander Zirl <al...@web.de>.
If I understand you correctly >> No, there's no reasonable way of
restricting the application of an xsl file. Why would you do that anyways? I
mean, if you want to restrict it to a certain part, you need to know which
parts, right? Knowing this, just choose a different xsl file before the
transformation.

To make things simple, you could have one master xsl file, and a set of
other xsl files taking the master file as an input and transforming it to
its special needs. In this way, you just need to keep track of the master
xsl file, once the other xsl files have been set up. This avoids having to
care about many xsl files that are similar.

Hope this was a bit of help. Best,
Alex 

-----Ursprüngliche Nachricht-----
Von: users-return-76020-alex.zirl=web.de@cocoon.apache.org
[mailto:users-return-76020-alex.zirl=web.de@cocoon.apache.org] Im Auftrag
von Mygrp
Gesendet: Monday, January 10, 2005 8:46 AM
An: users@cocoon.apache.org
Betreff: Re: xml and xsl

I used the aggregator to fetch the different xml and parse them using
single.xsl.

I have a problem though. For every xml , the entire xsl is being
applied. But i want only a part of the xsl to be applied for every
xml.

Can this be done?

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



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


Re: xml and xsl

Posted by go...@osmosis.gr.
i dont understand exaclty what you meen but you can 
to transform each xml separately and then aggregate the 
results

<map:match pattern="a.xml">
<map:generate src="a.xml"/>
<map:transform src="single.xml"/>
<map:serialize type="xml"/>

similar match pattern for b.xml, c.xml

then

<map:match patters="result">
<map:aggregate>
  <map:part src="cocoon:/a.xml"/>
  <map:part src="cocoon:/b.xml"/>
  <map:part src="cocoon:/c.xml"/>
</map:aggregate>

<map:serialize type="xhtml"/>

</map:match>


--stavros 

On Mon, 10 Jan 2005, Mygrp wrote:

> I used the aggregator to fetch the different xml and parse them using
> single.xsl.
> 
> I have a problem though. For every xml , the entire xsl is being
> applied. But i want only a part of the xsl to be applied for every
> xml.
> 
> Can this be done?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


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


Re: xml and xsl

Posted by Mygrp <md...@gmail.com>.
I used the aggregator to fetch the different xml and parse them using
single.xsl.

I have a problem though. For every xml , the entire xsl is being
applied. But i want only a part of the xsl to be applied for every
xml.

Can this be done?

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


AW: xml and xsl

Posted by Alexander Zirl <al...@web.de>.
Yes, everything has already been said. One more point:

It's important to understand the principle of how the pipelining and the
XSL/XML relations work. In a 'normal' environment, i.e. when not using
cocoon, the XML files include references to the XSL stylesheets they are
using. The files are physically not bound. Thus, it works similar in the
pipelining of cocoon (at least conceptually). First, you choose your source
XML document, then you apply your XSL stylesheet. 

You could end up with a lot more complex pipeline than that, including more
branches using <map:when test="...."> in order to avoid writing lots of
pipelines for similar jobs.

Hope this was a bit of help to you.

Best,
Alexander

-----Ursprüngliche Nachricht-----
Betreff: Re: xml and xsl

gounis@osmosis.gr wrote:

>first-data.xml
>second-data.xml
>third-data.xml
>
>single.xsl
>
><map:match pattern="*-data.xml>
>  <map:generate src="{1}-data"/>
>  <map:transform src="single.xsl"/>
>  <map:serialize type="html"/>
></map:match>
>  
>
or:

<map:match pattern="*-data.xml>
  <map:aggregate element="root">
    <map:part src=first-data.xml"/>
    <map:part src=second-data.xml"/>
    <map:part src=third-data.xml"/>
  </map:aggregate>
  <map:transform src="single.xsl"/>
  <map:serialize type="html"/>
</map:match>


Upayavira

>
>--stavros
>
>
>On Sat, 8 Jan 2005, Mygrp wrote:
>
>  
>
>>I have four xml files with the same format. They contain different
>>data but same tags.
>>
>>I want to write an XSL that will read the data from the XML files and
>>produce an XHTML page.
>>
>>Can a single XSL file be used to read from the different XML files
>>which have the same tags?  In this case how should the pipeline be ?
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>


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



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


Re: xml and xsl

Posted by Upayavira <uv...@upaya.co.uk>.
gounis@osmosis.gr wrote:

>first-data.xml
>second-data.xml
>third-data.xml
>
>single.xsl
>
><map:match pattern="*-data.xml>
>  <map:generate src="{1}-data"/>
>  <map:transform src="single.xsl"/>
>  <map:serialize type="html"/>
></map:match>
>  
>
or:

<map:match pattern="*-data.xml>
  <map:aggregate element="root">
    <map:part src=first-data.xml"/>
    <map:part src=second-data.xml"/>
    <map:part src=third-data.xml"/>
  </map:aggregate>
  <map:transform src="single.xsl"/>
  <map:serialize type="html"/>
</map:match>


Upayavira

>
>--stavros
>
>
>On Sat, 8 Jan 2005, Mygrp wrote:
>
>  
>
>>I have four xml files with the same format. They contain different
>>data but same tags.
>>
>>I want to write an XSL that will read the data from the XML files and
>>produce an XHTML page.
>>
>>Can a single XSL file be used to read from the different XML files
>>which have the same tags?  In this case how should the pipeline be ?
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>


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


Re: xml and xsl

Posted by go...@osmosis.gr.
first-data.xml
second-data.xml
third-data.xml

single.xsl

<map:match pattern="*-data.xml>
  <map:generate src="{1}-data"/>
  <map:transform src="single.xsl"/>
  <map:serialize type="html"/>
</map:match>


--stavros


On Sat, 8 Jan 2005, Mygrp wrote:

> I have four xml files with the same format. They contain different
> data but same tags.
> 
> I want to write an XSL that will read the data from the XML files and
> produce an XHTML page.
> 
> Can a single XSL file be used to read from the different XML files
> which have the same tags?  In this case how should the pipeline be ?
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


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