# HG changeset patch # User Patrick PIERRE # Date 1383751431 -3600 # Node ID 2b36e6a5b5876f36391e2e90ff791d2f20d99e28 # Parent 3a9b70f0d4f7596865f3fad1903ae780f624cb41 Multiple identifiant diff -r 3a9b70f0d4f7 -r 2b36e6a5b587 RelaxNG/Examples/Documents/torture_test.xml --- a/RelaxNG/Examples/Documents/torture_test.xml ven. nov. 01 13:31:18 2013 +0100 +++ b/RelaxNG/Examples/Documents/torture_test.xml mer. nov. 06 16:23:51 2013 +0100 @@ -8,6 +8,7 @@ Test des capacités de publidoc Représentation exhaustive des structures 9781449328030 + 9781449328031 http://www.prismallia.fr/Xml/torture_test Prismallia, Paris, 2013 Sachez vous mettre à l'épreuve diff -r 3a9b70f0d4f7 -r 2b36e6a5b587 RelaxNG/publidoc.rnc --- a/RelaxNG/publidoc.rnc ven. nov. 01 13:31:18 2013 +0100 +++ b/RelaxNG/publidoc.rnc mer. nov. 06 16:23:51 2013 +0100 @@ -27,7 +27,7 @@ top.head.content = (title, shorttitle?, subtitle*)? - & (identifier, identifier?)? + & identifier* & copyright* & collection? & contributors? @@ -543,18 +543,24 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -identifier = element identifier { - (attribute type { "ean" }, xsd:token {pattern = "\d{13}"}) - | (attribute type { "uri" }, xsd:anyURI) -} +# ~~~~~~ identifier +identifier = identifier.uri | identifier.ean -identifier.ean = element identifier { - attribute type { "ean" }, xsd:token {pattern = "\d{13}"} -} +# ~~~~~~ identifier.uri +identifier.uri = element identifier { identifier.uri.attributes } -identifier.uri = element identifier { - attribute type { "uri" }, xsd:anyURI -} +identifier.uri.attributes = + type_uri.attribute + & for.attribute? +type_uri.attribute = attribute type { "uri" }, xsd:anyURI + +# ~~~~~~ identifier.ean +identifier.ean = element identifier { identifier.ean.attributes } + +identifier.ean.attributes = + type_ean.attribute + & for.attribute? +type_ean.attribute = attribute type { "ean" }, xsd:token {pattern = "\d{13}"} # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff -r 3a9b70f0d4f7 -r 2b36e6a5b587 RelaxNG/publiset.rnc --- a/RelaxNG/publiset.rnc ven. nov. 01 13:31:18 2013 +0100 +++ b/RelaxNG/publiset.rnc mer. nov. 06 16:23:51 2013 +0100 @@ -53,7 +53,7 @@ composition.head.content = (title, shorttitle?, subtitle*)? - & (identifier, identifier?)? + & identifier* & copyright* & collection? & contributors? @@ -168,15 +168,25 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ identifier ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -identifier.uri = element identifier { - attribute type { "uri" }, xsd:anyURI -} +# ~~~~~~ identifier +identifier = identifier.uri | identifier.ean -identifier.ean = element identifier { - attribute type { "ean" }, xsd:token {pattern = "\d{13}"} -} +# ~~~~~~ identifier.uri +identifier.uri = element identifier { identifier.uri.attributes } -identifier = identifier.uri | identifier.ean +identifier.uri.attributes = + type_uri.attribute + & for.attribute? +type_uri.attribute = attribute type { "uri" }, xsd:anyURI +for.attribute = attribute for { xsd:NCName } + +# ~~~~~~ identifier.ean +identifier.ean = element identifier { identifier.ean.attributes } + +identifier.ean.attributes = + type_ean.attribute + & for.attribute? +type_ean.attribute = attribute type { "ean" }, xsd:token {pattern = "\d{13}"} # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ copyright ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~