() Thien-Thi Nguyen <[email protected]> () Sat, 22 Dec 2012 19:55:29 +0100
Also on my mind now are internal references [...] FYI, attached is an example session demonstrating substitution w/ internal references (aka dedup) for the elements ‘menunode’, ‘indexterm’ and ‘float’. I opted to append ‘ix-’ to the affected element names, and use ‘ix-coord’ (hyphen) as the attribute name.
$ ../c/retrieve ixin.ixin dump-node 4
((@)
(section
(@)
(title (@) "Terminology")
(para (@)
"This section first introduces the fundamental data structure around
which IXIN revolves conceptually, and then defines terms used in the
specification to describe the file format's concrete representations.")
(menu (@)
(menuentry
(@)
(ix-menunode (@ (ix-coord "(node 5)")))
(menutitle (@) "associative array")
(menucomment (@) "In mind, in memory."))
(menuentry
(@)
(ix-menunode (@ (ix-coord "(node 6)")))
(menutitle (@) "representations")
(menucomment (@) "On view, on disk.")))))a
$ ../c/retrieve ixin.ixin dump-node 5
((@)
(subsection
(@)
(title (@) "associative array")
(para (@)
(strong (@) "NB")
": Unlike the other definitions (see "
(xref (@) (xrefnodename (@) "representations"))
" which describe concrete representations, those in this subsection
describe a conceptual data structure and its related algorithms.")
(table (@)
(tableitem
(@)
(tableterm (@) "associative array")
(ix-indexterm (@ (ix-coord "(dts cp 4)")))
(item (@)
(para (@)
(ix-indexterm (@ (ix-coord "(dts cp 2)")))
" A (possibly ordered) set of pairs of objects. The
first in the pair is the "
(dfn (@) "key")
", and the second the "
(dfn (@) "value")
".")
(ix-float
(@ (ix-coord "(floset Figure 0)"))
(verbatim
(@ (xml:space "preserve"))
"KEY => VALUE")
(caption
(@)
"The association between a "
(var (@) "key")
" and a "
(var (@) "value")
"."))
(para (@)
"A key may appear only once in an array; it is unique.
A value may appear any number of times. For example:")
(ix-float
(@ (ix-coord "(floset Figure 1)"))
(verbatim
(@ (xml:space "preserve"))
"A => 5
B => 4
C => 4
D => 2")
(caption
(@)
"An example associative array, with four
associations,showing unique keys ("
(code (@) "A")
", "
(code (@) "B")
", "
(code (@) "C")
", "
(code (@) "D")
")and non-unique values ("
(code (@) "5")
", "
(code (@) "4")
", "
(code (@) "2")
")."))
(para (@)
(ix-indexterm (@ (ix-coord "(dts cp 1)")))
(ix-indexterm (@ (ix-coord "(dts cp 9)")))
(ix-indexterm (@ (ix-coord "(dts cp 22)")))
(ix-indexterm (@ (ix-coord "(dts cp 14)")))
" Other names for associative array are: alist,
dictionary, ordered-map, hash table.")))
(tableitem
(@)
(tableterm (@) "look up")
(ix-indexterm (@ (ix-coord "(dts cp 20)")))
(item (@)
(para (@)
(ix-indexterm (@ (ix-coord "(dts cp 6)")))
"You "
(dfn (@) "look up")
" information from an associative array, specifying the
key and obtaining as a result the associated value, or the boolean value "
(code (@) "false")
" if there is no such key. ("
(strong (@) "NB")
": The file format never makes use of boolean values,
so there is no risk of confusion.)"))))))
I believe this kind of development implies changes to the DTD, of which i am mostly ignorant. Any hints on how to proceed? The bigger question is whether or not dedup is desirable, i suppose. To me the answer seems yes, but before i continue this line of hacking, i request confirmation. -- Thien-Thi Nguyen ..................................... GPG key: 4C807502 . NB: ttn at glug dot org is not me . . (and has not been since 2007 or so) . . ACCEPT NO SUBSTITUTES . ........... please send technical questions to mailing lists ...........
pgpeI1bI1E5Yo.pgp
Description: PGP signature
