On 18 December 2012 09:05, Colin McCabe <cmcc...@alumni.cmu.edu> wrote:

>
> I think the way to go is to have one XML file include another.
>
> <?xml version="1.0"?>
> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?>
> <configuration xmlns:xi="http://www.w3.org/2001/XInclude";>
>   <property>
>      <name>boring.config.1</name>
>      <value>boring-value</value>
>      ... etc, etc...
>   <xi:include href="../secret-stuff.xml" />
> </configuration>
>
> That way, you can keep the boring configuration under version control,
> and still have your password sitting in a small separate
> non-version-controlled XML file.
>
> We use this trick a bunch with the HA configuration stuff-- 99% of the
> configuration is the same between the Active and Standby Namenodes,
> but you can't give them the same dfs.ha.namenode.id or dfs.name.dir.
> Includes help a lot here.
>
> I like this approach -we could even have xi:fallback within the include
element to say "include this other file if nothing is checked in".

the default, checked in, -site.xml could then go

<xi:include href="../custom-stuff.xml><xi:fallback href="../empty.xml"
/></xi:include>

I'll try this on my tests to see how well it holds up, because if it does
work it is something to consider checking in. (Yes, I know xinclude isn't
there 100% of the time client side, but that's not going to happen on test
runs - https://issues.apache.org/jira/browse/HADOOP-5254 )

Reply via email to