Yeah, that's as good as it gets. ProjectLoader/Saver deal with multi-file 
projects. If you need to modidy a single existing DataMap, XMLEncoder is what 
you need.

Andrus

> On Sep 6, 2020, at 12:25 PM, Hugi Thordarson <h...@karlmenn.is> wrote:
> 
> Well that's no fun when you have this nice purpose-build API right at your 
> hands :).
> I ended up doping the encodeAsXML-thing. It worked well enough that it only 
> took a couple of seconds to fix up the resulting XML file, et voila — 250 new 
> attributes in 50 entities :).
> 
> Cheers,
> - hugi
> 
> 
>> On 5 Sep 2020, at 14:11, Michael Gentry <blackn...@gmail.com> wrote:
>> 
>> I'm naive enough that I'd just use a macro in Emacs to modify the mapping...
>> 
>> 
>> On Sat, Sep 5, 2020 at 5:14 AM Hugi Thordarson <h...@karlmenn.is> wrote:
>> 
>>> Hi all,
>>> I'm adding some standard attributes to a few dozen tables. Since they all
>>> look more or less the same, I'd like to do it programmatically.
>>> That's easy enough, but I'm wondering what the best way would be for me to
>>> write out the project after adding the attributes.
>>> 
>>> I've currently got something like:
>>> 
>>> XMLEncoder encoder = new XMLEncoder( new PrintWriter( new File(
>>> "new.map.xml" ) ) );
>>> map.encodeAsXML( encoder, new EmptyConfigurationNodeVisitor() );
>>> 
>>> …which works kinda-sorta. But I imagine there's a better or more idiomatic
>>> way using something like ProjectLoader or ProjectSaver?
>>> 
>>> Cheers,
>>> - hugi
> 

Reply via email to