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

Re: xml document as parameter and attribute expression

Subject: Re: xml document as parameter and attribute expression
From: James Fuller <jim.fuller@xxxxxxxxxxxxxx>
Date: Sun, 24 Apr 2005 20:34:40 +0200
xml document as parameter
Sebastien Arbogast wrote:

>Hi,
>
>In my XSLT stylesheet, I have a global parameter containing some XML
>content like this :
>
><div id="center" title="myTitle">
>...
></div>
>
>This parameter is called 'center' and I would like to retrieve the
>value of title with some XPath expression. I tried the following :
>
><xsl:value-of select="$center/div[@id='center']/@title"/>
>
>But my libxslt/php5 XSLT processor gives me an XPath internal error
>(document without root) and I don't understand what's the problem
>  
>

it sounds like your $center param is empty....have u done a simple test

<xsl:copy-of select="$center"/> to ensure that the param is being passed in?

once you know its being passed in...then your xpath should work

u should also be initialising this param as a top level element
<xsl:param name="center" />

gl, Jim Fuller

>BTW I have another stylesheet that does nearly the same  except it
>receives the uri of a document as a parameter and uses
>document($center) instead of center.
>
>I guess it's a problem of tree parsing but how can I solve that,
>knowing that I can't change the fact that I receive XML string
>directly as a parameter (XSLT transform streaming) ?
>
>Thx in advance.

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.