[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Regarding Default Namespaces

Subject: Re: Regarding Default Namespaces
From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx>
Date: Tue, 9 Oct 2001 10:43:16 -0400
Re:  Regarding Default Namespaces
[Avani Goel]
> 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>
>
[...]
>
> Please tell me how to access an elment whose URI is a default namespace.
>

You cannot access it directly.  What you have to do is to declare that
namespace in the stylesheet but give it a prefix, like "ap".  In your
templates, when you want the "unprefixed" apple element, you call it
"ap:apple".  In other words, the unprefixed elements in the xml file are in
fact in a namespace.  You just have to make that namespace explicit in the
stylesheet.

Cheers,

Tom P


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.