BTW, I don't understand why ya would use XML when it's not needed for such a thing. I mean, I think they are complex...
They aren't really. The complex part is making the schema definition part, but I just wrote one up.
yosh64 said:
Also, remember if an application doesn't come with a .desktop file, or you don't like the one supplied you can easily change. I have all those I have changed myself in my ~/.local/share/applications directory
.
And there's no reason why this XML format can't operate the same way. :rolleyes:
I honestly love the XML idea and hope this is what gets included with the Pandora.
To EvilDragon:
The format you presented isn't valid XML, but it's very close. Really all you need is a surrounding tag, so I just added <software></software>. I also wrote up an XSD file so any .xml files written can be validated.
This is my first XSD (from scratch) so I wasn't able to get the ISO language bit working, as I don't know how to apply an attribute to a simpleType. Everything else is functioning, though.
CODE
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- PXML Software Definition -->
<xs:complexType name="software">
<xs:sequence>
<xs:element name="title" type="humanstring" />
<xs:element name="description" type="humanstring" />
<xs:element name="standalone" type="xs:boolean" />
<xs:element name="icon" type="xs:anyURI" minOccurs="0" />
<xs:element name="preview" type="xs:anyURI" minOccurs="0" />
<xs:element name="author" type="human" minOccurs="0" />
<xs:element name="version" type="xs:string" />
<xs:element name="exec" type="xs:anyURI" />
</xs:sequence>
</xs:complexType>
<!-- Type Definitions -->
<xs:simpleType name="humanstring">
<xs:restriction base="xs:string" />
<!-- <xs:attribute name="lang" type="isocode" /> Optional by default. (Couldn't get this to work. No doubt this is wrong somehow.) -->
</xs:complexType>
<xs:simpleType name="isocode">
<xs:restriction base="xs:string">
<xs
attern value="[A-Z]{2,3}|[0-9]{3}" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="human">
<xs:sequence>
<xs:element name="name" type="xs:string" />
<xs:element name="website" type="xs:anyURI" minOccurs="0" />
<xs:element name="eMail" type="xs:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:schema>