mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-23 09:42:20 -05:00
commit
9b4e5b7b19
@ -101,6 +101,12 @@ def extract_xep_metadata(document):
|
|||||||
else:
|
else:
|
||||||
last_call = None
|
last_call = None
|
||||||
|
|
||||||
|
tags = []
|
||||||
|
tags_elem = minidom_find_child(header, "tags")
|
||||||
|
if tags_elem is not None:
|
||||||
|
for child in minidom_children(tags_elem):
|
||||||
|
tags.append(minidom_get_text(child))
|
||||||
|
|
||||||
return {
|
return {
|
||||||
"last_revision": {
|
"last_revision": {
|
||||||
"version": last_revision_version,
|
"version": last_revision_version,
|
||||||
@ -113,6 +119,7 @@ def extract_xep_metadata(document):
|
|||||||
"sig": sig,
|
"sig": sig,
|
||||||
"abstract": abstract,
|
"abstract": abstract,
|
||||||
"shortname": shortname,
|
"shortname": shortname,
|
||||||
|
"tags": tags,
|
||||||
"title": title,
|
"title": title,
|
||||||
"approver": approver,
|
"approver": approver,
|
||||||
"last_call": last_call,
|
"last_call": last_call,
|
||||||
@ -137,6 +144,12 @@ def make_metadata_element(number, metadata, accepted, *, protoname=None):
|
|||||||
if metadata["shortname"] is not None:
|
if metadata["shortname"] is not None:
|
||||||
result.append(text_element("shortname", metadata["shortname"]))
|
result.append(text_element("shortname", metadata["shortname"]))
|
||||||
|
|
||||||
|
if metadata["tags"]:
|
||||||
|
tags = etree.Element("tags")
|
||||||
|
for tag in metadata["tags"]:
|
||||||
|
tags.append(text_element("tag", tag))
|
||||||
|
result.append(tags)
|
||||||
|
|
||||||
if metadata["last_revision"]["version"] is not None:
|
if metadata["last_revision"]["version"] is not None:
|
||||||
last_revision = metadata["last_revision"]
|
last_revision = metadata["last_revision"]
|
||||||
revision_el = etree.Element("last-revision")
|
revision_el = etree.Element("last-revision")
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
<supersedes/>
|
<supersedes/>
|
||||||
<supersededby/>
|
<supersededby/>
|
||||||
<shortname>NOT_YET_ASSIGNED</shortname>
|
<shortname>NOT_YET_ASSIGNED</shortname>
|
||||||
|
<tags>
|
||||||
|
<tag>template</tag>
|
||||||
|
</tags>
|
||||||
<author>
|
<author>
|
||||||
<firstname>Peter</firstname>
|
<firstname>Peter</firstname>
|
||||||
<surname>Saint-Andre</surname>
|
<surname>Saint-Andre</surname>
|
||||||
|
4
xep.dtd
4
xep.dtd
@ -27,7 +27,7 @@ THE SOFTWARE.
|
|||||||
<!ELEMENT xep ( header, section1* ) >
|
<!ELEMENT xep ( header, section1* ) >
|
||||||
<!ATTLIST xep
|
<!ATTLIST xep
|
||||||
xmlns CDATA '' >
|
xmlns CDATA '' >
|
||||||
<!ELEMENT header ( title, abstract, legal, number, status, lastcall*, interim*, type, sig, approver*, dependencies, supersedes, supersededby, shortname, schemaloc*, registry?, discuss?, expires?, author+, revision+, councilnote? ) >
|
<!ELEMENT header ( title, abstract, legal, number, status, lastcall*, interim*, type, sig, approver*, dependencies, supersedes, supersededby, shortname, tags?, schemaloc*, registry?, discuss?, expires?, author+, revision+, councilnote?) >
|
||||||
<!ELEMENT title (#PCDATA)* >
|
<!ELEMENT title (#PCDATA)* >
|
||||||
<!ELEMENT abstract (#PCDATA)* >
|
<!ELEMENT abstract (#PCDATA)* >
|
||||||
<!ELEMENT legal ( copyright, permissions, warranty, liability, conformance ) >
|
<!ELEMENT legal ( copyright, permissions, warranty, liability, conformance ) >
|
||||||
@ -68,6 +68,8 @@ THE SOFTWARE.
|
|||||||
<!ELEMENT initials (#PCDATA)* >
|
<!ELEMENT initials (#PCDATA)* >
|
||||||
<!ELEMENT remark (#PCDATA | p | ul)* >
|
<!ELEMENT remark (#PCDATA | p | ul)* >
|
||||||
<!ELEMENT councilnote (#PCDATA)* >
|
<!ELEMENT councilnote (#PCDATA)* >
|
||||||
|
<!ELEMENT tags ( tag* ) >
|
||||||
|
<!ELEMENT tag (#PCDATA)* >
|
||||||
<!ELEMENT section1 ( div | p | section2 | example | code | cve | ul | ol | dl | table )* >
|
<!ELEMENT section1 ( div | p | section2 | example | code | cve | ul | ol | dl | table )* >
|
||||||
<!ATTLIST section1
|
<!ATTLIST section1
|
||||||
topic CDATA ''
|
topic CDATA ''
|
||||||
|
9
xep.xsd
9
xep.xsd
@ -70,6 +70,7 @@ THE SOFTWARE.
|
|||||||
<xs:element ref='supersedes'/>
|
<xs:element ref='supersedes'/>
|
||||||
<xs:element ref='supersededby'/>
|
<xs:element ref='supersededby'/>
|
||||||
<xs:element name='shortname' type='xs:NCName'/>
|
<xs:element name='shortname' type='xs:NCName'/>
|
||||||
|
<xs:element ref='tags' minOccurs='0'/>
|
||||||
<xs:element ref='schemaloc' minOccurs='0' maxOccurs='unbounded'/>
|
<xs:element ref='schemaloc' minOccurs='0' maxOccurs='unbounded'/>
|
||||||
<xs:element name='registry' minOccurs='0' type='empty'/>
|
<xs:element name='registry' minOccurs='0' type='empty'/>
|
||||||
<xs:element name='discuss' minOccurs='0' type='xs:string'/>
|
<xs:element name='discuss' minOccurs='0' type='xs:string'/>
|
||||||
@ -196,6 +197,14 @@ THE SOFTWARE.
|
|||||||
</xs:complexType>
|
</xs:complexType>
|
||||||
</xs:element>
|
</xs:element>
|
||||||
|
|
||||||
|
<xs:element name='tags'>
|
||||||
|
<xs:complexType>
|
||||||
|
<xs:sequence minOccurs='1' maxOccurs='unbounded'>
|
||||||
|
<xs:element name='tag' type='xs:string'/>
|
||||||
|
</xs:sequence>
|
||||||
|
</xs:complexType>
|
||||||
|
</xs:element>
|
||||||
|
|
||||||
<xs:element name='remark'>
|
<xs:element name='remark'>
|
||||||
<xs:complexType>
|
<xs:complexType>
|
||||||
<xs:choice>
|
<xs:choice>
|
||||||
|
Loading…
Reference in New Issue
Block a user