Skip to content

Commit f338f12

Browse files
authored
Merge pull request #46 from mqnifestkelvin/feature_xml_3
Test xml
2 parents a8e1b3e + a3ad919 commit f338f12

16 files changed

+125
-339
lines changed

examples/document.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ A model for documents.
3030
<table>
3131
<tr>
3232
<td><b>sections</b></td>
33-
<td><a href="#section">Section</a></td>
33+
<td><a href="#list">List</a></td>
3434
<td><i>The sections of the document</i></td>
3535
</tr>
3636

@@ -55,7 +55,7 @@ A model of a section of the <a href="#document">Document</a>. Will contain one <
5555
<table>
5656
<tr>
5757
<td><b>paragraphs</b></td>
58-
<td><a href="#paragraph">Paragraph</a></td>
58+
<td><a href="#list">List</a></td>
5959
<td><i>The paragraphs</i></td>
6060
</tr>
6161

examples/document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,4 @@ class Document(Base):
110110
with open("document.specification.bson", "wb") as d:
111111
d.write(bson.encode(doc_dict))
112112

113-
save_to_xml_file(doc_dict, "document.specification.xml")
113+
save_to_xml_file(doc, "document.specification.xml")

examples/document.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ Allowed field Data Type Description
1515

1616
**Allowed children**
1717

18-
=============== ====================== ============================
19-
Allowed child Data Type Description
20-
=============== ====================== ============================
21-
**sections** `Section <#section>`__ The sections of the document
22-
=============== ====================== ============================
18+
=============== ================ ============================
19+
Allowed child Data Type Description
20+
=============== ================ ============================
21+
**sections** `List <#list>`__ The sections of the document
22+
=============== ================ ============================
2323

2424
=======
2525
Section
@@ -36,11 +36,11 @@ Allowed field Data Type Description
3636

3737
**Allowed children**
3838

39-
=============== ========================== ==============
40-
Allowed child Data Type Description
41-
=============== ========================== ==============
42-
**paragraphs** `Paragraph <#paragraph>`__ The paragraphs
43-
=============== ========================== ==============
39+
=============== ================ ==============
40+
Allowed child Data Type Description
41+
=============== ================ ==============
42+
**paragraphs** `List <#list>`__ The paragraphs
43+
=============== ================ ==============
4444

4545
=========
4646
Paragraph

examples/document.specification.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"allowed_children": {
1919
"sections": {
20-
"type": "Section",
20+
"type": "List",
2121
"description": "The sections of the document"
2222
}
2323
}
@@ -32,7 +32,7 @@
3232
},
3333
"allowed_children": {
3434
"paragraphs": {
35-
"type": "Paragraph",
35+
"type": "List",
3636
"description": "The paragraphs"
3737
}
3838
}

examples/document.specification.xml

Lines changed: 8 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,10 @@
11
<?xml version="1.0" ?>
2-
<modelspec>
3-
<Document>
4-
<definition>A model for documents.</definition>
5-
<allowed_parameters>
6-
<id>
7-
<type>str</type>
8-
<description>The unique id of the document</description>
9-
</id>
10-
<title>
11-
<type>str</type>
12-
<description>The document title</description>
13-
</title>
14-
<ISBN>
15-
<type>int</type>
16-
<description>International Standard Book Number</description>
17-
</ISBN>
18-
</allowed_parameters>
19-
<allowed_children>
20-
<sections>
21-
<type>Section</type>
22-
<description>The sections of the document</description>
23-
</sections>
24-
</allowed_children>
25-
</Document>
26-
<Section>
27-
<definition>A model of a section of the :class:`Document`. Will contain one :class:`Paragraph` or more, i.e the :class:`Paragraph`(s) in the section, probably related to the :code:`title` of the `Document &lt;#document&gt;`_.</definition>
28-
<allowed_parameters>
29-
<id>
30-
<type>str</type>
31-
<description>The id of the section</description>
32-
</id>
33-
</allowed_parameters>
34-
<allowed_children>
35-
<paragraphs>
36-
<type>Paragraph</type>
37-
<description>The paragraphs</description>
38-
</paragraphs>
39-
</allowed_children>
2+
<Document id="MyBook" title="My life in Python" ISBN="None">
3+
<Section id="Abstract">
4+
<Paragraph contents="Blah blah blah"/>
5+
<Paragraph contents="Blah2"/>
406
</Section>
41-
<Paragraph>
42-
<definition>A model of a paragraph.</definition>
43-
<allowed_parameters>
44-
<contents>
45-
<type>str</type>
46-
<description>Paragraph contents, which make up the :class:`Section`s.</description>
47-
</contents>
48-
</allowed_parameters>
49-
</Paragraph>
50-
</modelspec>
7+
<Section id="Chapter 1">
8+
<Paragraph contents="More..."/>
9+
</Section>
10+
</Document>

examples/document.specification.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Document:
1212
description: International Standard Book Number
1313
allowed_children:
1414
sections:
15-
type: Section
15+
type: List
1616
description: The sections of the document
1717
Section:
1818
definition: A model of a section of the :class:`Document`. Will contain one :class:`Paragraph`
@@ -24,7 +24,7 @@ Section:
2424
description: The id of the section
2525
allowed_children:
2626
paragraphs:
27-
type: Paragraph
27+
type: List
2828
description: The paragraphs
2929
Paragraph:
3030
definition: A model of a paragraph.

examples/document.xml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
<?xml version="1.0" ?>
2-
<modelspec>
3-
<MyBook>
4-
<title>My life in Python</title>
5-
<sections>
6-
<Abstract>
7-
<paragraphs>
8-
<contents>Blah blah blah</contents>
9-
</paragraphs>
10-
<paragraphs>
11-
<contents>Blah2</contents>
12-
</paragraphs>
13-
</Abstract>
14-
<Chapter_1>
15-
<paragraphs>
16-
<contents>More...</contents>
17-
</paragraphs>
18-
</Chapter_1>
19-
</sections>
20-
</MyBook>
21-
</modelspec>
2+
<Document id="MyBook" title="My life in Python" ISBN="None">
3+
<Section id="Abstract">
4+
<Paragraph contents="Blah blah blah"/>
5+
<Paragraph contents="Blah2"/>
6+
</Section>
7+
<Section id="Chapter 1">
8+
<Paragraph contents="More..."/>
9+
</Section>
10+
</Document>

examples/neuroml2/NeuroML2.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,21 @@ Some description...
2323
<table>
2424
<tr>
2525
<td><b>izhikevich2007Cells</b></td>
26-
<td><a href="#izhikevich2007cell">Izhikevich2007Cell</a></td>
26+
<td><a href="#list">List</a></td>
2727
<td><i></i></td>
2828
</tr>
2929

3030

3131
<tr>
3232
<td><b>pulseGenerators</b></td>
33-
<td><a href="#pulsegenerator">PulseGenerator</a></td>
33+
<td><a href="#list">List</a></td>
3434
<td><i></i></td>
3535
</tr>
3636

3737

3838
<tr>
3939
<td><b>networks</b></td>
40-
<td><a href="#network">Network</a></td>
40+
<td><a href="#list">List</a></td>
4141
<td><i>The networks present</i></td>
4242
</tr>
4343

@@ -181,14 +181,14 @@ Some description...
181181
<table>
182182
<tr>
183183
<td><b>populations</b></td>
184-
<td><a href="#population">Population</a></td>
184+
<td><a href="#list">List</a></td>
185185
<td><i>the pops in the net</i></td>
186186
</tr>
187187

188188

189189
<tr>
190190
<td><b>explicitInputs</b></td>
191-
<td><a href="#explicitinput">ExplicitInput</a></td>
191+
<td><a href="#list">List</a></td>
192192
<td><i></i></td>
193193
</tr>
194194

examples/neuroml2/NeuroML2.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ Allowed field Data Type Description
1414

1515
**Allowed children**
1616

17-
======================= ============================================ ====================
18-
Allowed child Data Type Description
19-
======================= ============================================ ====================
20-
**izhikevich2007Cells** `Izhikevich2007Cell <#izhikevich2007cell>`__
21-
**pulseGenerators** `PulseGenerator <#pulsegenerator>`__
22-
**networks** `Network <#network>`__ The networks present
23-
======================= ============================================ ====================
17+
======================= ================ ====================
18+
Allowed child Data Type Description
19+
======================= ================ ====================
20+
**izhikevich2007Cells** `List <#list>`__
21+
**pulseGenerators** `List <#list>`__
22+
**networks** `List <#list>`__ The networks present
23+
======================= ================ ====================
2424

2525
==================
2626
Izhikevich2007Cell
@@ -76,12 +76,12 @@ Allowed field Data Type Description
7676

7777
**Allowed children**
7878

79-
================== ================================== ===================
80-
Allowed child Data Type Description
81-
================== ================================== ===================
82-
**populations** `Population <#population>`__ the pops in the net
83-
**explicitInputs** `ExplicitInput <#explicitinput>`__
84-
================== ================================== ===================
79+
================== ================ ===================
80+
Allowed child Data Type Description
81+
================== ================ ===================
82+
**populations** `List <#list>`__ the pops in the net
83+
**explicitInputs** `List <#list>`__
84+
================== ================ ===================
8585

8686
==========
8787
Population

examples/neuroml2/NeuroML2.specification.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
},
1414
"allowed_children": {
1515
"izhikevich2007Cells": {
16-
"type": "Izhikevich2007Cell",
16+
"type": "List",
1717
"description": ""
1818
},
1919
"pulseGenerators": {
20-
"type": "PulseGenerator",
20+
"type": "List",
2121
"description": ""
2222
},
2323
"networks": {
24-
"type": "Network",
24+
"type": "List",
2525
"description": "The networks present"
2626
}
2727
}
@@ -106,11 +106,11 @@
106106
},
107107
"allowed_children": {
108108
"populations": {
109-
"type": "Population",
109+
"type": "List",
110110
"description": "the pops in the net"
111111
},
112112
"explicitInputs": {
113-
"type": "ExplicitInput",
113+
"type": "List",
114114
"description": ""
115115
}
116116
}

0 commit comments

Comments
 (0)