[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Regarding Default Namespaces


Subject: Re: [xsl] Regarding Default Namespaces
From: Manu KY <manu_kry@xxxxxxxxx>
Date: Tue, 09 Oct 2001 19:45:35 +0530

Hi,
in that case you can do like this:
<xsl:value-of xmlns:default = "www.apple.com" select="default:apple">

the node apple is represented in the XSLT tree by the name-- www.apple.com:apple. which is the expanded name.
what we use in XPath expression is called the Qualified Name.


Manu
Conside this XMl:

<?xml version='1.0'?>
<?sheet type="text/xml" href="14-2.xsl"?>
<apples xmlns="www.apple.com">

<apple> no prefix</apple>

  <fruits:apple  xmlns:fruits='http://www.fruits.com'>
      A FRUIT
  <fruits:fig fruits:id="1">
      A FIG
   </fruits:fig>
   <bbb>bbb</bbb>
   </fruits:apple>

</apples>

Here, the Default Namespace applies to the first   apple  element which does
not have a prefix i.e.
 the URI of the element apple is " www.apple.com ",
the prefix is NULL ,
and the local name is "apple".

now  as a result of the  XSL construct like <xsl:value-of
select="..........."/>
I want that the element node <apple> should be selected and  " no prefix "
will be the value of this selected node.

Howevere, I am not able to  access the element  <apple> no prefix </apple>
by just givng the Xpath  " //apple  "  since here(in the XPATH) the URI of
the apple is NULL and therefore, does not match the URI of the apple element
in the XML.

Please tell me how to access an elment whose URI is a default namespace.


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


_________________________________________________________
Do You Yahoo!?
Get your free @... address at http://mail.yahoo.com


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




Current Thread
Keywords