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

RE: referring to variables using variables?

Subject: RE: referring to variables using variables?
From: "james walker" <jameswalkerandy@xxxxxxxxxxx>
Date: Tue, 13 Jan 2004 13:59:26 +0000
does not contain any functions
Hello again,
I bound a namespace prefix xmlns and it doesnt complain when i translate it but the output does not show content from any of the imported documents. Also in the ouput, the statement xmlns:xx="urn:schemas-microsoft-com:xslt" is included in each <h1> tag as a paramter??


<xsl:stylesheet version="1.0" xmlns:xx="urn:schemas-microsoft-com:xslt" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" />
<!--Load people in xml files-->
<xsl:variable name="index">
<HR>http...</HR>
<Recruitment_and_Hiring>http...</Recruitment_and_Hiring>
<New_Managers>http...</New_Managers>
<New_Starters>http...</New_Starters>
</xsl:variable>
<xsl:variable name="nsindex" select="xx:node-set($index)/*"/>


<xsl:template match="root">
<h1 class="page-title"><xsl:value-of select="./category/name" /></h1>
<p><xsl:value-of select="./category/description" /></p>
<xsl:apply-templates select="category/category/category[name='People In']" />
</xsl:template>


<xsl:template match="category">

<xsl:if test="count(ancestor::*)=3">
<xsl:variable name="colour" select="../@colour" />
<h2 class="head-hurs-{$colour}" style="margin-top:20px;"><xsl:value-of select="name" /></h2>
<p><xsl:value-of select="description" /></p>
<xsl:apply-templates select="./category" />
</xsl:if>


<xsl:if test="count(ancestor::*)=4">
<div style="float:left;" class="general-portlet">
<xsl:variable name="subcatcolor" select="../../@colour" />
<xsl:variable name="catname" select="name" />
<h2 class="head-hurs-{$subcatcolor}"><xsl:value-of select="name" /></h2>
<p><xsl:value-of select="description" /></p>
<ul class="in-portlet">
<xsl:for-each select="document($nsindex/*[name()=$catname])/root/child::*">
CONTENT
</xsl:for-each>
</ul>
</div>
<xsl:apply-templates select="./category" />
</xsl:if>


</xsl:template>

</xsl:stylesheet>

I changed xmlns to another name but that didnt work and also tried david carlisle's suggestion for xalan but it said that namespace "http://exslt.org/common" does not contain any functions......


From: "Michael Kay" <mhk@xxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE:  referring to variables using variables?
Date: Tue, 13 Jan 2004 13:37:22 -0000

> i changed xx in select="xx:node-set($index)/*" to xmlns and
> changed the
> select function slightly to match the brackets  <xsl:for-each
> select="document($nsindex/*[name()=$catname])/root/child::*">
> . It says
> 'Namspace " does not contain any functions ', does anyone
> know what this
> means?

You need to bind the namespace prefix xx to a namespace that contains
the function with local-name "node-set". This depends on the XSLT
processor you are using. It looks as if you bound it to the null
namespace, and the null namespace does not contain any functions.

Michael Kay


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list

_________________________________________________________________
It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger



XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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.