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?

In reply to Re: HTTP Post of XML data by hallikpapa
in thread HTTP Post of XML data by hallikpapa

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.