namespace prefix for childelements in XML schema

tallicaguy

New Member
I'm currently learning XML and have arrived at the wonderfull world of XML Schema used with multiple namespaces.My question is when I should and do not have to declare a namespace prefix.Consider the following snippet of XML Schema:\[code\]<A:schema xmlns:A="http://www.w3.org/2001/XMLSchema" targetNamespace="B" xmlns:B="B" elementFormDefault="qualified"> <A:element name="foo"> <complexType> <!-- or A:complexType?--> <element name="bar" type="B:myType"/> <!-- or A:element?--> </complexType> </A:element> <B:complexType name="myType"> <choice> <!--or B:choice?--> <element name="baz" type="string"/> <!--or B:element?--> <element name="bas" type="string"/> <!--or B:element?--> </choice> </B:complexType></A:schema>\[/code\]Do I have to specify the namespace prefix on all the child nodes of a node with a namespace prefix, or is this inherited? Alternatively is \[code\]A:complexType\[/code\] different from \[code\]complexType\[/code\] when it's parent node had the A namespace prefix attached to it?
 
Back
Top