3 ms·
Ahh yes. I tried writing a schema for my document (ocd here, I like things to be valid), but then I realized that the cost/benefit ratio of this process would b
by snitko 13y ago
Ahh yes. I tried writing a schema for my document (ocd here, I like things to be valid), but then I realized that the cost/benefit ratio of this process would be completely unreasonable.
- AlexanderDhoore 13y agoIf I had to do it today, I'd probably use DTD to validate the XML tag hierarchy and than use a programming language (with xpath) to validated the attribute and tag contents. XML Schema tries to validate both the tag hierarchy and the contents, which requires data types and complicated definitions. So much overkill... DTD and XPath are actually very nice and simple. This is the DTD equivalent of my XML Schema example above: <!ELEMENT myElement (#PCDATA)> <!ATTLIST myElement myAttribute CDATA> I could see myself writing a small domain language and translate it to DTD, to make it even nicer.
- pjmlp 13y agoThe way I work around XML schema pain is to use visual tools for it, like the ones in Visual Studio, for example. Hand editing XML schema files is too much of a pain.
- mjn 13y agoMy impression is that this is considered the norm in the XML world: you're supposed to edit it via a specialized editor, not directly as raw text.