Menu

XML Schema Unavailable

Help
2006-11-15
2012-12-07
  • Nobody/Anonymous

    First off.... you've put together a great, light-weight XML editor..thank you!

    I'm running into an issue when I try to validate my doc against an XML schema. I keep getting the message "XML Schema Unavailable". I've tried using both the following declarations in instance document:

    <study xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:/temp/MySchema.xsd">

    and

    <study xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://localhost/MySchema.xsd"> (whereby I placed doc in inetpub/wwwroot

    Any thoughts? I've checked and rechecked file names/permissions and all looks good.

     
    • gnschmidt

      gnschmidt - 2006-11-15

      Would you mind sending me the schema and an instance document to gnschmidt at users dot sourceforge dot net? I'd be very happy to investigate what's going wrong. If that isn't possible, it may help to go via XML>Associate>XML Schema, which was rewritten from scratch for today's release 1.0.8.3.

      Please do let me know if the problem persists.

      PS I think the second of your examples does not follow the standard value notation for the xsi:schemaLocation attribute: I would expect

      "http://my/target/namespace C:/temp/MySchema.xsd"

      with a space separating the target namespace identifier from the location.

       
    • Nobody/Anonymous

      Hi

      thanks a lot for this nice tool.

      My problem concerning "No XML Schema found:"

      If I do not use a Namespace everything ist ok:

      beispiel30.xml
      <Alles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="beispiel31.xsd">
      ...
      and beispiel20.xsd
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      ..

      But Namespaces do not work:

      <Alles
           targetNamespace="http://localhost/uhu"
           xmlns:ps="http://localhost/uhu"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:SchemaLocation="http://localhost/uhu http://localhost/uhu/beispiel32.xsd"
           >
      will produce the error message "No XML Schema found:" (there is an localhost webserver and the directory uhu and the file beispiel32.xsd exists

      <Alles
           targetNamespace="http://localhost/uhu"
           xmlns:ps="http://localhost/uhu"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:SchemaLocation="http://localhost/uhu beispiel32.xsd"
           >
      .. the same result ..

      Also if I use the menu XML->Associate->XML Schema (with namespace) the Result

      <Alles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ps C:/temp/beispiel32.xsd">

      OR

      <Alles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
            xsi:schemaLocation="http://localhost/uhu C:/temp/beispiel32.xsd">

      produces the well known error message.

      The schema definiton (fiel beispiel32.xsd) is permaently

      <xsd:schema
           targetNamespace="http://localhost/uhu"
           xmlns:prs="http://localhost/uhu"
           xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      >
      Best wishes
      Helge

       
    • gnschmidt

      gnschmidt - 2006-11-17

      I noticed you mentioned the option XML>Associate>XML Schema (with namespace) - it no longer exists as the program now tries to obtain all necessary namespace information by parsing the schema (this is available from this week's release, 1.0.8.3).

      It is possible that remote schemas cannot be opened. I may need to implement this more fully: currently the program simply opens a file handle to parse the schema.

      Now for the examples you mention (I'm not a schema expert, but this is what comes to my mind):

      <Alles 
      targetNamespace="http://localhost/uhu"
      xmlns:ps="http://localhost/uhu"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:SchemaLocation="http://localhost/uhu http://localhost/uhu/beispiel32.xsd"
      >
      I think the targetNamespace attribute should simply be xmlns="http://localhost/uhu". targetNamespace is the attribute name used in the schema itself. As the path to your schema is a remote path, the current implementation may not be able to pull in the namespace information automatically.

      <Alles 
      targetNamespace="http://localhost/uhu"
      xmlns:ps="http://localhost/uhu"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:SchemaLocation="http://localhost/uhu beispiel32.xsd"
      >
      As previous.

      <Alles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ps C:/temp/beispiel32.xsd">
      Please ignore the associate-schema-with-namespace output of versions < 1.0.8.3: they are known to be incorrect.

      <Alles xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
      xsi:schemaLocation="http://localhost/uhu C:/temp/beispiel32.xsd">
      As previous.

      AFAIK, to associate your document to a schema beginning...

      <xsd:schema 
      targetNamespace="http://localhost/uhu"
      xmlns:prs="http://localhost/uhu"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      >

      ... the root element of your instance document should take:

      <Alles
        xmlns="http://localhost/uhu"
        xmlns:prs="http://localhost/uhu"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:SchemaLocation="http://localhost/uhu beispiel32.xsd"
      >

      I hope this works! If it doesn't, please let me know.

       
    • gnschmidt

      gnschmidt - 2006-11-17

      PS I meant to say that remote schemas may not be read correctly at the point of associating them. Validation is done by MSXML on Windows, so a correctly associated document should validate as intended regardless of where the schema resides (e.g. WordprocessingML documents validate without problems).

       

Log in to post a comment.