On Aug 28, 5:04 pm, Troy Cauble <t...@alcatel-lucent.com> wrote:
> You could have optional id and ref elements.
>
> <action id='myUniqueId'>blah....</action>
> ...
> <action ref='myUniqueId'/>
>
> with documentation saying to use a ref attribute *OR* content.
> Better than documentation is something you can validate
> with DTD/XML Schema/whatever. Such as
Thanks very much for your help. Is this what you had in mind?
<actiondefs>
<action id='oftendone'>
.
. ...often done in any situation...
.
</action>
..
..
..
</actiondefs>
..
..
..
<situation> something </situation>
<action> action specific to something </action>
<action ref='oftendone'/>
<situation> something else </situation>
<action> action specific to something else</action>
<action> ref='oftendone'/>
..
..
..
I guess this is the "weak" implementation of your suggestion.
The "strong" version, with validation by schemas and such, I
don't think I need for the task in question. A colleague was
editing huge amounts of SQL, much of which is boilerplate, and
asked me to devise a way to generate the SQL instead from some
kind of dialogue. What I'm going to propose instead is that she
still edit a file, but in place of the SQL itself, it will be
a template for recording only the salient information. I'll
write a Perl script to parse it and generate the SQL. In pondering
how to deal with the duplicated data, I started thinking of how
to represent it by reference...and realized that I was about to
reinvent XML -- so why not use the real thing? Still, by keeping
the XML constructs to a minimum, I shouldn't need an XML parser.
My apologies for crossposting to comp.lang.perl.modules,
incidentally. I checked first and found other queries about XML
therein, and the XML newsgroup has such low traffic I was
afraid I'd be waiting too long for a response.
--
Charles Packer
http://cpacker.org/whatnews
mailboxATcpacker.org