× 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.



This single quote/apostrophe was the issue in my case. The normal one
worked fine, but there are two others (right and left facing) that don't
have EBCDIC values that I could see, which is why the SAX-XML parser would
fail.

But, reading the data as UCS2 and using %char() didn't throw any errors
that I found yet.

I did talk with the trading partner about escaping all single quotes to
' but they said that would be "too much work".

So yet again, the wonderful "standards" (well, more like "suggestions") of
XML, as I've seen, are different with each and every project I work on.
Yay! :)

Brad
www.bvstools.com

On Wed, Dec 9, 2015 at 2:22 PM, Buck Calabro <kc2hiz@xxxxxxxxx> wrote:

On 12/9/2015 3:05 PM, Koester, Michael wrote:
On the subject of special characters and XML, I found that the
"less-than" (<) character doesn't always play nice. I have a need to send
a password change to a API provided by an ISP. While not specifically
excluded by their "characters not permitted" docs, I found that < does bad
things in transit. So I added it to *our* list of characters not
permitted, and coded an edit to deny it on input.

There are some characters that need special consideration in XML:

begin cite

The ampersand character (&) and the left angle bracket (<) MUST NOT
appear in their literal form, except when used as markup delimiters, or
within a comment, a processing instruction, or a CDATA section. If they
are needed elsewhere, they MUST be escaped using either numeric
character references or the strings "&amp;" and "&lt;" respectively. The
right angle bracket (>) may be represented using the string "&gt;", and
MUST, for compatibility, be escaped using either "&gt;" or a character
reference when it appears in the string "]]>" in content, when that
string is not marking the end of a CDATA section.

In the content of elements, character data is any string of characters
which does not contain the start-delimiter of any markup or the
CDATA-section-close delimiter, "]]>". In a CDATA section, character data
is any string of characters not including the CDATA-section-close
delimiter.

To allow attribute values to contain both single and double quotes, the
apostrophe or single-quote character (') may be represented as "&apos;",
and the double-quote character (") as "&quot;".

end cite

http://www.w3.org/TR/xml11/#dt-chardata

--
--buck

Visit wiki.midrange.com and register for an account. Edit a page that
helps you, and because it's public, you'll help someone else, too!

--
This is the RPG programming on the IBM i (AS/400 and iSeries) (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.



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.