Before you start messing with XML itself, you might want to see what we do in 
Hibernate 2L.

We first load the XML configuration [1], and using the 
ConfigurationBuilderHolder we can swap cache configurations, we can tweak 
them...etc, and eventually we create a cache manager out of that.

From the tweaked configuration, you could potentiallt chuck out XML. That's a 
better approach IMO than using XPath or similar tech.

Cheers,

[1] 
https://github.com/infinispan/infinispan/blob/master/hibernate-cache/src/main/java/org/infinispan/hibernate/cache/InfinispanRegionFactory.java#L547

> On 28 Aug 2017, at 13:41, Sebastian Laskawiec <slask...@redhat.com> wrote:
> 
> Hey,
> 
> Our cloud integration bits require a tool for adjusting the configuration for 
> certain use cases. A common example would be - take this `cloud.xml` file, 
> remove all caches, add a new, replicated cache as default one.
> 
> The tool should take either configuration or a file name as input (e.g. 
> `config-tool --add-default-cache -f cloud.xml` or `cat cloud.xml | 
> config-tool --add-default-cache > cloud-new.xml`) and print out configuration 
> either to System Out or to a file.
> 
> Do you have any ideas what could I use to write such a tool? Those 
> technologies come into my mind:
>       • Perl
>       • Python
>       • Java (probably with some XPath library)
> Thoughts? Ideas? Recommendations?
> 
> Thanks,
> Sebastian
> -- 
> SEBASTIAN ŁASKAWIEC
> INFINISPAN DEVELOPER
> Red Hat EMEA
> 
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev

--
Galder Zamarreño
Infinispan, Red Hat


_______________________________________________
infinispan-dev mailing list
infinispan-dev@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/infinispan-dev

Reply via email to