Subject: RE: using my/url.xml?parameter=myparameter with XSL From: Jukka.T.Lehtinen@xxxxxxxxx Date: Fri, 7 Jul 2000 15:46:19 +0300 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: whitespaces inside empty tags, SoftLiban MANOUK Ser | Thread | Removing duplicates not preceding v, Ronald |
Re: whitespaces inside empty tags, SoftLiban MANOUK Ser | Date | Removing duplicates not preceding v, Ronald |
Month |