Re: xsd

Discussion in 'XML' started by C. M. Sperberg-McQueen, Jul 10, 2003.

  1. (tkr) writes:

    > I tried to validate the an XSD, using on on-line xml validator
    > (
    > but returned following error:
    > Validation error:
    > Cannot resolve schemaLocation attribute. An error occurred
    > at , (3, 4).
    > The '' element
    > is not declared. An error occurred at , (69, 10).
    > The xsd is: [trimmed]

    Well, there is exactly one schemaLocation attribute in the XSD
    you included:

    > <xs:import namespace=""
    > schemaLocation="trywritetxt1_app1.xsd" />

    You bind the prefix 'app1' to this namespace:

    > xmlns:app1="">

    And there is only one Signature element for the processor to
    complain about, and it's in that namespace.

    > <xs:element ref="app1:Signature" />

    So even though I have no firm idea what the location information " ,
    (3, 4)" and " , (69, 10)" is trying to tell you (I suspect the
    application's line counter is off and it thinks it's pointing you to
    lines 3 and 69 of your schema), I would guess strongly that the
    processor was unable to find the schema document you were providing
    for the xmldsig namespace. Since you give the URI in relative form,
    this seems plausible.

    Think of it from the validator's point of view. There you are,
    sitting on the Web at, and
    someone gives you a schema document and an XML document, and you go to
    work to validate the XML document against the schema. The schema
    document refers you to "trywritetxt1_app1.xsd", so you go off to try
    to find that resource. Well, it's a relative URI. So you need to
    make it absolute by combining it with some base URI. What base URI
    should you use? You might use or you might use
    something else -- you can't very well use the URI of the schema
    document you're processing, because you got it via a file upload, not
    by an HTTP GET. Chances are, you're hosed.

    So what I would do in the short term, if I were you, is put the
    trywritetxt1_app1.xsd up on the Web somewhere, and put its full
    absolute URI in the schemaLocation attribute, and try again.

    Later on, I'd get a schema validator running locally on my machine.

    > Any help would be greatly appreciated.

    I hope this helps.

    -C. M. Sperberg-McQueen
    World Wide Web Consortium
    C. M. Sperberg-McQueen, Jul 10, 2003
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Markus
    Nov 22, 2005
  2. Rick Razzano

    XSD document for XSD defintion

    Rick Razzano, Sep 26, 2003, in forum: XML
    C. M. Sperberg-McQueen
    Sep 26, 2003
  3. Replies:
    Martin Honnen
    Jan 14, 2004
  4. Peter Aberline

    xsd:any as a child of xsd:all

    Peter Aberline, Apr 5, 2004, in forum: XML
    Peter Aberline
    Apr 5, 2004
  5. Bernd Oninger
    Henry S. Thompson
    Jun 30, 2004

Share This Page