Hello Monks,
I have a script accepting XML input through STDIN.
$xmlPayload = do { local $/; <STDIN> };
`echo "$xmlPayload" >> /temp/MyLog.log`;
the initial XML looks like this:
<param name="assignedgroup">fraud</param>
<param name="assigneduser">username</param>
<param name="severity">minor</param>
<param name="title">Bad Fraud Thing</param>
but when this same input is taken in through STDIN it ends up like this:
<param name=assignedgroup>fraud</param>
<param name=assigneduser>username</param>
<param name=severity>minor</param>
<param name=title>Bad Fraud Thing</param>
you can see the double quotes are stripped. I'm not sure where this is happening at. I take it in through STDIN and just echo out to a file and the double quotes are gone. I've taken this same input and passed it to a Python script and verified the double quotes are present in the same output file. So the only thing I can come up with is STDIN is stripping it.
is this a known issue? are there arguments to stop it from stripping the double quotes?
thanks!
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.