Re: [xsl] Namespace problem

Subject: Re: [xsl] Namespace problem
From: Mike Brown <mike@xxxxxxxx>
Date: Wed, 24 Oct 2001 17:54:06 -0600 (MDT)
Uslu, Cihan Y (MED) wrote:
> What is wrong with this Stylesheet? 
> The problem is this: When I apply the stylesheet, I get no results
> unless I remove the namespace from the XML document.

In your stylesheet, all your references to element names in the
source document are using no namespace.

For example,

<xsl:value-of select="/VisioDocument/Pages/Page/Shapes"/>
(actual path shortened for brevity)

means 

"create a text node using the string-value of the first node
in the node-set consisting of:
  elements named 'Shapes' (in no namespace)
  that are children of elements named 'Page' (in no namespace)
    that are children of elements named 'Pages' (in no namespace)
      that are children of elements named 'VisioDocument' (same)
        that are children of the root node"

In your stylesheet you have already bound the prefix 'user' to the
URI you need, so all you need to do is use it:

<xsl:value-of select="/user:VisioDocument/user:Pages/user:Page/user:Shapes"/>

   - Mike
____________________________________________________________________________
  mike j. brown, fourthought.com  |  xml/xslt: http://skew.org/xml/
  denver/boulder, colorado, usa   |  personal: http://hyperreal.org/~mike/

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


Current Thread