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

Re: changing value of xi:include's href variable durin

Subject: Re: changing value of xi:include's href variable during compilationg with XSLTPROC
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 6 Nov 2007 16:28:08 +0000
Re:  changing value of xi:include's href variable durin
On 06/11/2007, Nancy Brandt <nancy_brndt@xxxxxxxxx> wrote:
> Hi, Michael. In general, you are right. But at this
> specific moment, I am very nervous because of this
> issue as my documentation does not compile well. I
> tried this, according to what I understood from your
> description:
>
> xsl:template match="xi:include">
>   <xi:include>
>     <xsl:copy-of select="@*"/>
>     <xsl:attribute name="href">
>       <xsl:if test="contains('#')">
>       <xsl:copy-of select="@*"/>
>       <xsl:value-of select="substring-before('#')"/>
>       <xsl:value-of select="substring-after('#')"/>
>       <xsl:value-of select="concat(@*, '.online',
> '#')"/>
>       </xsl:if>
>      <xsl:value-of select="concat(@*, '.online')"/>
>     </xsl:attribute>
>   </xi:include>
> </xsl:template>
>
> The compiler saXPath error : Invalid number of
> arguments
> xmlXPathCompiledEval: 1 objects left on the stack.
> ys:

The contains() and substring-before() functions take two arguments...

contains(., '#')

...will check the string value of the current node, or

contains('abcd', 'a')

...will check if the string 'abcd' contains an 'a'

The same applies to the substring functions you are using, eg

substring-before(., '#')

will return the string value of the current up to the first occurrance of #


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.