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]

Re: Regarding Default Namespaces


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 @yahoo.com address at http://mail.yahoo.com


 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]