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]
Other format: [Raw text]

Re: namespace issue


Hi Dave,

DPawson@rnib.org.uk wrote:

> output is a file using a nil prefix ns.
> top level element specifies the default ns
> 
> <template match= x>
>   <el xmlns="myns">
> 
> 
> for all the children of this element (in the output),
> if I specify no ns, Saxon (correctly I guess), adds
>    <el xmlns="">
> i.e. reverts to the 'null' ns (or whatever its called).
> 
> Having specified the ns in the top level element,
> must I really add the xmlns attribute to all children?


yes, to all [no namespace] children (any [myns] children get 
prefix-free), but only because you've specified "myns" as the *default* 
namespace at the higher level. If instead you have <x:el xmlns:x="myns"> 
then you can still use [no prefix] to refer to [no namespace].


> 
> <q> if a prefix foo is used in a tag, but the element does not have an
> xmlns:foo attribute, then the value of the parent element's xmlns:foo
> attribute will be used; if the parent does not have an xmlns:foo attribute,
> then the value of the grandparent element's xmlns:foo attribute will be
> used, and so on. </q> src = http://jclark.com/xml/xmlns.htm
> 
> I guess this still applies to the 'empty' ns? or is that special?
> 

Exactly - still applies, not special.


> Confused (again) by ns's.
> 

Don't see why - you've explained it entirely correctly! Maybe you just 
find it too ugly to be credible?


regards -


Francis.


 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]