XSD Problem

M

Milan

I have this situation:

<myxmldoc xmlns:b="urn:schemas-microsoft-com:BizTalkServer"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="C:\shema.xsd">
<Invoice id="invoice">
<myTag1>
....
</myTag1>
</Invoice>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"
....
</Signature>
</myxmldoc>


The problem is that XML Spy complains, when validating using XML Shema:

"Mandatory local element 'Signature' must be unqualified (i.e. outside of
any namespace), but you are using a default namespace."

What is this? Is there some workaround? I'd like to keep "Signature"
element (and "myxmldoc" element) exactly as it is now.
 
M

Milan

Thank you. Is there a workaround to have one shema and to keep the
same XML doc as it is now?
 
C

C. M. Sperberg-McQueen

I have this situation:

<myxmldoc xmlns:b="urn:schemas-microsoft-com:BizTalkServer"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="C:\shema.xsd">
<Invoice id="invoice">
<myTag1> ... </myTag1>
</Invoice>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#"
...
</Signature>
</myxmldoc>


The problem is that XML Spy complains, when validating using XML Shema:

"Mandatory local element 'Signature' must be unqualified (i.e.
outside of any namespace), but you are using a default namespace."

What is this? Is there some workaround? I'd like to keep "Signature"
element (and "myxmldoc" element) exactly as it is now.

What does the schema document 'C:\schema.xsd' say about the
Signature element? Judging by the error message, I'd guess it
declares it as an element local to the complex type of
element 'myxmldoc', and does not associate it with any
namespace.

If you want the Signature element to be in the namespace
http://www.w3.org/2000/09/xmldsig# then (a) you won't be able
to declare it in a schema document without any target namespace,
and (b) the declaration for the complex type used by 'myxmldoc'
will need to refer to a Signature element in the dsig namespace,
not to a Signature element without an associated namespace.

If you'll post the relevant parts of your schema, it will be easier
to figure out what exactly you are trying to do.

In the meantime, I hope this helps a little.

-C. M. Sperberg-McQueen
World Wide Web Consortium
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

XSD schema problem 0
Namespace prefix in XSD 1
xsd definition 4
xsd: any complex type? 0
how to validate XML against one given xsd file 2
What's wrong with this XSD? 5
XSD Constraints 1
XSD <any> element 0

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top