-
Add schema to xml document
This may be a trivially simple question, but for some reason I can't get it to work or find the basic information on how to do it
I have an xml document and an xml schema file and I'd like to add a reference to the schema file in the xml document
In the root element of my xml document, I have the following:
<TXLife Version="2.16.00" xmlns="http://ACORD.org/Standards/Life/2" schemaLocation="CITS_PendingExtractSchema.xsd">
The namespace is correct and the schema file is in the same directory as the xml file, but the file isn't being validated against the schema.
What is it that I'm doing wrong here?
-
the solution
Hey Tom,
I am sure, you probably don't need this anymore, as you post was almost 4 years ago, but I stumbled upon it, as I was looking for something related. I just want to post the answer here, so if another person comes by looking for the same thing, they will find the answer here.
You have to define the namespace via
Code:
xsi:noNamespaceSchemaLocation="..."
and for this you need to add the namespace declaration
Code:
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
So your solution would be:
Code:
<TXLife Version="2.16.00" xmlns="http://ACORD.org/Standards/Life/2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="CITS_PendingExtractSchema.xsd">
To all of you who still read this: when you post a question in a forum and find the answer yourself before someone in the forum does, post your answer there as well, so people who will find your question years later, because they have a similar problem and search for it, will see your correct answer and it will probably help them right away.
Regards
Tom
-
 Originally Posted by TomTest
To all of you who still read this: when you post a question in a forum and find the answer yourself before someone in the forum does, post your answer there as well, so people who will find your question years later, because they have a similar problem and search for it, will see your correct answer
Here here!
Similar Threads
-
By teclioness in forum .NET
Replies: 0
Last Post: 10-07-2005, 07:10 AM
-
Replies: 1
Last Post: 09-15-2005, 12:44 PM
-
By Greg Rothlander in forum ASP.NET
Replies: 1
Last Post: 11-27-2001, 07:09 PM
-
Replies: 2
Last Post: 03-20-2001, 02:08 PM
-
By Sales in forum xml.announcements
Replies: 0
Last Post: 07-20-2000, 06:18 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|