[Home] [By Thread] [By Date] [Recent Entries]

Subject: Re: questions regd namespaces
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 9 Jul 2002 14:26:04 +0100
<center>
<all-centers xmlns = "http://www.nda-centres.com/namespaces">

That is a center element in no namespace with child a all-centers
element in the namespace http://www.nda-centres.com/namespaces
(Do you really want to change namespaces at that point?)

An Xpath that selects that would be

/center/x:all-centers

where x: has been bound to the http://www.nda-centres.com/namespaces
namespace

so you want

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:x="http://www.nda-centres.com/namespaces">


<xsl:template match="/">
<xsl:value-of select="/center/x:all-centers"/>

Xpaths like attribute names do not use the default namespace binding:
unprefixed QNames in XPath always refer to elements or attributes in no
namespace. 

David
(This is a FAQ)

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

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


Current Thread
  • questions regd namespaces, (continued)
        • subbu - Mon, 8 Jul 2002 17:29:09 -0400 (EDT)
        • Jeni Tennison - Mon, 8 Jul 2002 18:33:38 -0400 (EDT)
        • subbu - Tue, 9 Jul 2002 04:59:40 -0400 (EDT)
        • subbu - Tue, 9 Jul 2002 08:40:53 -0400 (EDT)
        • David Carlisle - Tue, 9 Jul 2002 09:26:14 -0400 (EDT) <=
        • Michael Kay - Tue, 9 Jul 2002 04:44:09 -0400 (EDT)
        • subbu - Tue, 9 Jul 2002 05:03:24 -0400 (EDT)
    • ashu t - Tue, 9 Jul 2002 02:58:16 -0400 (EDT)
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member