Managing the Configuration
Now that we’ve had a tour of the components and have an idea what sorts of configurations are possible, you may be wondering whether there’s a way to retain some sort of overview of the actual XML. Dropping component instance definitions in and out of the configuration file is somewhat tedious, and certainly when editing such a large file, it’s not difficult to lose sense of direction and comment out or edit the wrong section.
Help is at hand, in the form of the
<jabberd:include/>
tag. This tag comes from the same stable as
<jabberd:cmdline/>
and provides the Jabber server administrator with ways to better manage
the XML configuration.
The contents of a file specified with the
<jabberd:include/>
tag are imported (included) in the position that the
<jabberd:include/>
tag occupies. Depending on what the root tag in the file to be included
is, the import is done in one of two ways:
If the root tag matches the parent tag of
<jabberd:include/>, the contents of the file minus the root tag are included.If the root tag does not match the parent tag of
<jabberd:include/>, then the entire contents of the file are included.
For example, if we have a section like this in the jabber.xml file:
...
<conference xmlns="jabber:config:conference">
<public/>
<vCard>
<FN>yak Chatrooms</FN>
<DESC>This is a public chatroom service.</DESC>
<URL>http://yak/chat</URL>
</vCard>
...
<jabberd:include>./rooms.xml</jabberd:include>
</conference>
...
and the content of ./rooms.xml ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access