TEIC / Stylesheets

TEI XSL Stylesheets
228 stars 124 forks source link

value list as element content incorrectly documented #365

Open sydb opened 5 years ago

sydb commented 5 years ago

Ticket #154 has been mostly addressed — the RELAX NG content model output of a <valList> inside a <content> seems to be correct. (At least, in the non-comprehensive test @martindholmes and I ran.) However, the HTML documentation (and presumably the PDF and others, as well) puts the controlled vocabulary in a screwy place. Instead of putting the information about the limited values allowed as the content of the element in question into the “May contain” section, it seems that it is either inserted at the bottom of both the “Content model” and “Schema Declaration” sections (for type=closed) or ignored (for type=semi or type=open).

t365.odd.txt

sydb commented 5 years ago

And, BTW, if anyone can tell me why the added <wwp:sst> element defined by the t365.odd file appended to the above comment does not show up in the RELAX NG, I’d appreciate it. (And it shows up bizarrely in the HTML.)

joeytakeda commented 2 months ago

Started work on this in branch issue-365-content_valList

joeytakeda commented 2 months ago

So far, I think I have most of this working (using the sample ODD kindly provided by @sydb)[^1]—it's not the most elegant fix (nor is it particularly dry), but I think this handles elementSpec, macroSpec, and dataSpecs appropriately. However, it does not re-use the full template for attList/content/valList, but it perhaps should since, at present, what I've done does not yet attempt to do anything with dataRefs in combination with valLists.

Moreover, we may also want to finesse captions (e.g. "May contain" makes sense for element content models, but doesn't necessarily for valLists).

Examples

license (valList[@type='closed'])
May containCharacter data only. Legal values are:
copyleft
(GNU GPL)
Apache
(Apache License)
BSD
(Berkeley Software Distribution)
CC
(Creative Commons)
principal (valList[@type='semi'])
May containCharacter data only. Suggested values include:
AL
(Angela Li) Lawndale High’s tyrannical principal in Daria.
pM
(Principal McGee) Rydell High’s uptight principal played by Eve Arden in Grease.
mD
(Mr. Duvall) The tough principal who’s in over his head in Mean Girls.
RM
(Rosalie Mullins runs with an iron first) Principal who runs the School of Rock with an iron first.
aPV
(Assistant Principal Vernon) The assistant principal who takes not an ounce of lip from the Saturday detention crew in The Breakfast Club.
AB
(Headmaster Albus Dumbledore) Headmaster of Hogwarts, he was ‘never proud or vain; he could find something to value in anyone, however apparently insignificant or wretched’.
SS
(Seymour Skinner) Principal of Springfield Elementary on The Simpsons.
RB
(Richard Belding) The quintessential dork principal in who thinks he’s in total control despite being easily duped.
ER
(Ed Rooney) His mission is to ruin Ferris Bueller’s Day Off.
sst (content/macroRef => macroDef/content/valList[@type='closed'])
May containCharacter data only. Legal values are:
Attack_fighter
Cadet_vessel
Cargo_ship
Courier
Deep-space_tactical_assignments
Destroyer
Dreadnought
Escort
Explorer
Explorer+light_cruiser
Freighter
Frigate
Heavy_cruiser
Hospital_ship
Medical_frigate
Personnel_carrier
Runabout
Science_vessel
Science_vessel+Scout
Science_vessel+supply_ship
Scout
Scout_ship
Space_cruiser
Star_cruiser
Starship-class
Survey_ship+Transport+Freighter+Science_vessel
Survey_vessel
Timeship
Transport
Transport+shuttle< /span>
Tug+Transport
Warship

Sample output

stylesheets-365.html.txt

[^1]: I did have to modify the ODD slightly — most of the spec elements were following siblings of the schemaSpec rather than children.