Re: How to associate XML with XSD

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I think I found most of my answers myself. (Actually, a coworker happened to
wander by my padded cell and he enlightened me ;-) I'd appreciate if someone
who actually knows this stuff would comment on this posting to let me know if
I've got this more or less correct. Thanks!

1. Assuming that I have an XML file and its associated XSD file, what do I put
into the XML file to tell Visual Studio to use the XSD file to wire up
intellisense?

My coworker showed me how to include a bunch of xmlns gibberish in the top-level
element to specify the schema location:

<TopLevelElement
xmlns="MyDefaultNamespace"
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance
xsi:schemaLocation="MyDefaultNamespace MySchemaFile.xsd" >

In the above example, "MyDefaultNamespace" is usually a string that looks like a
web URL, but it can pretty much be any string that doesn't include whitespace or
escaped characters.

2. Is there something else that I need to (or should) do to tell the VS IDE
that my XML file has an associated XSD file?

The "properties" for the XML file includes a field that specifies the related
XSD file. I don't know what happens if this property conflicts with the above
XML text.

The existence of this property solves another mystery -- how the IDE knows about
the schema of app.config files even though the text of the app.config file
doesn't contain any obvious reference to a schema file.



.



Relevant Pages

  • Re: Converting a Schema message to a string message and vice-versa
    ... it will create a schema for you. ... Now, to put a string in to the tag, use an expression shape with code like ... > In Biztalk 2004 I simply want to have a receive location folder to ... > drop an xml file into, and Biztalk pass this xml to the web method ...
    (microsoft.public.biztalk.general)
  • RE: ReadXML and data types
    ... If I want to put the schema in a separate XSD file, ... with my XML file for ReadXml to use? ... > Kevin Yu ...
    (microsoft.public.dotnet.xml)
  • Re: Importing existing XSD schema file into Visual Studio 2005
    ... XML file based on that schema? ... I've been given an XSD file by a 3rd party. ... there are tools in VS.NET to generate the typed DataSet classes ...
    (microsoft.public.dotnet.xml)
  • Xerces-C++ Schema validation
    ... I'm looking for a way of validating/parsing the xsd file (schema), ... only been able of validating the xml file with the corresponding ... schema, but what i want is only validate the xsd file, to check if the ...
    (comp.text.xml)
  • RE: SQLXMLBulkLoad and Keys
    ... and this hierarchy is not represented in the schema. ... For me it is easier to see it with all the indentations: ... > I've created a DTS package to bulk import an XML file into SQL Server ... > in the XSD file having something to do with the Sales_Price_Info key ...
    (microsoft.public.sqlserver.xml)