On 04/29/2016 03:33 AM, Dave Pawson wrote:
> Can anyone recall why attribute value defaulting was dropped
> when XML was created?
>
> Does it seem 'useful' to anyone now?
As Simon pointed out, attribute default values are in XML. However, the
facility is provided via the DTD, which is optional, and if you parse an
instance without reference to the DTD, you won’t get the default values...
Partly (as someone else noted), this was based on our experience at EBT
— the DynaText parser was perfectly capable of parsing SGML without a
DTD (as long as there was no tag omission), and the stylesheet would
typically encode behavior implied by default attributes, whether or not
the default values were explicit in the parse. (And in fact, for some
document types, the default attributes could bloat the size of the
compiled book.)
This is harder for arch forms; the application (XSLT or whatever else)
becomes the agent of architectural mapping, rather than it being a
property of the document, but I think that might be OK, too. Consider a
meta-doctype, and rather than me writing a DTD that maps my doctype to
your meta-doctype, I write an XSLT that annotates or transforms mine.
That’s no worse than the DTD approach, IMO, and by separating the parse
from the annotation, might be better.
~Chris
--
Chris Maden, text nerd <URL: http://crism.maden.org/ >
“If you’ve been a man o’ action, though you’re lying there in traction,
You will gain some satisfaction thinkin’, ‘Jesus, at least I tried.’”
— Andy M. Stewart (1952–2015), “Ramblin’ Rover”