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

RE: substring-after Not Working in apply-templates

Subject: RE: substring-after Not Working in apply-templates
From: "Passin, Tom" <tpassin@xxxxxxxxxxxx>
Date: Wed, 6 Oct 2004 11:10:28 -0400
substring after
> From: Ahsan Abbas ASGHAR [mailto:S3047382@xxxxxxxxxxxxxxxxxxx]
> I am trying this statement:
>
> <xsl:apply-templates select="substring-after(@rdf:about,'#')">
> </xsl:apply-templates>
>
> But this gives an error saying:
> MyXSLFile.xsl:39: value of expression cannot be converted to a
node-set

The error message is correct and clear.  Apply-templates works on a
node-set, but your expression returns a string (what else would you
expect "substring-after" to return?).

> Can anyone guide me how can I write the result of this substring-after
> thing into an XML file. Do I have to use any other tag rather than
> xsl:apply-templates or what?

Without knowing any more details of what you are starting with and what
you want to achieve, we can only offer some generic advice.  In this
case, you need to qualify or filter the nodes you select.  You could do
this somewhat as follows -

  select ="*[substring-after(@rdf:about,'#')]"

This would select all nodes, whatever their names, that contain an
rdf:about attribute that has some text after the "#" character.

Cheers,

Tom P

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.