Subject: Re: XSL-optimized DTDs (Was: Re: Mixed content: selecting current context w/out child) From: "John E. Simpson" <simpson@xxxxxxxxxxx> Date: Sun, 14 Mar 1999 19:41:01 -0500 |
At 09:43 AM 3/15/99 +1100, Marcus Carr wrote: >John E. Simpson wrote: > >> Yah. In FlixML ver. 3.0 (not yet available on-line), I've done pretty much >> just that (ATTLISTs omitted for brevity): >> <!ELEMENT cast (leadcast, othercast?) > >> <!ELEMENT leadcast ((male | female | animal)*) > >> <!ELEMENT othercast ((male | female | animal)*) > >> <!ELEMENT male (castmember, role)* > >> <!ELEMENT female (castmember, role)* > >> <!ELEMENT animal (castmember, role, species)* > >> <!ELEMENT castmember (#PCDATA) > >> <!ELEMENT role (#PCDATA) > >> <!ELEMENT species (#PCDATA) > > >Just out of interest, what do you do if a castmember has multiple roles and/or >crosses gender and/or is genderless? Well, I thought about some of that. One possibility (e.g. Alec Guiness in "Kind Hearts and Coronets") would be just as you said -- one castmember playing multiple roles. So subordinating <role> to <castmember>, rather than making them siblings, would be a more fully normalized solution. As it is now, yeah, the castmember would have to be repeated for each of the roles: <castmember>Alec Guiness</castmember><role>Ascoyne d'Ascoyne</role> <castmember>Alec Guiness</castmember><role>Henry d'Ascoyne</role> <castmember>Alec Guiness</castmember><role>Canon d'Ascoyne</role> (etc.) The crossing-gender and genderless (like, hmm, robots? the title characters in "Gremlins"?) problems hadn't occurred to me, although I did recognize that there's no provision for animal genders.... But as I mention at one point in the building-a-FlixML-document tutorial (at http://www.flixml.org/flixml_build.html), "Yeah, all right, I could have broken the animal element up into male and female as well. I had to draw the line somewhere -- I was just trying to teach XML, not cover the fraction of a percent of movies with animal cast members of both genders!" :) >It would seem that the following would be >legal: > ><othercast> > <male>Bill Bob</male> > <male>Phil Bob</male> > <male>Tim Bob</male> ></othercast> > ><othercast> > <male>Rob Bob</male> ></othercast> > ><othercast> ></othercast> Maybe I'm misreading something (always a possibility), but I think the first and second example would be illegal because <male> doesn't have PCDATA content. You're right about the third, though, and I need to plug that gap (also the possibility that <male>, <female>, and <animal> can be legally empty). Thanks for the catch. I love finding out about these kinds of bugs in the DTD (and there are others, known as well as yet unknown). OTOH I'm reluctant to make it *too* rigorous; it is, after all, basically just a demonstrator rather than a "real" application, and to the extent that it incorporates a variety of structures -- even "slack" ones -- I'll be able to use it to demonstrate a corresponding variety of circumstances. And on yet another hand, I don't want to be embarrassed about it. :) Thanks again, Marcus! John ========================================================== John E. Simpson | The secret of eternal youth simpson@xxxxxxxxxxx | is arrested development. http://www.flixml.org | -- Alice Roosevelt Longworth XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: XSL-optimized DTDs (Was: Re: Mi, Marcus Carr | Thread | Re: XSL-optimized DTDs (Was: Re: Mi, Marcus Carr |
Re: XSL-optimized DTDs (Was: Re: Mi, Marcus Carr | Date | Re: XSL-optimized DTDs (Was: Re: Mi, John E. Simpson |
Month |