Well after looking around and talking to the java guy, I have found that the closing tag I am trying to send is incorrect. The XML::Writer wanted me to close the tag exactly the same way I opened it, so I put the whole
$writer->endTag("manager xmlns:xsi=http://www.w3.org/2001/XMLSchema-in
+stance");
I need to just close it with:
$writer->startTag("manager xmlns:xsi=http://www.w3.org/2001/XMLSchema-
+instance");
.....
....
....
$writer->endTag("manager");
$writer->end;
But it is failing. In the documentation it states:
NAMESPACES
A true (1) or false (0, undef) value; if this parameter is present
+ and its value is true, then the module will accept two-member array
+reference in the place of element and attribute names, as in the foll
+owing example:
my $rdfns = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
my $writer = new XML::Writer(NAMESPACES => 1);
$writer->startTag([$rdfns, "Description"]);
The first member of the array is a namespace URI, and the second p
+art is the local part of a qualified name. The module will automatica
+lly generate appropriate namespace declarations and will replace the
+URI part with a prefix.
I was trying something like this:
my $rdfns = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
my $writer = new XML::Writer(OUTPUT => \$output, NAMESPACES => 1);
$writer->startTag([$rdfns, "Description"]);
$writer->startTag("greeting",
"class" => "simple");
$writer->characters("Hello, world!");
$writer->endTag("greeting");
$writer->endTag("Description");
$writer->end();
print $output;
But I get:
Attempt to end element "ARRAY(0x814ec28)" with "Description" tag, when I don't have NAMESPACES => 1, and when I do add it, I get something similar:
Attempt to end element "__NS1:Description" with "Description" tag
Any leads Monks?
|