jimc5240
asked on
Validate XML with XSD
Hi,
I'm completely new to XML and I'm trying to validate and XML document with an XSD. I've used two different tools to try and make this work and both fail with essentially the same error:
"The element declaration was not found for root element query.querySubmission. "
I've read every thing I could find on this and I'm still baffled by the whole thing. Here is the document header:
<?xml version="1.0" encoding="UTF-8"?>
<query:querySubmission xmlns:query="http://www.npdb-hipdb.hrsa.gov/Query" xmlns:co="http://www.npdb-hipdb.hrsa.gov/Common" xmlns:ad="http://www.npdb-hipdb.hrsa.gov/Address" xmlns:orgCd="http://www.npdb-hipdb.hrsa.gov/OrganizationCode" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.npdb-hipdb.hrsa.gov/Common \\voyager\c$\QRXS\npdb-hip db-common. xsd">
Can anyone point me in the right direction? Thanks
I'm completely new to XML and I'm trying to validate and XML document with an XSD. I've used two different tools to try and make this work and both fail with essentially the same error:
"The element declaration was not found for root element query.querySubmission. "
I've read every thing I could find on this and I'm still baffled by the whole thing. Here is the document header:
<?xml version="1.0" encoding="UTF-8"?>
<query:querySubmission xmlns:query="http://www.npdb-hipdb.hrsa.gov/Query" xmlns:co="http://www.npdb-hipdb.hrsa.gov/Common" xmlns:ad="http://www.npdb-hipdb.hrsa.gov/Address" xmlns:orgCd="http://www.npdb-hipdb.hrsa.gov/OrganizationCode" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.npdb-hipdb.hrsa.gov/Common \\voyager\c$\QRXS\npdb-hip
Can anyone point me in the right direction? Thanks
ASKER
I just tried to attach the files and the web site says that the file extension .xsd is not allowed. I tried zipping it up but no go. Can I cut and paste something?
Thanks
Thanks
you can always change the extension to .txt
the server will then accept it
(or send a zip to my email address, found in my profile)
the server will then accept it
(or send a zip to my email address, found in my profile)
ASKER
Duh. Here it is
npdb-hipdb-common.txt
npdb-hipdb-common.txt
Hey, I can't verify where the problem is, because you are importing other schema modules, which you did not provide
please check them for further nested imports, I suspect there are more
<import namespace="http://www.npdb-hipdb.hrsa.gov/OrganizationCode" schemaLocation="npdb-hipdb -organizat ion-type-c ode.xsd"/>
<import namespace="http://www.npdb-hipdb.hrsa.gov/Address" schemaLocation="npdb-hipdb -address.x sd"/>
please check them for further nested imports, I suspect there are more
<import namespace="http://www.npdb-hipdb.hrsa.gov/OrganizationCode" schemaLocation="npdb-hipdb
<import namespace="http://www.npdb-hipdb.hrsa.gov/Address" schemaLocation="npdb-hipdb
so, make sure that at your site, all modules you need are available at the import address
after that validate again
good luck
Geert
after that validate again
good luck
Geert
ASKER
Sorry, this is everything I have, I wasn't sure what you needed.
npdb-hipdb-address.txt
npdb-hipdb-individual.txt
npdb-hipdb-occupation-licensure.txt
npdb-hipdb-subject-import.txt
npdb-hipdb-address.txt
npdb-hipdb-individual.txt
npdb-hipdb-occupation-licensure.txt
npdb-hipdb-subject-import.txt
well
before I can tell you more...
I think you are at least missing this one
npdb-hipdb-organization-ty pe-code.xs d
before I can tell you more...
I think you are at least missing this one
npdb-hipdb-organization-ty
If you don't have that one, it explains why the XML was not valid
ASKER
Okay, I think I found the remaining files but still can't get it to work. Here are the files.
npdb-hipdb-organization-type-cod.txt
npdb-hipdb-organization.txt
npdb-hipdb-organization-type-cod.txt
npdb-hipdb-organization.txt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I know this isn't an aswer but I wanted to give you the points for the effort, thanks
welcome, it would have pleased me more, if I would have given you more help
\\voyager\c$\QRXS\npdb-hip
or that the querySubmission element is not declared in that namespace
The target namespace of the schema appears to be
http://www.npdb-hipdb.hrsa.gov/Common
The namespace of the querySubmission is
http://www.npdb-hipdb.hrsa.gov/Query
Since they are different, this means that there is a schema import.
So make sure that inside the schema the imports of other schema modules is pointing to accessible files
Maybe you can send the schema