Subject: | Incorrect looking documentation |
The page http://search.cpan.org/~bholzman/XML-Generator-0.98/Generator.pm
says what is quoted below.
The XML in the first example does not have the contents element in the wru namespace as is implied by the narative. Namespaces do not inherit like that.
Is the example wrong?
David
<<END_OF_QUOTE
$xml = $gen->widget(['wru' => 'http://www.widgets-r-us.com/xml/'],
{'id' => 123}, $gen->contents());
<wru:widget xmlns:wru="http://www.widgets-r-us.com/xml/" wru:id="123">
<contents />
</wru:widget>
Note that the wru: prefix is inherited, so the contents tag above is semantically equivalent to
<wru:contents />
If you actually mean
<contents xmlns="" />
then you have to say:
$gen->contents([undef]);
END_OF_QUOTE