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

RE: can a value of a parameter depends on a other valu

Subject: RE: can a value of a parameter depends on a other value
From: Roelof Wobben <rwobben@xxxxxxxxxxx>
Date: Wed, 30 Nov 2011 11:41:46 +0000
RE:  can a value of a parameter depends on a other valu
Oke,



But im rewriting this piece so I will use it.



What im trying is to declare a variable/parameter which value depends on the
month and page parameter.



Is there then a better way to to this.



Roelof



----------------------------------------
> Date: Wed, 30 Nov 2011 12:08:39 +0100
> From: wolfgang.laun@xxxxxxxxx
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  can a value of a parameter depends on a other value
>
> A parameter is only applicable to a named template, and
> <xsl:with-param> is used with the call, not the definition. You aren't
> using the "parameter" anyway, so omit it.
> -W
>
> On 30 November 2011 12:02, Roelof Wobben <rwobben@xxxxxxxxxxx> wrote:
> >
> >
> > Oke,
> >
> >
> >
> >
> >
> > The whole xslt looks like this :
> >
> >
> >
> >
> >
> > <?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:variable name="mycount" select="count(/data/artikel-details/entry)"
/>
> >
> >
> >
> > <xsl:template match="/">
> > <xsl:with-param name="articlesperpage">
> > <xsl:choose>
> > <xsl:when test=" $value = 2005-02 and $page = 1">2</xsl:when>
> > </xsl:choose>
> > </xsl:with-param>
> > <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>
> >
> >
> >
> > I only get now this message :
> >
> >
> >
> > XSLTProcessor::importStylesheet(): element with-param is not allowed
within that context
> >
> > XSLTProcessor::transformToXml(): No stylesheet associated to this object
> >
> >
> >
> >
> > I hope I now give enought clues to solve this.
> >
> >
> >
> > Roelof
> >
> >
> >
> >
> >
> >
> >
> > </xsl:stylesheet>----------------------------------------
> > > Date: Wed, 30 Nov 2011 10:47:01 +0000
> > > From: davidc@xxxxxxxxx
> > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > > Subject: Re:  can a value of a parameter depends on a other value
> > >
> > > On 30/11/2011 10:22, Roelof Wobben wrote:
> > > >
> > > >
> > > >
> > > > Hello,
> > > >
> > > >
> > > >
> > > > This script does not work
> > >
> > > you are posting a lot of questions but not really giving anyone any
> > > clues that could enable us to help.
> > > >
> > > >
> > > >
> > > > <xsl:with-param name="articlesperpage">
> > > > <xsl:choose>
> > > > <xsl:when test=" $value = 2005-02 and $page = 1">2</xsl:when>
> > > > </xsl:choose>
> > > > </xsl:with-param>
> > > >
> > > >
> > > > I see now these error messages :
> > > >
> > >
> > > The error message clearly states that you have used xsl:with-param at a
> > > place where it is not allowed, and lists the places where it is
allowed.
> > > presumably you have used it in some other place but as you only posted
> > > the with-param and not show where it was, we can't help.
> > >
> > > Incidentally
> > >
> > > $value = 2005-02
> > >
> > > is legal but tests if $value has the value 2003. If you meant to test
> > > for the string 2005-02 then you need quotes
> > > $value = '2005-02'
> > > >
> > > >
> > > > XSLTProcessor::importStylesheet(): element with-param is not allowed
within that context
> > > >
> > > > XSLTProcessor::importStylesheet(): element choose only allowed within
a template, variable or param
> > > >
> > > > XSLTProcessor::importStylesheet(): xsltParseStylesheetTop: unknown
with-param element
> > > >
> > > > XSLTProcessor::transformToXml(): No stylesheet associated to this
object
> > > >
> > > >
> > > David
> > >
> > >
> > >
________________________________________________________________________
> > > 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

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.