Subject: | Dashes in element names break class generation |
I tried to use XML::Pastor on an XSD provided by a customer. When trying to create classes for this XSD, I receive errors, caused by the dash in the names of XML elements.
In offline mode, when trying to use the base class:
use Exporter::Format::Customer1
Compile error: Can't locate Exporter/Format/Customer1/INH.pm
this is, because the created code line looks like this:
use Exporter::Format::Customer1::INH-TYP;
In eval mode, I get syntax errors:
syntax error at (eval 338) line 91, near "#================================================================
package Exporter::Format::Customer1::Type::ANH-"
I think, the correct fix is to rewrite any characters that are valid XML element names, but invalid Perl class names.