[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: using my/url.xml?parameter=myparameter with XSL

Subject: RE: using my/url.xml?parameter=myparameter with XSL
From: Jukka.T.Lehtinen@xxxxxxxxx
Date: Fri, 7 Jul 2000 15:46:19 +0300
url.xml
Hi ! I´m beginner of xslt but I had some time, and I think I perhaps solved
your prob. 

Jukka.

I used xml file like this: 

-------------------------------cut
<?xml version='1.0'?>

<test>
	<section id="1">
	[....]
	</section>

	<section id="2">
	[....]
	</section>

	<section id="3">
	[....]
	</section>
</test>
-------------------------------cut

and xslt file like this:

-------------------------------cut
<?xml version='1.0'?>

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
       

<xsl:template match="test">
	<html><body>
		<xsl:apply-templates select="section" />
	</body></html>
</xsl:template>


<xsl:template match="section">
	<a>
	<xsl:attribute
name="href">http://my-domain.com/file.xml?id=<xsl:apply-templates
select="@id" /></xsl:attribute>
		section <xsl:apply-templates select="@id" />
	</a><br/>
</xsl:template>

</xsl:stylesheet>
--------------------------------cut

and result is (using Saxon):

--------------------------------cut
<html>
   <body><a href="http://my-domain.com/file.xml?id=1">
         		section 1
      </a><br><a href="http://my-domain.com/file.xml?id=2">
         		section 2
      </a><br><a href="http://my-domain.com/file.xml?id=3">
         		section 3
      </a><br></body>
</html>
--------------------------------cut

And correct where I went wrong.



 

> -----Original Message-----
> From: EXT Luc Saint-Elie [mailto:luc@xxxxxxxxxxxxxxx]
> Sent: 06. July 2000 2:50
> To: xsl-list@xxxxxxxxxxxxxxxx
> Subject: using my/url.xml?parameter=myparameter with XSL
> 
> 
> Hello,
> 
> I'd like to know how to do the following
> 
> I have a xml file "file.xml" and a xsl file
> file.xml file contains stuff like :
> 
> <section id="1">
> [....]
> </section>
> 
> <section id="2">
> [....]
> </section>
> 
> <section id="3">
> [....]
> </section>
> 
> I'd like to write a xsl script that allow to display a 
> section (and only
> this one) using
> 
> http://my-domain.com/file.xml?id=1 -> display section 1
> 
> http://my-domain.com/file.xml?id=2 -> display section 2
> 
> http://my-domain.com/file.xml?id=3 -> display section 3
> 
> 
> 
> Thanks in advance
> 
> Luc
> +------------------------------------------------+
> | Luc Saint-Elie                                 |
> | email : luc@xxxxxxxxxxxxxxx                    |
> +------------------------------------------------+
> |  Java Server Side  Open Source technologies    |
> |       http://www.interpasnet.com/JSS           |
> +------------------------------------------------+
> 
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.