in reply to HTTP Post of XML data
I need to just close it with:$writer->endTag("manager xmlns:xsi=http://www.w3.org/2001/XMLSchema-in +stance");
But it is failing. In the documentation it states:$writer->startTag("manager xmlns:xsi=http://www.w3.org/2001/XMLSchema- +instance"); ..... .... .... $writer->endTag("manager"); $writer->end;
I was trying something like this: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.
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?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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: HTTP Post of XML data
by hallikpapa (Scribe) on Nov 14, 2007 at 20:50 UTC |