Inline Schema

Discussion in 'XML' started by Matt McMinn, May 6, 2004.

  1. Matt McMinn

    Matt McMinn Guest

    I'm trying to have an XML file validate against an inline schema. The
    declarations follow:

    <PLMXML xmlns="http://www.plmxml.org/Schemas/PLMXMLSchema"
    xmlns:data="x-schema:#inLineSchema">
        <Schema name="inLineSchema"
    targetNamespace="http://www.plmxml.org/Schemas/PLMXMLSchema"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:plm="http://www.plmxml.org/Schemas/PLMXMLSchema"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    xml:lang="en">
    .....
    </Schema>
    </PLMXML>

    The rest of the schema, and the XML file follow this. If the schema is in a
    seperate file, and I reference it from within the XML file, it validates
    fine. If I put the schema file inline like this, I get a "cannot find the
    declartion of element PLMXML error". I'm assuming that I'm calling the
    schema incorrectly - can anyone show me the right way?

    Thanks

    Matt
    Matt McMinn, May 6, 2004
    #1
    1. Advertising

  2. Matt McMinn <> writes:

    > I'm trying to have an XML file validate against an inline schema. The
    > declarations follow:
    >
    > <PLMXML xmlns="http://www.plmxml.org/Schemas/PLMXMLSchema"
    > xmlns:data="x-schema:#inLineSchema">
    >     <Schema name="inLineSchema"
    > targetNamespace="http://www.plmxml.org/Schemas/PLMXMLSchema"
    > xmlns:xsd="http://www.w3.org/2001/XMLSchema"


    Unfortunately support for inline schemas varies widely between
    validators -- which one are you using?

    Also note that there appear to be at least three bugs visible above
    regardless of validator:

    1) Schema should be schema
    2) Either schema should be xsd:schema, or xsd:xmlns=... should be
    xmlns=...
    3) name=... should be id=...

    Also, unless that xmlns:data is some magic for some schema validator
    I'm not aware of, you need a
    xsi:schemaLocation="http://www.plmxml.org/Schemas/PLMXMLSchema
    #inLineSchema" on your PLMXML element.

    ht
    --
    Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
    Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
    Fax: (44) 131 650-4587, e-mail:
    URL: http://www.ltg.ed.ac.uk/~ht/
    [mail really from me _always_ has this .sig -- mail without it is forged spam]
    Henry S. Thompson, May 7, 2004
    #2
    1. Advertising

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
    Replies:
    1
    Views:
    1,497
    Markus
    Nov 23, 2005
  2. Stanimir Stamenkov
    Replies:
    3
    Views:
    1,172
    Stanimir Stamenkov
    Apr 25, 2005
  3. Abhi
    Replies:
    2
    Views:
    727
    E. Robert Tisdale
    Jul 3, 2003
  4. Alvin
    Replies:
    7
    Views:
    466
    E. Robert Tisdale
    May 6, 2005
  5. Replies:
    3
    Views:
    451
Loading...

Share This Page