No subject


Fri Aug 6 17:04:17 PDT 2004


child
element is in the same namespace as the parent element unless otherwise 
specified.
Thus, you can do something like:
<xhtml:html xmlns:html="...">
	<head><title>my title</title></head>
</xhtml:html>

and do not have to do:
<xhtml:html xmlns:html="...">
	<xhtml:head><xhtml:title>my title</xhtml:title></xhtml:head>
</xhtml:html>


This can also be seen in W3C's examples and W3SCHOOLS tutorials.

Malachi

On Fri, 21 Mar 2003 03:31:38 -0500, Elliotte Rusty Harold 
<elharo at metalab.unc.edu> wrote:

> At 11:19 PM -0800 3/14/03, Malachi de AElfweald wrote:
>
>> ANOTHERWORDS, there is no concept of which namespace it is in until it 
>> is added to
>> the parent, which is perfectly valid for XML since child nodes are in 
>> the same namespace
>> as the parent (by default, inheriting). Looking at the XML output 
>> (textual) , the only way this can be done is by
>> not using any namespaces at all -- thus no validation.
>
>
> No, again you believe things about namespaces that aren't true. Child 
> elements are not in the same namespace as their parent element by 
> default. They are in whichever namespace is in scope for their prefix (or 
> lack thereof) irregardless of the namespace of the parent element. Often, 
> they are in the same namespace as the parent element, but this is only 
> because their prefix is mapped to the same URI as the parent element's 
> prefix.



-- 
 



More information about the jdom-interest mailing list