[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] can a value of a parameter depends on a other value


Subject: RE: [xsl] can a value of a parameter depends on a other value
From: Roelof Wobben <rwobben@xxxxxxxxxxx>
Date: Thu, 1 Dec 2011 11:43:57 +0000

No problem.



This part I wrote myself so that part i understand.





<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml"
 doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
 doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
 omit-xml-declaration="yes"
 encoding="UTF-8"
 indent="yes" />



<xsl:template match="/">
 <xsl:apply-templates select="/data/artikel-details/entry"/>
</xsl:template>



<xsl:template match="artikel-details/entry">
 <h1><xsl:value-of select="titel"/></h1><br />
 <xsl:value-of select="datum" /><br />
 <xsl:value-of select="tekst" /> <br />
</xsl:template>





Are there any practices on internet so I can practice with conditional test ?



Roelof




----------------------------------------
> Date: Thu, 1 Dec 2011 11:39:08 +0000
> From: davidc@xxxxxxxxx
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> CC: rwobben@xxxxxxxxxxx
> Subject: Re: [xsl] can a value of a parameter depends on a other value
>
> On 01/12/2011 11:23, Roelof Wobben wrote:
> > The are declared by Symphomny CMS which I use to make this website.
>
> They may be declared in some API for some programming language, but
> unless you declare parameters or variables of that name in your xsl
> stylesheet use of $page in xpath will be a syntax error referencing an
> undefined variable.
>
> Could I suggest that you are approaching this the wrong way, posting so
> much code that has so many syntax errors it is impossible for us to
> guess what the intended use is and offer any help.
>
> When learning a new programming language it is best _not_ to start with
> the problem that you are actually trying to solve, but rather start with
> a "hello world" program.
>
> first make a stylesheet that just makes an html page that says hello
> world and check that you can get that to run and "hello world" to appear
> in a browser.
>
> then make a stylesheet that makes a page that says
> "the page is <xsl:value-of select="$page"/>
> this will check that you can get the values from your CMS passed in to
XSLT.
>
> _then_ you can start to think about to make conditional tests based on
> those values.
>
> David
>
>
>
>
> --
> google plus: https:/profiles.google.com/d.p.carlisle
>
> ________________________________________________________________________
> The Numerical Algorithms Group Ltd is a company registered in England
> and Wales with company number 1249803. The registered office is:
> Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
>
> This e-mail has been scanned for all viruses by Star. The service is
> powered by MessageLabs.
> ________________________________________________________________________


Current Thread
Keywords