xml - Is there a way to extend a DTD used for validation? -
i wondering whether there standard way extend dtd or whether way validate document add necessary extensions in xml file.
i have system of plugins organized packages in linux installation (i.e. plugins can depend on 1 or more plugins, loops not allowed):
+----------------------+ +-->| editor |<--+ | +----------------------+ | | | +-----------------+ +-----------------+ | locale | | image | +-----------------+ +-----------------+ ^ ^ | | | +----------------------+ | +---| geomap |---+ +----------------------+
so, have dtd in editor plugin with, example, widget tag has attribute named auto-save this:
<!element widget (value|preset|default|state)*> <!attlist widget id id #required type nmtoken #required auto-save (double | html | int8 | date-us | no | string) "string">
the fact when add locale, want auto-save attribute support type such locale-date not specific us.
similarly, image plugin may want add image type , geomap plugin use geo-location.
so in end, attlist auto-save should (obviously, order not matter):
auto-save (double | html | int8 | date-us | no | string | locale-date | image | geo-location) "string"
even when defining multiple dtds in xml file (xmlns=...
attributes in root tag), not think can that, can we?
right can add types in editor.dtd, that's wrong define locale, image, , geomap types when plugins may not available in tree...
the 1 other solution can think of use xsd, format, how go add sub-additions of attributes , tags?
Comments
Post a Comment