Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - multiple namespaces [Thread Next] RE: multiple namespacesTo: "'Andrew Welch'" <andrew.j.welch@-----.--->, <xmlschema-dev@--.---> Date: 4/23/2007 4:21:00 PM > With this XML: > > <ns1:foo>some text</ns1:foo> > <ns2:bar>some text</ns2:bar> > > Am I right in thinking I need two schemas - one for each namespace? No, you need two *schema documents* each defining part of a single *schema*. > Also, if I define a simple type of non-empty-string: > > <xs:simpleType name="non-empty-string"> > <xs:restriction base="xs:string"> > <xs:minLength value="1"/> > </xs:restriction> > </xs:simpleType> > > ...when I refer to that type it seems I have to use the > prefix defined in the schema, for example to use the simple > type above I need: > > <xs:element name="foo" type="ns1:non-empty-string"/> No, you can omit the prefix, and the default namespace will be used (as declared using xmlns="...". This is not necessarily the same as the target namespace of the schema document). >Am I missing something here? Yes, I think so! Michael Kay http://www.saxonica.com/ From noah_mendelsohn@u... Mon Apr 23 14:36:22 2007 Received: from | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
