|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








