I understand how to write XML for Android. I would like to somehow define, for lack of the correct term, class for XML, so that I can create instances of it and require certain attributes or elements. A few hours of Googling didn't help, so I am here as a last resort. Here's a little more detail of what I'd like to do.
<CLASS-TEMPLATE>
<required_element required_attribute=""></required_element>
<required_element required_attribute=""></required_element>
</CLASS-TEMPLATE>
<Class-Instance id="0" name="name">
<required_element required_attribute="0">Something</required_element>
<required_element required_attribute="1">Something else</required_element>
</Class-instance>
I would like the Intellij compiler to inform me that I am missing attributes or elements like it does for Android, but I have no idea how to. I experimented with xsl:templates
but I am lost.
TL;DR How can I make regular XML act like Android xml, so I can define required attributes and elements for a class I define and instantiate?