default namespace = "http://linux.duke.edu/metadata/rpm"
namespace ns1 = "http://novell.com/package/metadata/suse/product"
+include "rpm-ns.rnc"
+
+attribute-kind =
+ attribute kind { "package" | "patch" | "script" | "message" | "product"}
+
+usual-entry-content =
+ (
+ attribute-kind?, # new compared to rpm-ns
+ attribute-name,
+ (
+ shared-entry-attributes,
+ attribute-flags
+ )?,
+ empty
+ )
+
+start =
element ns1:product {
attribute type { text },
element ns1:vendor { text },
}+,
element provides {
element entry {
- attribute name { text },
- attribute kind { "package" | "patch" | "script" | "message" | "product"}?,
- (attribute flags { "EQ" | "LE" | "GE" },
- attribute epoch { xsd:nonNegativeInteger },
- attribute ver { text },
- attribute rel { text }?)?,
+ attribute-kind?,
+ attribute-name,
+ (
+ shared-entry-attributes,
+ attribute-flags-provides
+ )?,
empty
}+
}?,
element conflicts {
element entry {
- attribute name { text },
- attribute kind { "package" | "patch" | "script" | "message" | "product"}?,
- (attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" },
- attribute epoch { xsd:nonNegativeInteger },
- attribute ver { text },
- attribute rel { text }?)?,
- empty
+ usual-entry-content
}+
}?,
element obsoletes {
element entry {
- attribute name { text },
- attribute kind { "package" | "patch" | "script" | "message" | "product"}?,
- (attribute flags { "EQ" | "LE" | "GE" | "LT" },
- attribute epoch { xsd:nonNegativeInteger },
- attribute ver { text },
- attribute rel { text }?)?,
+ attribute-kind?,
+ attribute-name,
+ (
+ shared-entry-attributes,
+ attribute-flags-obsoletes
+ )?,
empty
}+
}?,
element requires {
element entry {
- attribute name { text },
- attribute kind { "package" | "patch" | "script" | "message" | "product"}?,
- (attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" },
- attribute epoch { xsd:nonNegativeInteger },
- attribute ver { text },
- attribute rel { text }?)?,
attribute pre { "1" | "0" }?,
- empty
+ usual-entry-content
}*
}?,
element recommends {
element entry {
- attribute name { text },
- attribute kind { "package" | "patch" | "script" | "message" | "product"}?,
- (attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" },
- attribute epoch { xsd:nonNegativeInteger },
- attribute ver { text },
- attribute rel { text }?)?,
- empty
+ usual-entry-content
}*
}?,
element enhances {
element entry {
- attribute name { text },
- attribute kind { "package" | "patch" | "script" | "message" | "product"}?,
- (attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" },
- attribute epoch { xsd:nonNegativeInteger },
- attribute ver { text },
- attribute rel { text }?)?,
- empty
+ usual-entry-content
}*
}?,
element supplements {
element entry {
- attribute name { text },
- attribute kind { "package" | "patch" | "script" | "message" | "product"}?,
- (attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" },
- attribute epoch { xsd:nonNegativeInteger },
- attribute ver { text },
- attribute rel { text }?)?,
- empty
+ usual-entry-content
}*
}?,
element suggests {
element entry {
- attribute name { text },
- attribute kind { "package" | "patch" | "script" | "message" | "product"}?,
- (attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" },
- attribute epoch { xsd:nonNegativeInteger },
- attribute ver { text },
- attribute rel { text }?)?,
- empty
+ usual-entry-content
}*
}?
}
<?xml version="1.0" encoding="UTF-8"?>
-<element name="ns1:product" xmlns:ns1="http://novell.com/package/metadata/suse/product" ns="http://linux.duke.edu/metadata/rpm" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
- <attribute name="type"/>
- <element name="ns1:vendor">
- <text/>
- </element>
- <element name="ns1:name">
- <text/>
- </element>
- <element name="ns1:version">
- <attribute name="epoch">
- <data type="nonNegativeInteger"/>
+<grammar xmlns:ns1="http://novell.com/package/metadata/suse/product" ns="http://linux.duke.edu/metadata/rpm" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <include href="rpm-ns.rng"/>
+ <define name="attribute-kind">
+ <attribute name="kind">
+ <choice>
+ <value>package</value>
+ <value>patch</value>
+ <value>script</value>
+ <value>message</value>
+ <value>product</value>
+ </choice>
</attribute>
- <attribute name="ver"/>
- <attribute name="rel"/>
- </element>
- <oneOrMore>
- <element name="ns1:displayname">
- <attribute name="lang"/>
- <text/>
- </element>
- </oneOrMore>
- <oneOrMore>
- <element name="ns1:description">
- <attribute name="lang"/>
- <text/>
- </element>
- </oneOrMore>
- <optional>
- <element name="provides">
+ </define>
+ <define name="usual-entry-content">
+ <optional>
+ <ref name="attribute-kind"/>
+ </optional>
+ <!-- new compared to rpm-ns -->
+ <ref name="attribute-name"/>
+ <optional>
+ <ref name="shared-entry-attributes"/>
+ <ref name="attribute-flags"/>
+ </optional>
+ <empty/>
+ </define>
+ <start>
+ <element name="ns1:product">
+ <attribute name="type"/>
+ <element name="ns1:vendor">
+ <text/>
+ </element>
+ <element name="ns1:name">
+ <text/>
+ </element>
+ <element name="ns1:version">
+ <attribute name="epoch">
+ <data type="nonNegativeInteger"/>
+ </attribute>
+ <attribute name="ver"/>
+ <attribute name="rel"/>
+ </element>
<oneOrMore>
- <element name="entry">
- <attribute name="name"/>
- <optional>
- <attribute name="kind">
- <choice>
- <value>package</value>
- <value>patch</value>
- <value>script</value>
- <value>message</value>
- <value>product</value>
- </choice>
- </attribute>
- </optional>
- <optional>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- </choice>
- </attribute>
- <attribute name="epoch">
- <data type="nonNegativeInteger"/>
- </attribute>
- <attribute name="ver"/>
- <optional>
- <attribute name="rel"/>
- </optional>
- </optional>
- <empty/>
+ <element name="ns1:displayname">
+ <attribute name="lang"/>
+ <text/>
</element>
</oneOrMore>
- </element>
- </optional>
- <optional>
- <element name="conflicts">
<oneOrMore>
- <element name="entry">
- <attribute name="name"/>
- <optional>
- <attribute name="kind">
- <choice>
- <value>package</value>
- <value>patch</value>
- <value>script</value>
- <value>message</value>
- <value>product</value>
- </choice>
- </attribute>
- </optional>
- <optional>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- <value>GT</value>
- </choice>
- </attribute>
- <attribute name="epoch">
- <data type="nonNegativeInteger"/>
- </attribute>
- <attribute name="ver"/>
- <optional>
- <attribute name="rel"/>
- </optional>
- </optional>
- <empty/>
+ <element name="ns1:description">
+ <attribute name="lang"/>
+ <text/>
</element>
</oneOrMore>
- </element>
- </optional>
- <optional>
- <element name="obsoletes">
- <oneOrMore>
- <element name="entry">
- <attribute name="name"/>
- <optional>
- <attribute name="kind">
- <choice>
- <value>package</value>
- <value>patch</value>
- <value>script</value>
- <value>message</value>
- <value>product</value>
- </choice>
- </attribute>
- </optional>
- <optional>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- </choice>
- </attribute>
- <attribute name="epoch">
- <data type="nonNegativeInteger"/>
- </attribute>
- <attribute name="ver"/>
- <optional>
- <attribute name="rel"/>
- </optional>
- </optional>
- <empty/>
+ <optional>
+ <element name="provides">
+ <oneOrMore>
+ <element name="entry">
+ <optional>
+ <ref name="attribute-kind"/>
+ </optional>
+ <ref name="attribute-name"/>
+ <optional>
+ <ref name="shared-entry-attributes"/>
+ <ref name="attribute-flags-provides"/>
+ </optional>
+ <empty/>
+ </element>
+ </oneOrMore>
</element>
- </oneOrMore>
- </element>
- </optional>
- <optional>
- <element name="requires">
- <zeroOrMore>
- <element name="entry">
- <attribute name="name"/>
- <optional>
- <attribute name="kind">
- <choice>
- <value>package</value>
- <value>patch</value>
- <value>script</value>
- <value>message</value>
- <value>product</value>
- </choice>
- </attribute>
- </optional>
- <optional>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- <value>GT</value>
- </choice>
- </attribute>
- <attribute name="epoch">
- <data type="nonNegativeInteger"/>
- </attribute>
- <attribute name="ver"/>
- <optional>
- <attribute name="rel"/>
- </optional>
- </optional>
- <optional>
- <attribute name="pre">
- <choice>
- <value>1</value>
- <value>0</value>
- </choice>
- </attribute>
- </optional>
- <empty/>
+ </optional>
+ <optional>
+ <element name="conflicts">
+ <oneOrMore>
+ <element name="entry">
+ <ref name="usual-entry-content"/>
+ </element>
+ </oneOrMore>
</element>
- </zeroOrMore>
- </element>
- </optional>
- <optional>
- <element name="recommends">
- <zeroOrMore>
- <element name="entry">
- <attribute name="name"/>
- <optional>
- <attribute name="kind">
- <choice>
- <value>package</value>
- <value>patch</value>
- <value>script</value>
- <value>message</value>
- <value>product</value>
- </choice>
- </attribute>
- </optional>
- <optional>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- <value>GT</value>
- </choice>
- </attribute>
- <attribute name="epoch">
- <data type="nonNegativeInteger"/>
- </attribute>
- <attribute name="ver"/>
- <optional>
- <attribute name="rel"/>
- </optional>
- </optional>
- <empty/>
+ </optional>
+ <optional>
+ <element name="obsoletes">
+ <oneOrMore>
+ <element name="entry">
+ <optional>
+ <ref name="attribute-kind"/>
+ </optional>
+ <ref name="attribute-name"/>
+ <optional>
+ <ref name="shared-entry-attributes"/>
+ <ref name="attribute-flags-obsoletes"/>
+ </optional>
+ <empty/>
+ </element>
+ </oneOrMore>
</element>
- </zeroOrMore>
- </element>
- </optional>
- <optional>
- <element name="enhances">
- <zeroOrMore>
- <element name="entry">
- <attribute name="name"/>
- <optional>
- <attribute name="kind">
- <choice>
- <value>package</value>
- <value>patch</value>
- <value>script</value>
- <value>message</value>
- <value>product</value>
- </choice>
- </attribute>
- </optional>
- <optional>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- <value>GT</value>
- </choice>
- </attribute>
- <attribute name="epoch">
- <data type="nonNegativeInteger"/>
- </attribute>
- <attribute name="ver"/>
- <optional>
- <attribute name="rel"/>
- </optional>
- </optional>
- <empty/>
+ </optional>
+ <optional>
+ <element name="requires">
+ <zeroOrMore>
+ <element name="entry">
+ <optional>
+ <attribute name="pre">
+ <choice>
+ <value>1</value>
+ <value>0</value>
+ </choice>
+ </attribute>
+ </optional>
+ <ref name="usual-entry-content"/>
+ </element>
+ </zeroOrMore>
</element>
- </zeroOrMore>
- </element>
- </optional>
- <optional>
- <element name="supplements">
- <zeroOrMore>
- <element name="entry">
- <attribute name="name"/>
- <optional>
- <attribute name="kind">
- <choice>
- <value>package</value>
- <value>patch</value>
- <value>script</value>
- <value>message</value>
- <value>product</value>
- </choice>
- </attribute>
- </optional>
- <optional>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- <value>GT</value>
- </choice>
- </attribute>
- <attribute name="epoch">
- <data type="nonNegativeInteger"/>
- </attribute>
- <attribute name="ver"/>
- <optional>
- <attribute name="rel"/>
- </optional>
- </optional>
- <empty/>
+ </optional>
+ <optional>
+ <element name="recommends">
+ <zeroOrMore>
+ <element name="entry">
+ <ref name="usual-entry-content"/>
+ </element>
+ </zeroOrMore>
</element>
- </zeroOrMore>
- </element>
- </optional>
- <optional>
- <element name="suggests">
- <zeroOrMore>
- <element name="entry">
- <attribute name="name"/>
- <optional>
- <attribute name="kind">
- <choice>
- <value>package</value>
- <value>patch</value>
- <value>script</value>
- <value>message</value>
- <value>product</value>
- </choice>
- </attribute>
- </optional>
- <optional>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- <value>GT</value>
- </choice>
- </attribute>
- <attribute name="epoch">
- <data type="nonNegativeInteger"/>
- </attribute>
- <attribute name="ver"/>
- <optional>
- <attribute name="rel"/>
- </optional>
- </optional>
- <empty/>
+ </optional>
+ <optional>
+ <element name="enhances">
+ <zeroOrMore>
+ <element name="entry">
+ <ref name="usual-entry-content"/>
+ </element>
+ </zeroOrMore>
+ </element>
+ </optional>
+ <optional>
+ <element name="supplements">
+ <zeroOrMore>
+ <element name="entry">
+ <ref name="usual-entry-content"/>
+ </element>
+ </zeroOrMore>
+ </element>
+ </optional>
+ <optional>
+ <element name="suggests">
+ <zeroOrMore>
+ <element name="entry">
+ <ref name="usual-entry-content"/>
+ </element>
+ </zeroOrMore>
</element>
- </zeroOrMore>
+ </optional>
</element>
- </optional>
-</element>
+ </start>
+</grammar>
attribute ver { text },
attribute rel { text }?
+attribute-flags-provides =
+ attribute flags { "EQ" | "LE" | "GE" }
+attribute-flags-obsoletes =
+ attribute flags { "EQ" | "LE" | "GE" | "LT" }
+attribute-flags =
+ attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" }
+
attribute-name =
attribute name { text }
attribute-name,
(
shared-entry-attributes,
- attribute flags { "EQ" | "LE" | "GE" }
+ attribute-flags-provides
)?,
empty
}+
attribute-name,
(
shared-entry-attributes,
- attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" }
+ attribute-flags
)?,
empty
}+
attribute-name,
(
shared-entry-attributes,
- attribute flags { "EQ" | "LE" | "GE" | "LT" }
+ attribute-flags-obsoletes
)?,
empty
}+
attribute-name,
(
shared-entry-attributes,
- attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" }
+ attribute-flags
)?,
attribute pre { "1" | "0" }?,
empty
attribute-name,
(
shared-entry-attributes,
- attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" }
+ attribute-flags
)?,
empty
}*
attribute-name,
(
shared-entry-attributes,
- attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" }
+ attribute-flags
)?,
empty
}*
attribute-name,
(
shared-entry-attributes,
- attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" }
+ attribute-flags
)?,
empty
}*
attribute-name,
(
shared-entry-attributes,
- attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" }
+ attribute-flags
)?,
empty
}*
<attribute name="rel"/>
</optional>
</define>
+ <define name="attribute-flags-provides">
+ <attribute name="flags">
+ <choice>
+ <value>EQ</value>
+ <value>LE</value>
+ <value>GE</value>
+ </choice>
+ </attribute>
+ </define>
+ <define name="attribute-flags-obsoletes">
+ <attribute name="flags">
+ <choice>
+ <value>EQ</value>
+ <value>LE</value>
+ <value>GE</value>
+ <value>LT</value>
+ </choice>
+ </attribute>
+ </define>
+ <define name="attribute-flags">
+ <attribute name="flags">
+ <choice>
+ <value>EQ</value>
+ <value>LE</value>
+ <value>GE</value>
+ <value>LT</value>
+ <value>GT</value>
+ </choice>
+ </attribute>
+ </define>
<define name="attribute-name">
<attribute name="name"/>
</define>
<ref name="attribute-name"/>
<optional>
<ref name="shared-entry-attributes"/>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- </choice>
- </attribute>
+ <ref name="attribute-flags-provides"/>
</optional>
<empty/>
</element>
<ref name="attribute-name"/>
<optional>
<ref name="shared-entry-attributes"/>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- <value>GT</value>
- </choice>
- </attribute>
+ <ref name="attribute-flags"/>
</optional>
<empty/>
</element>
<ref name="attribute-name"/>
<optional>
<ref name="shared-entry-attributes"/>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- </choice>
- </attribute>
+ <ref name="attribute-flags-obsoletes"/>
</optional>
<empty/>
</element>
<ref name="attribute-name"/>
<optional>
<ref name="shared-entry-attributes"/>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- <value>GT</value>
- </choice>
- </attribute>
+ <ref name="attribute-flags"/>
</optional>
<optional>
<attribute name="pre">
<ref name="attribute-name"/>
<optional>
<ref name="shared-entry-attributes"/>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- <value>GT</value>
- </choice>
- </attribute>
+ <ref name="attribute-flags"/>
</optional>
<empty/>
</element>
<ref name="attribute-name"/>
<optional>
<ref name="shared-entry-attributes"/>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- <value>GT</value>
- </choice>
- </attribute>
+ <ref name="attribute-flags"/>
</optional>
<empty/>
</element>
<ref name="attribute-name"/>
<optional>
<ref name="shared-entry-attributes"/>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- <value>GT</value>
- </choice>
- </attribute>
+ <ref name="attribute-flags"/>
</optional>
<empty/>
</element>
<ref name="attribute-name"/>
<optional>
<ref name="shared-entry-attributes"/>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- <value>GT</value>
- </choice>
- </attribute>
+ <ref name="attribute-flags"/>
</optional>
<empty/>
</element>
attribute-name,
(
shared-entry-attributes,
- attribute flags { "EQ" | "LE" | "GE" | "LT" | "GT" }
+ attribute-flags
)?,
empty
}+
<ref name="attribute-name"/>
<optional>
<ref name="shared-entry-attributes"/>
- <attribute name="flags">
- <choice>
- <value>EQ</value>
- <value>LE</value>
- <value>GE</value>
- <value>LT</value>
- <value>GT</value>
- </choice>
- </attribute>
+ <ref name="attribute-flags"/>
</optional>
<empty/>
</element>