XSD Problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Milan

    #1

    XSD Problem

    I have this situation:

    <myxmldoc xmlns:b="urn:sc hemas-microsoft-com:BizTalkServ er"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespace SchemaLocation= "C:\shema.x sd">
    <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.
  • Milan

    #2
    Re: XSD Problem

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

    Comment

    • C. M. Sperberg-McQueen

      #3
      Re: XSD Problem

      milan@setcce.or g (Milan) writes:
      [color=blue]
      > I have this situation:
      >
      > <myxmldoc xmlns:b="urn:sc hemas-microsoft-com:BizTalkServ er"
      > xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
      > xsi:noNamespace SchemaLocation= "C:\shema.x sd">
      > <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.[/color]

      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

      Comment

      Working...