[xsl] Regarding Default Namespaces

Subject: [xsl] Regarding Default Namespaces
From: "Avani Goel" <avani_goel@xxxxxxxxxxxxxxxx>
Date: Tue, 9 Oct 2001 18:40:04 +0530
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


Current Thread