relaxng-compact

Interleave In RNC

浪尽此生 提交于 2019-12-19 12:04:04
问题 I have source with three p with different attribute values, I tried to make arbitrary order of elements along with one mandatory element p class='paragraph1'. That is any number of paragraph1, paragraph2 and pharagraph3 in any order but there must be at least one paragraph1. Below I tried the interleave option in RNC, but I failed with an error "the element "p" can occur in more than one operand of "interleave"" This is because the same element declared more than one time. But is this

relax-ng compact: attribute whose name matches a reg-ex

Deadly 提交于 2019-12-13 21:52:16
问题 Is there a way in relax-ng to specify that an attribute's name must match a reg-ex. for example the data-attributes in html5. <link rel="some-relation" href="/its-location/" data-color="blue" /> I'm hoping I can do something like... LinkType |= ( attribute rel { text }, attribute data-* { text }*, ( attribute href_template { UriTemplate } | attribute href { Uri } ) ) 回答1: http://books.xmlschemata.org/relaxng/relax-CHP-9.html describes regular expression support in RELAX NG. To my knowledge

Control attribute values order in RelaxNG

亡梦爱人 提交于 2019-12-12 04:42:58
问题 Is it possible to control the order of the attribute values in Relax NG? which can be achieved using xs:assert in schema? XML: <body> <h1 class="title">title</h1> <h2 class="subtitle">subtitle</h2> <p class="paragraph1">para text 1</p> <p class="paragraph2">Para text 2</p> <p class="paragraph3">Para text 2</p> </body> The class value should be in order, paragraph1 should always come first and paragraph2 should come after paragraph1. The assert I tried in schema: <xs:assert test="p[1]/@class =

Need help grasping RelaxngValidatingReader in Commons.Xml.Relaxng

北城以北 提交于 2019-12-11 05:28:19
问题 Environment: RelaxngValidatingReader .Net 2.0 Framework I can't seem to get the validator to equal false, no matter how much I change the xml around. Am I missing some concept here? Resource https://github.com/mono/mono/tree/master/mcs/class/Commons.Xml.Relaxng rnc compact format start = root root = element root { parent1* & parent2* } parent1 = element parent1 { element field { attribute usecase_123 {text} } } parent2 = element parent2 { element field { attribute usecase_AAA {text} } } xml

Interleave In RNC

有些话、适合烂在心里 提交于 2019-12-01 14:17:45
I have source with three p with different attribute values, I tried to make arbitrary order of elements along with one mandatory element p class='paragraph1'. That is any number of paragraph1, paragraph2 and pharagraph3 in any order but there must be at least one paragraph1. Below I tried the interleave option in RNC, but I failed with an error "the element "p" can occur in more than one operand of "interleave"" This is because the same element declared more than one time. But is this possible in RelaxNG using any other method? Source <body> <h1 class="title">title</h1> <h2 class="subtitle"