[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reserved character in XML element value



   http_Escapexml will do the job - but is 5 times as CPU consuming that
   encodeXML

   in powerEXT Core that handles node data up to 65535 bytes
   On Tue, Jun 5, 2012 at 7:39 PM, Jim Bostwick
   <[1]jlbostwick@xxxxxxxxxxxxxxxxxx> wrote:

     You could try using the http_EscapeXml procedure in
     httpapi.....works with
     strings up to 4k...
     Jim Bostwick
     Reliable Credit Association, Inc
     [2](503) 462-3049

   -----Original Message-----
   From: [3]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   [mailto:[4]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of

     [5]ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx
     Sent: Tuesday, June 05, 2012 10:00 AM
     To: [6]ftpapi@xxxxxxxxxxxxxxxxxxxxxx
     Subject: Ftpapi Digest, Vol 72, Issue 4
     Send Ftpapi mailing list submissions to
     � � � �[7]ftpapi@xxxxxxxxxxxxxxxxxxxxxx
     To subscribe or unsubscribe via the World Wide Web, visit
     � � � �[8]http://www.scottklement.com/mailman/listinfo/ftpapi
     or, via email, send a message with subject or body 'help' to
     � � � �[9]ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx
     You can reach the person managing the list at
     � � � �[10]ftpapi-owner@xxxxxxxxxxxxxxxxxxxxxx
     When replying, please edit your Subject line so it is more specific
     than "Re: Contents of Ftpapi digest..."
     Today's Topics:
     � 1. reserved character in XML element value (David Baugh)
     � 2. RE: reserved character in XML element value (Mike Krebs)
     � 3. RE: reserved character in XML element value (David Baugh)
     � 4. Re: reserved character in XML element value (Scott Klement)
     � 5. Re: reserved character in XML element value (TC)
     --------------------------------------------------------------------
     --
     Message: 1
     Date: Mon, 4 Jun 2012 11:52:54 -0700
     From: David Baugh <[11]davidb@xxxxxxxxxxxxxx>

   Subject: reserved character in XML element value

     To: "[12]ftpapi@xxxxxxxxxxxxxxxxxxxxxx"
     <[13]ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
     Message-ID:
     <29C125F733BC634FAB4D87647B948F294875352A30@xxxxxxxxxxxxxxxxxxxxxxxx
     erdata.n
     et>
     Content-Type: text/plain; charset="us-ascii"

   Hello,
   I have a data item on file that I'm inserting into an element before
   posting
   it in a request. In this particular case, the data contains a '&' which
   is
   causing server's �parser to error out. I do have it wrapped in
   <![CDATA[
   ...]]>. Obviously I'm misunderstanding �this, since I thought
   occurrences of
   such �would be accepted if �inside this wrapper.
   Otherwise, am I correct in assuming that I'd need to search and replace
   any
   occurrences of this with &amp; before assignment?
   Thanks,
   David

     -------------- next part --------------

   � Hello,
   � I have a data item on file that I'm inserting into an element before
   � posting it in a request. In this particular case, the data contains
   a
   � `&' which is causing server's �parser to error out. I do have it
   � wrapped in <![CDATA[ �...]]>. Obviously I'm misunderstanding
   �this,
   � since I thought occurrences of such �would be accepted if �inside
   this
   � wrapper.
   � Otherwise, am I correct in assuming that I'd need to search and
   replace
   � any occurrences of this with &amp; before assignment?
   � Thanks,
   � David
   ------------------------------

     Message: 2
     Date: Mon, 4 Jun 2012 15:35:29 -0500
     From: Mike Krebs <[14]mkrebs@xxxxxxxxxxxxxxxxxx>
     Subject: RE: reserved character in XML element value
     To: HTTPAPI and FTPAPI Projects <[15]ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
     Message-ID:
     <[16]3DF08BA25872B644A1421B9F085B182991295BCD50@xxxxxxxxxxxx>
     Content-Type: text/plain; charset="us-ascii"

   I believe you are right (if contained in a CDATA section there is no
   need to
   escape &), but lest we get too far off subject, please ask this
   question on
   [17]midrange.com or similar.
   -----Original Message-----
   From: [18]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx

   [mailto:[19]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of David
   Baugh
   Sent: Monday, June 04, 2012 1:53 PM
   To: [20]ftpapi@xxxxxxxxxxxxxxxxxxxxxx
   Subject: reserved character in XML element value
   Hello,
   I have a data item on file that I'm inserting into an element before
   posting
   it in a request. In this particular case, the data contains a '&' which
   is
   causing server's �parser to error out. I do have it wrapped in
   <![CDATA[
   ...]]>. Obviously I'm misunderstanding �this, since I thought
   occurrences of
   such �would be accepted if �inside this wrapper.
   Otherwise, am I correct in assuming that I'd need to search and replace
   any
   occurrences of this with &amp; before assignment?
   Thanks,
   David
   ------------------------------

     Message: 3
     Date: Mon, 4 Jun 2012 14:39:38 -0700
     From: David Baugh <[21]davidb@xxxxxxxxxxxxxx>
     Subject: RE: reserved character in XML element value
     To: HTTPAPI and FTPAPI Projects <[22]ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
     Message-ID:
     <29C125F733BC634FAB4D87647B948F294875352B15@xxxxxxxxxxxxxxxxxxxxxxxx
     erdata.n
     et>
     Content-Type: text/plain; charset="us-ascii"

   Thanks Mike,
   OK I can see your point. My routine is largely based in httpapi-land,
   however there's an argument for digression. I sent it to
   [23]rpg400-l@xxxxxxxxxxxxx
   Regarding your point about not needing the escape, it is inside the
   wrapper
   but I get a parser error (confusing).
   I'd welcome any further insight over on the other forum...
   Thanks so much.
   David
   -----Original Message-----
   From: [24]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   [mailto:[25]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Mike
   Krebs
   Sent: Monday, June 04, 2012 1:35 PM
   To: HTTPAPI and FTPAPI Projects
   Subject: RE: reserved character in XML element value
   I believe you are right (if contained in a CDATA section there is no
   need to
   escape &), but lest we get too far off subject, please ask this
   question on
   [26]midrange.com or similar.
   -----Original Message-----
   From: [27]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx

   [mailto:[28]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of David
   Baugh
   Sent: Monday, June 04, 2012 1:53 PM
   To: [29]ftpapi@xxxxxxxxxxxxxxxxxxxxxx
   Subject: reserved character in XML element value
   Hello,
   I have a data item on file that I'm inserting into an element before
   posting
   it in a request. In this particular case, the data contains a '&' which
   is
   causing server's �parser to error out. I do have it wrapped in
   <![CDATA[
   ...]]>. Obviously I'm misunderstanding �this, since I thought
   occurrences of
   such �would be accepted if �inside this wrapper.
   Otherwise, am I correct in assuming that I'd need to search and replace
   any
   occurrences of this with &amp; before assignment?
   Thanks,
   David
   -----------------------------------------------------------------------
   This is the FTPAPI mailing list. �To unsubscribe, please go to:
   [30]http://www.scottklement.com/mailman/listinfo/ftpapi
   -----------------------------------------------------------------------
   ------------------------------

     Message: 4
     Date: Mon, 04 Jun 2012 19:43:43 -0400
     From: Scott Klement <[31]sk@xxxxxxxxxxxxxxxx>
     Subject: Re: reserved character in XML element value
     To: [32]ftpapi@xxxxxxxxxxxxxxxxxxxxxx
     Message-ID: <[33]4FCD482F.2020103@xxxxxxxxxxxxxxxx>
     Content-Type: text/plain; charset=ISO-8859-1; format=flowed

   Hi David,
   You're right, you should not have to escape the & character if it's
   within a <![CDATA[ wrapper.
   Unfortunately, not every XML parser supports CDATA (especially the very
   early ones) and if the server is using a home-grown XML interpreter,
   then all bets are off.
   Converting from & to &amp; should work anywhere/everywhere. �You
   should
   also change < to &lt;, and > to &gt;. �There are a few others that are
   recommended (though not necessarily required) as well.
   On 6/4/2012 2:52 PM, David Baugh wrote:

   > � � Hello,
   >
   >
   > � � I have a data item on file that I'm inserting into an element
   before
   > � � posting it in a request. In this particular case, the data
   contains a
   > � � `&' which is causing server's �parser to error out. I do have
   it
   > � � wrapped in<![CDATA[ �...]]>. Obviously I'm misunderstanding
   �this,
   > � � since I thought occurrences of such �would be accepted if
   �inside this
   > � � wrapper.
   >
   >
   > � � Otherwise, am I correct in assuming that I'd need to search and
   replace

   > � � any occurrences of this with&amp; before assignment?
   >
   >
   > � � Thanks,
   >
   >
   > � � David
   >
   ------------------------------

     Message: 5
     Date: Mon, 4 Jun 2012 15:46:12 -0400
     From: "TC" <[34]tcrook57@xxxxxxxxx>
     Subject: Re: reserved character in XML element value
     To: "HTTPAPI and FTPAPI Projects"
     <[35]ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
     Message-ID: <E213C1FA48764C0E9369DDD36E454DEF@TCrookPC>
     Content-Type: text/plain; format=flowed; charset="iso-8859-1";
     � � � �reply-type=original

   Hi David,
   � I just went through this with setting up several XML applications on
   my
   clients systems. You have to replace it with the &amp. There are
   several
   characters along with the & that are "illegal" in XML, they are <, >,
   ', and
   ".
   I just did a routine in my XML document creation programs to replace
   the &
   with the + sign and passed that instead as my client wanted to retain
   the &
   in their name and address fields.
   Hope this helps,
   T Crook
   -----Original Message-----
   From: David Baugh
   Sent: Monday, June 04, 2012 2:52 PM
   To: [36]ftpapi@xxxxxxxxxxxxxxxxxxxxxx
   Subject: reserved character in XML element value
   Hello,
   I have a data item on file that I'm inserting into an element before
   posting
   it in a request. In this particular case, the data contains a '&' which
   is
   causing server's �parser to error out. I do have it wrapped in
   <![CDATA[
   ...]]>. Obviously I'm misunderstanding �this, since I thought
   occurrences of
   such �would be accepted if �inside this wrapper.
   Otherwise, am I correct in assuming that I'd need to search and replace
   any
   occurrences of this with &amp; before assignment?
   Thanks,
   David
   -----------------------------------------------------------------------
   This is the FTPAPI mailing list. �To unsubscribe, please go to:
   [37]http://www.scottklement.com/mailman/listinfo/ftpapi
   -----------------------------------------------------------------------
   ------------------------------
   -----------------------------------------------------------------------

     This is the FTPAPI mailing list digest. �To unsubscribe, go to:
     [38]http://www.scottklement.com/mailman/listinfo/ftpapi
     --------------------------------------------------------------------
     ---
     End of Ftpapi Digest, Vol 72, Issue 4
     *************************************

   -----------------------------------------------------------------------
   This is the FTPAPI mailing list. �To unsubscribe, please go to:
   [39]http://www.scottklement.com/mailman/listinfo/ftpapi
   -----------------------------------------------------------------------

   --
   Regards,
   Henrik Rützou
   �   [40]http://powerEXT.com
   �   [plogofull200.png]

References

   1. mailto:jlbostwick@xxxxxxxxxxxxxxxxxx
   2. tel:%28503%29%20462-3049
   3. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   4. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
   5. mailto:ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx
   6. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
   7. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
   8. http://www.scottklement.com/mailman/listinfo/ftpapi
   9. mailto:ftpapi-request@xxxxxxxxxxxxxxxxxxxxxx
  10. mailto:ftpapi-owner@xxxxxxxxxxxxxxxxxxxxxx
  11. mailto:davidb@xxxxxxxxxxxxxx
  12. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
  13. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
  14. mailto:mkrebs@xxxxxxxxxxxxxxxxxx
  15. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
  16. mailto:3DF08BA25872B644A1421B9F085B182991295BCD50@xxxxxxxxxxxx
  17. http://midrange.com/
  18. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
  19. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
  20. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
  21. mailto:davidb@xxxxxxxxxxxxxx
  22. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
  23. mailto:rpg400-l@xxxxxxxxxxxx
  24. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
  25. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
  26. http://midrange.com/
  27. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
  28. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
  29. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
  30. http://www.scottklement.com/mailman/listinfo/ftpapi
  31. mailto:sk@xxxxxxxxxxxxxxxx
  32. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
  33. mailto:4FCD482F.2020103@xxxxxxxxxxxxxxxx
  34. mailto:tcrook57@xxxxxxxxx
  35. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
  36. mailto:ftpapi@xxxxxxxxxxxxxxxxxxxxxx
  37. http://www.scottklement.com/mailman/listinfo/ftpapi
  38. http://www.scottklement.com/mailman/listinfo/ftpapi
  39. http://www.scottklement.com/mailman/listinfo/ftpapi
  40. http://powerext.com/
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------