Lists Home |
Date Index |
Frans Englich <firstname.lastname@example.org> asks:
> Hello all,
> I have trouble determining the optimal design/format for an XML
> document. The situation is identical to if each entry in a MS
> Windows/KDE/GNOME start menu were represented by an XML
> document, and that
> its hierarchical position(it's category) should be described.
> An example: the program Calculator's XML document looks like this:
> And I want to describe that it should be located in
> One possibility is:
> Another possibility is:
> That is, the hierarchy translates directly to the XML
> document where each
> category is an element.
> No matter what solution, it should be described in an XML
> Schema, and should
> be possible to validate. Instances will be read and computed
> with XSLT.
As others have pointed out, if you want to validate this you need to
have some kind of type added to the various menu parts. This can be
either an attribute or make the element name the type and move the name
into an attribute or sub-element (yuck). Personally, I think you can go
either way; support for multiple languages should be done via reference
into an external library via idRef's or such so that needn't come into
play when deciding on the structure here, eg:
<programs type="menuItem" titleRef="124" helpRef="456">
<utilities type="menuItem" titleRef="125"/>
Works as does:
<menuItem titleRefId="124" helpRefId="456" programRefId="789">
<menuItem titleRefId="125" programRefId="790"/>
Pick you language library as needed, fall back as allowed, somewhere you
should have an entry for title="123", etc.
OTOH, going with the freedesktop.org format makes even more sense if it
fit's your needs...