× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Vern,

I can deliever the same in JSON

clearSrvPgm();
setContent('text/javascript');
jsonNode('*object');
jsonNode('*array':'detail');
jsonNode('*string':'solution':'Your solution: &27; or %27; or %27');
jsonNode('*string':'solution':'My solution: ''');
jsonEndNode();
jsonEndNode();
echoToClient();
return;

http://89.239.242.111:6382/pextcgiCOR/testvern3.pgm

On Tue, Jun 5, 2012 at 5:20 PM, Henrik Rützou <hr@xxxxxxxxxxxx> wrote:

David

in general CDATA is very seldom used and is actually constructed to be
able to send
binary data such as a PDF or TIFF file within the XML document and not to
be a workaround
for the few special characters in your XML

My best advise is to use one of the open source projects to construct your
XML. They
are there and they are used in thousands of programs that runs XML every
day without
problems and they are constructed based on many years of experience of
what the
"other end" accepts

On Tue, Jun 5, 2012 at 5:04 PM, David Baugh <davidb@xxxxxxxxxxxxxx> wrote:

Thanks everyone for the great info, and the links. My guess , as Scott
suggested, is that the provider does not support CDATA.

Thanks for confirming my perceptions.

-David

________________________________________
From: rpg400-l-bounces@xxxxxxxxxxxx [rpg400-l-bounces@xxxxxxxxxxxx] On
Behalf Of Henrik Rützou [hr@xxxxxxxxxxxx]
Sent: Tuesday, June 05, 2012 7:54 AM
To: RPG programming on the IBM i / System i
Subject: Re: reserved character in XML element value

But lets test it:

RPGLE code ...

clearSrvPgm();
setContent('');
echo('Your solution: &27 ;');
echo('<br>');
echo('My solution: &#39 ;');
echoToClient();
return;

The result:

http://89.239.242.111:6382/pextcgiCOR/testvern.pgm

On Tue, Jun 5, 2012 at 4:40 PM, Henrik Rützou <hr@xxxxxxxxxxxx> wrote:

No Vern,

%27 is the same as &#39

The first is an escaped char the second is an character entity


On Tue, Jun 5, 2012 at 4:33 PM, Vern Hamberg <vhamberg@xxxxxxxxxxx>
wrote:

&27 - same as &#39 - hex and decimal

On 6/5/2012 8:48 AM, Henrik Rützou wrote:
&apos isn't and HTML entity and should be encoded as&#39

Most browsers does recognize and render&apos but you may experience
problems in javascript



On Tue, Jun 5, 2012 at 3:00 PM, Vern Hamberg<vhamberg@xxxxxxxxxxx>
wrote:

I think this discussion has made a little sense out of something in
one
of our products - I had to HTML-encode things like apostrophes
-&apos
did not always work - had to use&27, as I recall.

Now I just saw a site that differentiated HTML-encoding vs
XML-encoding
- the former has only 4 reserved characters, the latter has 5. The
5th
one is&apos - not part of HTML, therefore, not consistently
rendered,
IME.

Nice!!

On 6/5/2012 4:05 AM, Larry Ducie wrote:
Hi David,


Firstly, the parser should not parse the content of a CDATA block.
That
doesn't mean it wont though. You are at the mercy of the
implementation and
they are not all standard. Anybody who has had to talk to many SOAP
servers
learns this lesson quickly.
See http://www.w3schools.com/xml/xml_cdata.asp for some details
confirming your belief.
Secondly, when escaping entities yourself there are a few
characters
to
watch out for - not just the ampersand (&):
Certain characters are reserved because they form the structure of
the
markup language. they are<>'".
To escape them they are replaced by representations:

< goes to&lt;
goes to&gt;
' goes to&apos;
" goes to&quot;

Because the escaped representations begin with an ampersand (&)
that
character is now also reserved! So we have to escape it too:
& goes to&amp;

If you want to escape the characters yourself NEVER escape the
ampersand
last because escaping all the others introduces new ampersands into
the
markup and you want to leave those ones alone.
Finally, why work this out yourself? Use an open source tool to do
this.
Henrik has built a good one, and you can download mine at
http://sourceforge.net/projects/xmli/files/ They're free and much
used.

Cheers

Larry Ducie

--
This is the RPG programming on the IBM i / System i (RPG400-L)
mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




--
Regards,
Henrik Rützou

http://powerEXT.com <http://powerext.com/>





--
Regards,
Henrik Rützou

http://powerEXT.com <http://powerext.com/>
--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

--
This is the RPG programming on the IBM i / System i (RPG400-L) mailing
list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.




--
Regards,
Henrik Rützou

http://powerEXT.com <http://powerext.com/>






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.