Hi!
Is there anything special when outputting XML from perl?
I am trying to submit an opensearch description document to A9 at http://a9.com/-/opensearch/ and it sais it could not find a "valid XML header in file" - although I successfully validated at feedvalidator.org.
My XML is utf-8 like this:
<?xml version="1.0" encoding="UTF-8"?>
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/">
...
</OpenSearchDescription>
and I remember that printing text this way:
print "Content-Type: application/opensearchdescription+xml\n\n";
print $xmlstuff;
does not really output binary data ("XML is binary data that happens to look like text"). My only idea left is that the print content is not really properly binary encoded data as I just printed it and treated it like text before. Now, how can I add the first magic XML byte on my output. Something like print binmode($xmlstuff); or something with pack??
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.