Subject: Re: [xsl] Regarding Default Namespaces From: "Thomas B. Passin" <tpassin@xxxxxxxxxxxx> Date: Tue, 9 Oct 2001 10:43:16 -0400 |
[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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Regarding Default Namespa, Michael Kay | Thread | [xsl] Environment variable, Julio Kriger |
RE: [xsl] Environment variable, Michael Kay | Date | Re: [xsl] Create CDATA Section in X, David Carlisle |
Month |