XML/Output: Difference between revisions

→‎{{header|REXX}}: made REXX entry compitable to older REXXes. -- ~~~~
m (→‎{{header|REXX}}: adjusted a DO-loop indentation. -- ~~~~)
(→‎{{header|REXX}}: made REXX entry compitable to older REXXes. -- ~~~~)
Line 1,486:
=={{header|REXX}}==
REXX doesn't have any functions to handle XML entities, an abbreviated version is included here.
<br>Some older REXXes don't have the '''changestr''' bif, so that is included here as a subroutine.
<lang rexx>/*REXX program to create a list of character names & remarks. */
charname.=
Line 1,694 ⟶ 1,695:
if a then x=xml_(?,"amp") /*if we had an ampersand, translate it now.*/
if b then x=xml_(??,"semi") /*if we had a semicolon, translate it now.*/
return x</lang>
/*───────────────────────────CHANGESTR subroutine───────────────────────*/
changestr: procedure; parse arg o,h,n; r=; w=length(o); if w==0 then return n||h
do forever; parse var h y (o) _ +(w) h; if _=='' then return r||y; r=r||y||n; end</lang>
'''output'''
<pre style="overflow:scroll">