Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjustments to metaschema data types to align with Commonmark. #378

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 46 additions & 6 deletions schema/xml/metaschema-markup-multiline.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,38 @@
</xs:choice>
</xs:complexType>

<xs:group name="blockElementGroup">
<xs:group name="headingBlockElementGroup">
<xs:choice>
<xs:element name="h1" type="inlineMarkupType"/>
<xs:element name="h2" type="inlineMarkupType"/>
<xs:element name="h3" type="inlineMarkupType"/>
<xs:element name="h4" type="inlineMarkupType"/>
<xs:element name="h5" type="inlineMarkupType"/>
<xs:element name="h6" type="inlineMarkupType"/>
</xs:choice>
</xs:group>

<xs:group name="blockElementGroup">
<xs:choice>
<xs:group ref="headingBlockElementGroup"/>
<xs:group ref="listsGroup"/>
<xs:group ref="blockTextGroup"/>
<xs:element name="p" type="inlineMarkupType"/>
<xs:element name="ul" type="listType"/>
<xs:element name="ol" type="listType"/>
<xs:element name="pre" type="preformattedType"/>
<xs:element name="table" type="tableType"/>
<!-- QUESTION: Deprecate this? -->
<xs:element name="img" type="imageType"/>
</xs:choice>
</xs:group>

<xs:group name="blockTextGroup">
<xs:choice>
<xs:element name="pre" type="preformattedType"/>
<xs:element name="hr"/>
<!-- TODO: need to add support for blockquote, which can contain block elements. usnistgov/metaschema#70 -->
<xs:element name="blockquote" type="blockQuoteType"/>
</xs:choice>
</xs:group>


<!--
headers: phrase inline markup, a, insert (phrase)
Expand All @@ -52,12 +67,30 @@
</xs:sequence>
</xs:complexType>

<xs:complexType name="orderedListType">
<xs:complexContent>
<xs:extension base="listType">
<!-- TODO: confirm if romans are allowed -->
<xs:attribute name="start" type="xs:nonNegativeInteger"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>

<xs:group name="listsGroup">
<xs:choice>
<xs:element name="ul" type="listType"/>
<xs:element name="ol" type="orderedListType"/>
</xs:choice>
</xs:group>

<xs:complexType name="listItemType" mixed="true">
<!-- TODO: is this the correct construction? -->
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="inlineMarkupGroup"/>
<xs:element name="ul" type="listType"/>
<xs:element name="ol" type="listType"/>
<xs:group ref="listsGroup"/>
<xs:group ref="blockTextGroup"/>
<xs:group ref="headingBlockElementGroup"/>
<xs:element name="p" type="inlineMarkupType"/>
</xs:choice>
</xs:complexType>

Expand Down Expand Up @@ -92,4 +125,11 @@
<xs:enumeration value="right"/>
</xs:restriction>
</xs:simpleType>

<xs:complexType name="blockQuoteType">
<!-- TODO: confirm if nested blockquote is supported in markdown -->
aj-stein-nist marked this conversation as resolved.
Show resolved Hide resolved
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="blockElementGroup"/>
</xs:choice>
</xs:complexType>
</xs:schema>
14 changes: 13 additions & 1 deletion schema/xml/metaschema-prose-base.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
<xs:choice>
<xs:element name="a" type="anchorType"/>
<xs:element name="insert" type="insertType"/>
<xs:element name="br" />
<xs:group ref="phraseMarkupGroup"/>
</xs:choice>
</xs:group>
<xs:group name="phraseMarkupGroup">
<xs:choice>
<xs:element name="code" type="inlineMarkupType"/>
<xs:element name="code" type="codeType"/>
<xs:element name="em" type="inlineMarkupType"/>
<xs:element name="i" type="inlineMarkupType"/>
<xs:element name="b" type="inlineMarkupType"/>
Expand All @@ -26,16 +27,27 @@
<xs:element name="img" type="imageType"/>
</xs:choice>
</xs:group>

<xs:complexType name="codeType">
<xs:complexContent>
<xs:extension base="inlineMarkupType">
<xs:attribute name="class" type="xs:token"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>

<xs:complexType name="imageType">
<xs:attribute name="alt" type="xs:string"/>
<xs:attribute name="src" use="required" type="xs:anyURI"/>
<xs:attribute name="title" type="xs:string"/>
</xs:complexType>

<xs:complexType name="anchorType" mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:group ref="phraseMarkupGroup"/>
</xs:choice>
<xs:attribute name="href" type="xs:anyURI"/>
<xs:attribute name="title" type="xs:string"/>
</xs:complexType>

<!--
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,21 @@
"odd-flag": 11,
"field-dates": [
"2020-01-01",
"2020-02-29"
"2020-02-29",
"2020-07-04"
],
"children": [
{
"even-flag": 10,
"even-flag": 4,
"field-date": "2020-01-01"
},
{
"even-flag": 2,
"even-flag": 10,
"field-date": "2020-02-29"
},
{
"even-flag": 2,
"field-date": "2020-07-04"
david-waltermire marked this conversation as resolved.
Show resolved Hide resolved
}
]
}
Expand Down
Loading