Inline Schema

Matt McMinn

Usenet Archive
Joined
Jun 26, 2001
Messages
7
Reaction score
0
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
 

Henry S. Thompson

Usenet Archive
Joined
Jan 14, 2000
Messages
309
Reaction score
0
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
 

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

No members online now.

Forum statistics

Threads
548,042
Messages
3,104,223
Members
248,131
Latest member
Tonypshaw1

Latest Threads

Top