> What does XBX stand for? It seems like a pretty unintuitive name to me,
> and doesn't tell me anything about what the module does.
>
It stands for XML By eXample. The reason behind that name: the
configuration file for parsing the XML document into a perl data structure
is structurally identicial to the XML that needs to be parsed, in other
words, the module looks at an example to figure out what to do with the
data. Here is very simple example:
XML that we want to parse:
<?xml version="1.0"?>
<data>
<person>
<name>John</name>
<age>26</age>
<address1>123 Main Street</address1>
<city>San Jose</city>
<state>California</state>
<country>US</country>
</person>
...
</data>
Data structure that we want to parse it into:
$VAR = {
name => 'John',
age => 26,
address => {
address1 => '123 Main Street',
city => 'San Jose',
state => 'California',
country => 'US'
}
}
You could would use a configuration file like this:
<?xml version="1.0"?>
<xbx version="1.0">
<data>
<person>
<name>name</name>
<age>age</age>
<address1>address:address1</address1>
<city>address:city</city>
<state>address:state</state>
<country>address:country</country>
</person>
</data>
</xbx>
As you can see, with the exception of the <xbx> tags, the configuration is
identical in strucuture to the XML document we want to process. Does this
make sense?
I am of course open to suggestions :)
Pasha