Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to document the structure of a XML-document?

Status
Not open for further replies.

d00ape

Programmer
Apr 2, 2003
171
SE
Me and some partners are together going to construct a XML-format for storing data. New datatypes will come in the future so the XML-tags will grow. Are there a common way for all of us to handle the way to build up valid documents.

Pleased for all suggestions
 
Like tgreer says. You normally write a XSD first, which describes how your XML documents should look (structure, datatypes, etc). Later, when you receive one of these documents (from a business partner, or even at the method level within your code), you would use the XSD to make sure the XML you received is valid.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
OK. I've read about XSD but I think these files looks more "difficult" to write than the XML itself.

But i guess thats the way we should deal with the problem?
 
Yes. And they are more difficult. They have to be, since they supply the rigorous, exact model of the contents of the XML.

There are tools that will generate a schema for you, based on an XML file. The schema won't be right, but it will give you a basic starting point which you can then refine.



Thomas D. Greer
Providing PostScript & PDF
Training, Development & Consulting
 
tegeer wrote:
---
There are tools that will generate a schema..
---

Nice to hear about tools for generating an XSD-file.
I will search for such a tool but galdly take apart of your recomodation, tgreer.

Thanks - APe
 
I'm fortunate enough to work for a company that provides good development tools, so I use Visual Studio.NET 2003, which has a schema designer built-in.



Thomas D. Greer
Providing PostScript & PDF
Training, Development & Consulting
 
XML-Spy is excellent, but pricey (you can download a 30-day trial).

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
Very intresting tgreer!!

I'm in same position. .NET seems to take my company (Ceco AB in SWE) in "production" in a short future.
I've worked with Visual Studio in a couple of months now and realy like to use it for this.

Short, how do I start.

REALY Thanks - tgreer!!


Also thanks for the XML-Spy-tip chiph
 
You can start by opening an XML file in Visual Studio. There will be a menu item called "XML". Under that menu are options, and one of them is "Create Schema" (or words to that affect, I don't have VS open now).

That will create a schema for you, and open it in the Visual Schema editor. What I usually do then is to save the file, and open the schema file in a text editor. There, I can establish any min/max values, etc.



Thomas D. Greer
Providing PostScript & PDF
Training, Development & Consulting
 
Use FREEWARE XMLFox XML/XSD editor:

XML data format is omnipresent these days. You probably come across XML in your quotidian development tasks more or less frequently. But unless you are really drawn in it, you are hardly to be an expert in all of the innumerable XML standards out there. For example, take a look at XSD schema format. You may know that XSD allows you to specify the schema of an XML file that is a data container. But how you can create the XSD schema?
XMLFox offers free and graphical answers to that question. XMLFox is an XML editing and validation tool for creating valid, well-formed XML documents and/or XSD Schema. It includes an XML View, XML Tree, XML Grid, and XML Script modes for editing, as well as extensive find capabilities for text and XML data. Additional features include XML and Schema Validation, standard editing features, XSD Schema building and more.
 
XMLStick - Do you have any affiliation with XMLFox?

Chip H.


____________________________________________________________________
Click here to learn Ways to help with Tsunami Relief
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top