fionbarr has asked for the wisdom of the Perl Monks concerning the following question:

is there any difference between: $xml_writer->dataElement( "IncidentNumber" => 1 ); and $xml_writer->dataElement( "IncidentNumber" => "1"); ?

Replies are listed 'Best First'.
Re: xml_writer dataElement
by choroba (Cardinal) on May 20, 2013 at 16:46 UTC
    No. The number versus string distinction does not exist in XML, everything is a string.
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      thanks...I ask because the XSD file looks like:
      <sx:element name="Sample0" type = "sx:string"/> and <sx:element name="Sample1" type = "sx:unsignedshort"/>
        That is a different story. Both 1 as a string and 1 as an unsignedshort look the same in the XML, and that's what XML::Writer cares about.
        لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ