
So it seems I was mistaken in thinking I was using your stylesheets branch? I will take another look tomorrow. Past my bedtime now. Sent from my Honor Mobile -------- Original Message -------- Subject: Re: [tei-council] fun with min and max From: Syd Bauman To: tei-council@lists.tei-c.org CC: Thank you, Lou! Really appreciate that someone else took the time to have fun with min and max. (Great name for a pair of dogs, especially if one is diminutive and one is large.:-) Hmmm ... First, I had to look up what "krekt" stands for. Thank goodness for Wiktionary. But I get different results, possibly because I haven't pushed up a few changes, but I'm not sure (I didn't think any of those changes would affect this, but hey, if I really understood this it wouldn't take > 3 days!) With the snippet of ODD provided in [1], I get the following RNC outputs: 1) ( text | hi )+ Correct! (Note that because 'text' matches the empty string, it makes no practical difference whether the <rng:choice> is allowed oneOrMore or zeroOrMore times.) 2) ( text | ( name, name ) ) Seems completely correct to me, but nothing like what Lou got. 3) ( title?, ( name, name, (name, name? )? ) ) Correct! (And deterministic, to boot.) But again, nothing like what Lou got. And I have never looked at DTD or XSD. The latter is generated by `trang`, so in theory should be correct if handed correct, deterministic, RNG. The former is generated by odd2dtd.xsl, which I hope to have a look at tomorrow. P.S. I've already pushed up a new P5/Test/testerrmav.odd that includes the snippet below. I will push up changes to teiodds.xsl to sydb-occurs2 branch of Stylesheets in a few mins, I hope. below ----- [1] <tmp:ODD_snippet xmlns="http://www.tei-c.org/ns/1.0"> <elementSpec ident="loub1" mode="add"> <classes mode="replace"> <memberOf key="att.global"/> <memberOf key="model.hiLike"/> </classes> <content> <alternate maxOccurs="unbounded"> <textNode/> <elementRef key="hi" /> </alternate> </content> </elementSpec> <elementSpec ident="loub2" mode="add"> <classes mode="replace"> <memberOf key="att.global"/> <memberOf key="model.hiLike"/> </classes> <content> <alternate> <textNode/> <elementRef key="name" minOccurs="2"/> </alternate> </content> </elementSpec> <elementSpec ident="loub3" mode="add"> <classes mode="replace"> <memberOf key="att.global"/> <memberOf key="model.hiLike"/> </classes> <content> <sequence> <elementRef key="title" minOccurs="0" maxOccurs="1"/> <elementRef key="name" minOccurs="2" maxOccurs="4"/> </sequence> </content> </elementSpec> </tmp:ODD_snippet>
I started trying to test this, but didnt get very far.
1. What happens to a content model like this: <alternate maxOccurs="unbounded"> <textNode/> <elementRef key="hi" /> </alternate>
in RNC (using Syd's latest version of stylesheetes -- I think ) this gives us (text|hi)+ [krekt] in DTD I get (#PCDATA|hi)* which is not quite krekt but at least is valid in XSD I get <xs:complexType mixed="true"> <xs:sequence> <xs:element minOccurs="0" maxOccurs="unbounded" ref="tei:hi"/> </xs:sequence> <!-- ... --> i.e same as DTD. good.
2. Let's try using minOccurs
<alternate> <textNode/> <elementRef key="name" minOccurs="2"/> </alternate>
generates in RNC : (name+ | name+ | text) (?WTF?) in DTD : (#PCDATA|hi)* again [I think the presence of a textnode always generates a mixed content like this. Which is fine] in XSD <xs:complexType mixed="true"> <xs:choice minOccurs="0"> <xs:element maxOccurs="unbounded" ref="tei:name"/> <xs:element maxOccurs="unbounded" ref="tei:name"/> </xs:choice> ... </xs:complexType> [which won't do because it is invalid XSD, cos nonambig)
3. Maybe the textnode is special. Let's try something faintly plausible <sequence> <elementRef key="title" minOccurs="0" maxOccurs="1"/> <elementRef key="name" minOccurs="2" maxOccurs="4"/> </sequence>
in RNC : (title?, name, name) in DTD : <!ELEMENT ab (((title)?,name,name,name,name))> in XSD : <xs:sequence> <xs:element minOccurs="0" ref="tei:title"/> <xs:element ref="tei:name"/> <xs:element ref="tei:name"/> </xs:sequence>
None of these of course will validate something with 3 names, even though the ODD content model suggests they should.
I conclude we're all doomed. But you knew that already.
-- tei-council mailing list tei-council@lists.tei-c.org http://lists.lists.tei-c.org/mailman/listinfo/tei-council
PLEASE NOTE: postings to this list are publicly archived
-- Syd Bauman, EMT-Paramedic Senior XML Programmer/Analyst Northeastern University Women Writers Project s.bauman@northeastern.edu or Syd_Bauman@alumni.Brown.edu -- tei-council mailing list tei-council@lists.tei-c.org http://lists.lists.tei-c.org/mailman/listinfo/tei-council PLEASE NOTE: postings to this list are publicly archived