that works for & but it won't work for <,>,',"
regex are: $text =~ s/&(?!amp|quot|apos|lt|gt)/!38/g; $text =~ s/"(?!amp|quot|apos|lt|gt)/!34/g; $text =~ s/<(?!amp|quot|apos|lt|gt)/!40/g; $text =~ s/>(?!amp|quot|apos|lt|gt)/!41/g; $text =~ s/'(?!amp|quot|apos|lt|gt)/!39/g;
when i run that on my xml i get:
!40?xml version=!341.0!34 encoding=!34UTF-8!34?!41 !40TRANSACTION!41 !40FIELDS!41 !40FIELD KEY=!34user!34!41name!40/FIELD!41 !40FIELD KEY=!34password!34!41pass!38word!40/FIELD!41 !40FIELD KEY=!34operation_type!34!41!40do_what!41!40/FIELD!41 !40/FIELDS!41 !40/TRANSACTION!41
so i am still in the same spot i need to be able to only manipulate the data in between > <

thanks again for your help

In reply to Re: Re: Re: parsing reserved chars with xml::simple by bear0053
in thread parsing reserved chars with xml::simple by bear0053

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.