I have used the rng tool to generate a grammar for sitemap.xmap, from
sitemap-v04.dtd (patched version). I did this just to see how
difficult it was. As expected, it did not work automatically - I had
the same problem with dtd2xsd when trying to generate a WXS grammar.

The problem is the DTD effectively has two namespaces - the map:
namespace and the global namespace. I guess as DTDs do not support
namespaces, the conversion tools do not attempt to cope with this.

Still, I was able to systematically correct the grammar, so I could
automate the process with an emacs macro or some such.

The generated grammar is equivalent to the DTD grammar, and as such
fairly loose. I could go on to express the rules better now
(e.g. map:components should have at most one child of each type, but
in any order). Then perhaps write an ant validation task, or maybe
runtime validation through an coccon.xcong option?
-- 
Colin Paul Adams
Preston Lancashire

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to