-
January 14th, 2005, 10:46 AM
#1
Creating XML Schema in VS.NET...
Hi!
I've created an XML file in VS.NET.
I've created a Schema with "Create Shema" on the XML-menu.
My XML-file then look like this:
Code:
<?xml version="1.0" encoding="utf-8"?>
<ROOT xmlns="http://tempuri.org/XMLFile1.xsd">
<ELEM>
</ELEM>
</ROOT>
The Schema-file (XMLFile1.xsd) now exists in the current dir.
How do I now validate my XML against that Schema?
When I press: "Validate XML Data" on the on the XML-menu I got the following error:
Visual Studio could not locate a schema for this document. Validation can only ensure this is a well formed XML document and cannot validate the data against a schema.
...and justice for all
-
February 16th, 2005, 12:25 PM
#2
Re: Creating XML Schema in VS.NET...
This should help:
Save the XSD from the webpage into this folder:
C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Packages\schemas\xml
This is the secret place where VS.NET looks for schemas.
Then open an XML file in the VS editor, and click inside it. Go to the Properties window, and set targetSchema using the dropdown to the nant schema, which it will now find. (This just puts in the correct xmlns attribute.) Then validation and intellisense should work fine.
Regards, RD
-
February 17th, 2005, 09:58 AM
#3
Re: Creating XML Schema in VS.NET...
...and justice for all
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
|
Click Here to Expand Forum to Full Width
|