Loading ...
Sorry, an error occurred while loading the content.
 

Can I validate documents with a xsi:noNamespaceSchemaLocation attribute ?

Expand Messages
  • Jeff Kowing
    I am working on a project where I need to edit xml files created by others that have the following form:
    Message 1 of 2 , May 29, 2006
      I am working on a project where I need to edit
      xml files created by others that have the following form:

      <?xml version="1.0" encoding="UTF-8"?>
      <PlexilPlan xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation=
      "schema_060322.xsd">
      ...
      </PlexilPlan>

      So that I can use nxml-mode and emacs, I converted the project's XML schema,
      schema_060322.xsd, to a RELAX NG Compact form as follows:

      $ java -jar rngconv.jar schema_060322.xsd > schema_060322.rng
      $ java -jar trang.jar schema_060322.rng schema_060322.rnc

      And then I fire up emacs/nxml-mode and associate the document with
      schema_060322.rnc. Everything works splendid except for that troublesome
      xsi:noNamespaceSchemaLocation="schema_060322.xsd" attribute in the root element.
      Nxml-mode complains that it is an invalid attribute and, thus, the document
      does not validate. If I remove the attribute, nxml-mode validates it.

      Is there something I need to modify in the generate RELAX-NG Compact form of the
      schema to get nxml-mode to accept the
      xsi:noNamespaceSchemaLocation="schema_060322.xsd" attribute ? I am obviously an
      idiot when it comes to all of this, so explicit instructions would be very
      greatly appreciated.

      Regards,
      Jeff
    • Florent Georges
      ... You have to add this in the RNC schema to the root element: attribute xsi:schemaLocation { xsd:anyURI }? You can off course use instead include to not
      Message 2 of 2 , May 30, 2006
        Jeff Kowing wrote:

        > And then I fire up emacs/nxml-mode and associate the
        > document with schema_060322.rnc. Everything works
        > splendid except for that troublesome
        > xsi:noNamespaceSchemaLocation="schema_060322.xsd"
        > attribute in the root element. Nxml-mode complains that
        > it is an invalid attribute and, thus, the document does
        > not validate.

        You have to add this in the RNC schema to the root
        element:

        attribute xsi:schemaLocation { xsd:anyURI }?

        You can off course use instead "include" to not modify the
        generated RNC schema. You can see:

        http://relaxng.org/compact-tutorial-20030326.html#id2815524

        Regards,

        --drkm

































        ___________________________________________________________________________
        Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son interface révolutionnaire.
        http://fr.mail.yahoo.com
      Your message has been successfully submitted and would be delivered to recipients shortly.