I'm trying to validate some XML using an XML schema (XSD).
I have XML and XSD documents which validate successfully in oXygen (an XML
editor). However, when I use them with 4D's DOM Parse XML variable I get the
following error:
The XML file is not valid or is not well-formed. (grammar not found for
namespace '' : Line # 3,Column # 60.)
Postings back in 2014 by Mitchell Shiller and Bruno Legay explain how including
a namespace declaration is essential, so I have included
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" in the root element.
Here is the XML:
<?xml version="1.0" encoding="UTF-8"?>
<registrations
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<registration>
<sWebSource>WS_SQLReg_MO</sWebSource>
<sProduct>State</sProduct>
<sisEligCheckRequired>True</sisEligCheckRequired>
</registration>
</registrations>
And here is the XSD:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="registrations">
<xs:complexType>
<xs:sequence>
<xs:element ref="registration"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="registration">
<xs:complexType>
<xs:sequence>
<xs:element ref="sWebSource"/>
<xs:element ref="sProduct"/>
<xs:element ref="sisEligCheckRequired"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="sWebSource" type="xs:NCName"/>
<xs:element name="sProduct" type="xs:NCName"/>
<xs:element name="sisEligCheckRequired" type="xs:NCName"/>
</xs:schema>
Any clues as to what I am missing?
Thanks,
Tom Benedict
Optum
This e-mail, including attachments, may include confidential and/or
proprietary information, and may be used only by the person or entity
to which it is addressed. If the reader of this e-mail is not the intended
recipient or his or her authorized agent, the reader is hereby notified
that any dissemination, distribution or copying of this e-mail is
prohibited. If you have received this e-mail in error, please notify the
sender by replying to this message and delete this e-mail immediately.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************