[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Validate XML with XSD

Posted on 2009-04-03
13
Medium Priority
?
546 Views
Last Modified: 2012-05-06
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-hipdb-common.xsd">

Can anyone point me in the right direction?  Thanks
0
Comment
Question by:jimc5240
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 5
13 Comments
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24060548
That either means that the schema is not found at location
\\voyager\c$\QRXS\npdb-hipdb-common.xsd
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
0
 

Author Comment

by:jimc5240
ID: 24060679
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
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24060758
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)
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:jimc5240
ID: 24060791
Duh.  Here it is
npdb-hipdb-common.txt
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24061153
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-organization-type-code.xsd"/>
    <import namespace="http://www.npdb-hipdb.hrsa.gov/Address" schemaLocation="npdb-hipdb-address.xsd"/>
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24061731
so, make sure that at your site, all modules you need are available at the import address
after that validate again

good luck

Geert
0
 

Author Comment

by:jimc5240
ID: 24062162
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24073170
well
before I can tell you more...
I think you are at least missing this one
npdb-hipdb-organization-type-code.xsd
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24073173
If you don't have that one, it explains why the XML was not valid
0
 

Author Comment

by:jimc5240
ID: 24101023
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
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 1500 total points
ID: 24101204
I have to disappoint you, I am afraid.
The schemas I now have are all valid, but none of them defines an element querySubmission.
So, in the schema you have put as a schemalocation, the element is not defined,
so this can't work.
I am afraid you need yet another schema
0
 

Author Closing Comment

by:jimc5240
ID: 31566239
I know this isn't an aswer but I wanted to give you the points for the effort, thanks
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 24163171
welcome, it would have pleased me more, if I would have given you more help
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question