This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: questions regd namespaces


<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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]