[
Lists Home |
Date Index |
Thread Index
]
Bullard, Claude L (Len) schrieb:
>This one is fun. I know that a validating editor
>can use a schema or DTD to create a valid file.
>
>Can a program do this for files it creates dynamically?
>Are there examples of this?
>
does she code lisp?
if so, one way to do it is with a method combination for generic
function-based implementation of the serialization mechanism. the method
combination implementation uses the type of the data instance to be
encoded and the content specification of the target-encoding to write
the requisite effective encoding method on-the-fly. the runtime cost is
rather low, as the effective methods is generated once and compiled. the
only necessary overhead is one level of function invocation compared to
hand-coded in-line generation, but that's minor.
i recall reading about efforts in a similar direction in haskell, but my
knowledge of that is just second-hand.
...
>
>This question came from a programmer who doesn't want
>to hardwire the structure of files she creates into
>the code that creates them. I had replied with validation
>on input (create the file, validate it then), and what
>she actually wants to do is use the schema to drive
>the file builder using say, SAX or its analog. Mainly,
>she doesn't want to rewrite the code when new versions
>of the document inevitably occurs. She just wants to
>modify the schema. Works for editors but of course,
>they run in human time, but other than performance, I
>can't think of a reason WHY she couldn't do it.
>
>What about it?
>
>len
>
>-----------------------------------------------------------------
>The xml-dev list is sponsored by XML.org <http://www.xml.org>, an
>initiative of OASIS <http://www.oasis-open.org>
>
>The list archives are at http://lists.xml.org/archives/xml-dev/
>
>To subscribe or unsubscribe from this list use the subscription
>manager: <http://www.oasis-open.org/mlmanage/index.php>
>
>
>
>
|