Here is a sitemap for "catch-all" XML management.

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

The sitemap resolver receives the URL.
It parses sequentially the sitemap file,
reading only what is inside matching map:match.
The map:match above will be read for any URL that ends with the string
'.xml'.
The sitemap resolver read the <map:generate...>
It sees that it has to resolve the variable {1}
(which contains the string matched by the first wildcard of pattern="...")
It resolves it either to 'login1' or 'login2' and instanciates
the generator that will generate SAX events by reading the corresponding
file.

Idem for the <map:tranform...>.

Then the sitemap resolver reads a (HTML by default) serializer.
It instanciates the HTMLSerializer.

Then it stops reading the file (it ALAYS stops reading the file
as soon as it meets a map:serialize).

The pipeline is ready.

Another approach is this one:

<map:match pattern="login1.xml">
 <map:generate src="login1.xml"/>
 <map:transform src="login1.xsl"/>
 <map:serialize/>
</map:match>

<map:match pattern="login2.xml">
 <map:generate src="login2.xml"/>
 <map:transform src="login2.xsl"/>
 <map:serialize/>
</map:match>

How all that works is the same as above.





> -----Message d'origine-----
> De: kavitha ramesh [mailto:[EMAIL PROTECTED]]
> Date: jeudi 25 juillet 2002 15:02
> À: [EMAIL PROTECTED]
> Objet: using different stylesheets for different xml files
> 
> 
> Hi,
> 
> I have two xml files and I would like to use two
> different stylesheets for that.How do i do it?
> 
> For example I have two xml files inside the folder
> name "docs":
> 
> login1.xml
> login2.xml
> 
> and I have two stylesheets:
> 
> login1.xsl
> login2.xsl
> 
> and for login1.xml I would like to use the stylesheet
> login1.xsl and for login2.xml I would like to use
> login2.xsl.How do the sitemap.xmap file look like for
> the above?
> 
> Please help me,,,
> 
> Kavitha
> 
> ______________________________________________________________
> __________
> Want to sell your car? advertise on Yahoo Autos Classifieds. 
> It's Free!!
>        visit http://in.autos.yahoo.com
> 
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
> 
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
> 

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to