1: You can write it by hand and test it against your file with xmllint
2: Take a look here w3c doc-1 and here w3c doc-2 but they are the full documentation/specification. But I think the best is here xsd-tutorial
Question
I am a beginner with XML. I can do DTD
fairly well.
While learning about XSD
and how to generate it, I found that all the tutorials available on Google and those on YouTube create XSD
using third-party tools. For Windows they use either VB
or xsd.exe
tool.
Although handy, from a learner's point-of-view they are not good as I should know how to do it manually and later move on to automated schema generation.
My question is:
XSD
s and DTD
s always generated using third party tools ? I am on a Windows machine, by the way :)
Solution
1: You can write it by hand and test it against your file with xmllint
2: Take a look here w3c doc-1 and here w3c doc-2 but they are the full documentation/specification. But I think the best is here xsd-tutorial
OTHER TIPS
Writing a schema without any tools assistance at all is a bit masochistic. If you know the language reasonably well, a syntax-directed editor (such as oXygen) might be enough tooling for your needs. However, if you've got an instance document available that's reasonably representative of what you will encounter, then generating an XSD from the instance and modifying the generated XSD as required will save you a lot of effort.
You definitely need a reference book on your desk. I use both van der Vlist and Walmsley.
I have written several by myself (with the assistance of some documentation) this link I actually prefer to do it myself, because the automatic ones may not work like I'd like them to (using Choices instead of sequences for example)