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

Update schemas to disallow lists in paragraphs #1762

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
200 changes: 197 additions & 3 deletions schema/ListedLicense.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,51 @@
</annotation>
</attribute>
</complexType>
<complexType name="altParagraphType" mixed="true">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>altParagraphType</xhtml:code> represents alternative content within a paragraph, where the SPDX considers several alternatives legally equivalent. The <xhtml:code>match</xhtml:code> will support the legally equivalent alternatives. While the SPDX will aim to exclude legally-signicant differences in <xhtml:code>match</xhtml:code>, this is not always possible. Consumers are encouraged to review matched text manually and make their own conclusions about legal significance.
</xhtml:p>
</documentation>
</annotation>
<group ref="tns:formattedFixedParagraphGroup" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
This formatted content (potentially empty) is the canonical text recommended by the SPDX. It should match at least one version of the canonical text currently recommended by the license steward, if any.
</xhtml:p>
</documentation>
</annotation>
</group>
<attribute name="name" type="string" use="required">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>name</xhtml:code> is a unique (within the license/exception) name for this <xhtml:code>altType</xhtml:code> element.
</xhtml:p>
</documentation>
</annotation>
</attribute>
<attribute name="match" type="string" use="required">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>match</xhtml:code> is the <xhtml:a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_04">POSIX extended regular expression (ERE)</xhtml:a> defining allowed matches. Where possible, alternates are listed in order of decreasing numbers of matched characters, which allows for regular expression engines using both POSIX's <xhtml:a href="http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_01_02">longest-match</xhtml:a> semantics and those which prefer the leftmost branch (e.g. <xhtml:a href="https://golang.org/pkg/regexp/#Compile">Go</xhtml:a>, <xhtml:a href="https://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf#sec-alternative.cE">JavaScript</xhtml:a>, <xhtml:a href="http://perldoc.perl.org/perlre.html#Combining-RE-Pieces">Perl</xhtml:a>, <xhtml:a href="https://docs.python.org/3.5/library/re.html#regular-expression-syntax">Python</xhtml:a>, etc.)
</xhtml:p>
</documentation>
</annotation>
</attribute>
<attribute name="spacing" type="string" default="before">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>spacing</xhtml:code> defines how spacing is handled around the alt text. Since XML does not preserve white space, to render the text from the license XML we need to provide hints to the tools that translate the XML to text (or other formats). Valid values are <xhtml:code>none</xhtml:code> for no spaces before or after the alt text; <xhtml:code>before</xhtml:code> (default) for a space before, but not after the alt text; <xhtml:code>after</xhtml:code> for a space after, but not before the alt text; <xhtml:code>both</xhtml:code>a space before and after the alt text.
</xhtml:p>
</documentation>
</annotation>
</attribute>
</complexType>
<complexType name="altType" mixed="true">
<annotation>
<documentation xml:lang="en">
Expand Down Expand Up @@ -275,6 +320,25 @@
</annotation>
</attribute>
</complexType>
<complexType name="optionalParagraphType" mixed="true">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>optionalType</xhtml:code> is formatted text within a paragraph that is not legally significant. The legal meaning of the license/exception is the same regardless of whether the optional text is included or not.
</xhtml:p>
</documentation>
</annotation>
<group ref="tns:formattedAltParagraphGroup" minOccurs="0" maxOccurs="unbounded"/>
<attribute name="spacing" type="string" default="before">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>spacing</xhtml:code> defines how spacing is handled around the optional text. Since XML does not preserve white space, to render the text from the license XML we need to provide hints to the tools that translate the XML to text (or other formats). Valid values are <xhtml:code>none</xhtml:code> for no spaces before or after the optional text; <xhtml:code>before</xhtml:code> (default) for a space before, but not after the optional text; <xhtml:code>after</xhtml:code> for a space after, but not before the optional text; <xhtml:code>both</xhtml:code>a space before and after the optional text.
</xhtml:p>
</documentation>
</annotation>
</attribute>
</complexType>
<complexType name="optionalType" mixed="true">
<annotation>
<documentation xml:lang="en">
Expand All @@ -294,6 +358,18 @@
</annotation>
</attribute>
</complexType>
<complexType name="optionalStandardLicenseHeaderParagraphType" mixed="true">
<group ref="tns:formattedAltStandardLicenseHeaderParagraphGroup" minOccurs="0" maxOccurs="unbounded"/>
<attribute name="spacing" type="string" default="before">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>spacing</xhtml:code> defines how spacing is handled around the optional text. Since XML does not preserve white space, to render the text from the license XML we need to provide hints to the tools that translate the XML to text (or other formats). Valid values are <xhtml:code>none</xhtml:code> for no spaces before or after the optional text; <xhtml:code>before</xhtml:code> (default) for a space before, but not after the optional text; <xhtml:code>after</xhtml:code> for a space after, but not before the optional text; <xhtml:code>both</xhtml:code>a space before and after the optional text.
</xhtml:p>
</documentation>
</annotation>
</attribute>
</complexType>
<complexType name="optionalStandardLicenseHeaderType" mixed="true">
<group ref="tns:formattedAltStandardLicenseHeaderTextGroup" minOccurs="0" maxOccurs="unbounded"/>
<attribute name="spacing" type="string" default="before">
Expand Down Expand Up @@ -338,6 +414,16 @@
</xhtml:p>
</documentation>
</annotation>
</complexType>
<complexType name="formattedFixedParagraphType" mixed="true">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>formattedFixedParagraphType</xhtml:code> is formatted text without lists, optional or variable portions.
</xhtml:p>
</documentation>
</annotation>
<group ref="tns:formattedFixedParagraphGroup" minOccurs="0" maxOccurs="unbounded"/>
</complexType>
<complexType name="formattedFixedTextType" mixed="true">
<annotation>
Expand All @@ -349,6 +435,16 @@
</annotation>
<group ref="tns:formattedFixedTextGroup" minOccurs="0" maxOccurs="unbounded"/>
</complexType>
<complexType name="formattedAltParagraphType" mixed="true">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>formattedAltParagraphType</xhtml:code> is formatted text that allows optional and variable portions but disallows lists.
</xhtml:p>
</documentation>
</annotation>
<group ref="tns:formattedAltParagraphGroup" minOccurs="0" maxOccurs="unbounded"/>
</complexType>
<complexType name="formattedAltTextType" mixed="true">
<annotation>
<documentation xml:lang="en">
Expand All @@ -359,9 +455,28 @@
</annotation>
<group ref="tns:formattedAltTextGroup" minOccurs="0" maxOccurs="unbounded"/>
</complexType>
<complexType name="formattedAltStandardLicenseHeaderParagraphType" mixed="true">
<group ref="tns:formattedAltStandardLicenseHeaderParagraphGroup" minOccurs="0" maxOccurs="unbounded"/>
</complexType>
<complexType name="formattedAltStandardLicenseHeaderTextType" mixed="true">
<group ref="tns:formattedAltStandardLicenseHeaderTextGroup" minOccurs="0" maxOccurs="unbounded"/>
</complexType>
<group name="formattedFixedParagraphGroup">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>formattedFixedParagraphGroup</xhtml:code> is formatted text without lists, optional or variable portions. The children for <xhtml:code>formattedAltStandardLicenseHeaderParagraphGroup</xhtml:code> have the same semantics, except for the fixed/alt and standard license header distinctions. See the <xhtml:code>formattedAltStandardLicenseHeaderParagraphGroup</xhtml:code> documentation for details on the attribute semantics.
</xhtml:p>
</documentation>
</annotation>
<choice>
<element name="p" type="tns:formattedFixedParagraphType" minOccurs="0" maxOccurs="unbounded"/>
<element name="bullet" type="string" minOccurs="0" maxOccurs="unbounded"/>
<element name="br" type="tns:emptyType" minOccurs="0" maxOccurs="unbounded"/>
<element name="titleText" type="tns:formattedFixedParagraphType" minOccurs="0" maxOccurs="1"/>
<element name="copyrightText" type="tns:formattedFixedParagraphType" minOccurs="0" maxOccurs="1"/>
</choice>
</group>
<group name="formattedFixedTextGroup">
<annotation>
<documentation xml:lang="en">
Expand All @@ -371,14 +486,33 @@
</documentation>
</annotation>
<choice>
<element name="p" type="tns:formattedFixedTextType" minOccurs="0" maxOccurs="unbounded"/>
<element name="p" type="tns:formattedFixedParagraphType" minOccurs="0" maxOccurs="unbounded"/>
<element name="bullet" type="string" minOccurs="0" maxOccurs="unbounded"/>
<element name="list" type="tns:listType" minOccurs="0" maxOccurs="unbounded"/>
<element name="br" type="tns:emptyType" minOccurs="0" maxOccurs="unbounded"/>
<element name="titleText" type="tns:formattedFixedTextType" minOccurs="0" maxOccurs="1"/>
<element name="copyrightText" type="tns:formattedFixedTextType" minOccurs="0" maxOccurs="1"/>
</choice>
</group>

<group name="formattedAltParagraphGroup">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>formattedAltParagraphGroup</xhtml:code> is formatted text with optional and variable portions without lists. The children for <xhtml:code>formattedAltStandardLicenseHeaderParagraphGroup</xhtml:code> have the same semantics, except for the standard license header distinction. See the <xhtml:code>formattedAltStandardLicenseHeaderParagraphGroup</xhtml:code> documentation for details on the attribute semantics.
</xhtml:p>
</documentation>
</annotation>
<choice>
<element name="p" type="tns:formattedAltParagraphType" minOccurs="0" maxOccurs="unbounded"/>
<element name="bullet" type="string" minOccurs="0" maxOccurs="unbounded"/>
<element name="optional" type="tns:optionalParagraphType" minOccurs="0" maxOccurs="unbounded"/>
<element name="alt" type="tns:altParagraphType" minOccurs="0" maxOccurs="unbounded"/>
<element name="br" type="tns:emptyType" minOccurs="0" maxOccurs="unbounded"/>
<element name="titleText" type="tns:formattedAltParagraphType" minOccurs="0" maxOccurs="1"/>
<element name="copyrightText" type="tns:formattedAltParagraphType" minOccurs="0" maxOccurs="1"/>
</choice>
</group>
<group name="formattedAltTextGroup">
<annotation>
<documentation xml:lang="en">
Expand All @@ -388,7 +522,7 @@
</documentation>
</annotation>
<choice>
<element name="p" type="tns:formattedAltTextType" minOccurs="0" maxOccurs="unbounded"/>
<element name="p" type="tns:formattedAltParagraphType" minOccurs="0" maxOccurs="unbounded"/>
<element name="bullet" type="string" minOccurs="0" maxOccurs="unbounded"/>
<element name="list" type="tns:listType" minOccurs="0" maxOccurs="unbounded"/>
<element name="optional" type="tns:optionalType" minOccurs="0" maxOccurs="unbounded"/>
Expand All @@ -398,9 +532,69 @@
<element name="copyrightText" type="tns:formattedAltTextType" minOccurs="0" maxOccurs="1"/>
</choice>
</group>
<group name="formattedAltStandardLicenseHeaderParagraphGroup">
<choice>
<element name="p" type="tns:formattedAltStandardLicenseHeaderParagraphType" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>p</xhtml:code> is a paragraph with the same semantics as in <xhtml:a href="https://www.w3.org/TR/html52/grouping-content.html#elementdef-p">HTML</xhtml:a>.
</xhtml:p>
</documentation>
</annotation>
</element>
<element name="bullet" type="string" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>bullet</xhtml:code> is a list-item bullet.
</xhtml:p>
</documentation>
</annotation>
</element>
<element name="optional" type="tns:optionalStandardLicenseHeaderParagraphType" minOccurs="0" maxOccurs="unbounded"/>
<element name="alt" type="tns:altParagraphType" minOccurs="0" maxOccurs="unbounded"/>
<element name="br" type="tns:emptyType" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>br</xhtml:code> is a line break with the same semantics as in <xhtml:a href="https://www.w3.org/TR/html52/textlevel-semantics.html#the-br-element">HTML</xhtml:a>.
</xhtml:p>
</documentation>
</annotation>
</element>
<element name="titleText" type="tns:formattedAltStandardLicenseHeaderParagraphType" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>titleText</xhtml:code> is the title of the license/exception. This that the content should be formatted as a header and that it optional (as described in <xhtml:content>optionalType</xhtml:content>).
</xhtml:p>
</documentation>
</annotation>
</element>
<element name="copyrightText" type="tns:formattedAltStandardLicenseHeaderParagraphType" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>copyrightText</xhtml:code> is the <xhtml:em>content</xhtml:em> copyright statement. Some licenses/exceptions (e.g. the GPL family) include a copright line for the license/exception itself; <xhtml:code>copyrightText</xhtml:code> should not be used for those cases.
</xhtml:p>
</documentation>
</annotation>
</element>
<element name="standardLicenseHeader" type="tns:formattedAltStandardLicenseHeaderParagraphType" minOccurs="0" maxOccurs="1">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
<xhtml:code>standardLicenseHeader</xhtml:code> is the license steward's recommended text for per-file license grants. Place this element within <xhtml:code>text</xhtml:code> when the license contains the recommended grant text (for example, in an appendix). Make <xhtml:code>standardLicenseHeader</xhtml:code> a sibling of <xhtml:code>text</xhtml:code> when the license does not contain the recommended grant text.
</xhtml:p>
</documentation>
</annotation>
</element>
</choice>
</group>
<group name="formattedAltStandardLicenseHeaderTextGroup">
<choice>
<element name="p" type="tns:formattedAltStandardLicenseHeaderTextType" minOccurs="0" maxOccurs="unbounded">
<element name="p" type="tns:formattedAltStandardLicenseHeaderParagraphType" minOccurs="0" maxOccurs="unbounded">
<annotation>
<documentation xml:lang="en">
<xhtml:p>
Expand Down