That was what I was afraid of. So it is not possible to have somehow 2
target namespaces.
Tx,
Koen
"Martin Honnen" <mahotrash@yahoo.de> wrote in message
news:4073dab8$1@olaf.komtel.net...[color=blue]
>
>
> Koen De Wolf wrote:
>
>[color=green]
> > I have the following problem
> > In a schema I refer to a type in a different schema like this:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > elementFormDefault="qualified" attributeFormDefault="unqualified"
> > targetNamespace="http://www.example.com" xmlns:test="test">
> >
> > <xs:import namespace="test" schemaLocation="test.xsd"/>
> > <xs:element name="test">
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element name="IncludedElement" type="test:TestType"/>[/color]
>
> If IncludedElement is supposed to be in the namespace test then you need
> to define it in test.xsd and use
> <xs:element ref="test:IncludedElement" />
> here. Your main schema can only define elements in its targetNamespace.
>[color=green]
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > </xs:schema>
> >
> > What I want to achieve is the following:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <test xmlns="http://www.example.com" xmlns:test="test"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="test test.xsd">
> > <test:IncludedElement>
> > <test:SomeElements/>
> > <test:IncludedElement/>
> > </test:IncludedElement>
> > </test>
> >
> > But this is what I get
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <test xmlns="http://www.example.com" xmlns:test="test"
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > xsi:schemaLocation="test test.xsd">
> > <IncludedElement>
> > <test:SomeElements/>
> > <test:IncludedElement/>
> > </IncludedElement>
> > </test>
> >
> > Using the schema above, the SomeElements and the nested IncludeElement[/color][/color]
are[color=blue][color=green]
> > of the correct namespace (test), But the "containing" IncludeElement is[/color][/color]
not[color=blue][color=green]
> > :(
> >
> > I know a reference to that element instead of to that type will do the
> > trick, but the schema I am refering to only has only 1 global element,[/color][/color]
an I[color=blue][color=green]
> > am not able to change that schema.[/color]
>
>
> --
>
> Martin Honnen
>
http://JavaScript.FAQTs.com/
>[/color]