Inline Schema

M

Matt McMinn

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
 
H

Henry S. Thompson

Matt McMinn said:
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: (e-mail address removed)
URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,825
Latest member
VernonQuy6

Latest Threads

Top