This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: using my/url.xml?parameter=myparameter with XSL
- To: xsl-list at mulberrytech dot com
- Subject: RE: using my/url.xml?parameter=myparameter with XSL
- From: Jukka dot T dot Lehtinen at nokia dot com
- Date: Fri, 7 Jul 2000 15:46:19 +0300
- Reply-To: xsl-list at mulberrytech dot com
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@interpasnet.com]
> Sent: 06. July 2000 2:50
> To: xsl-list@mulberrytech.com
> 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@interpasnet.com |
> +------------------------------------------------+
> | 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