1 | MXMLUTL ;mjk/alb - MXML Build Utilities ;12/11/2002 15:30
|
---|
2 | ;;7.3;TOOLKIT;**67**;Apr 25, 1995
|
---|
3 | QUIT
|
---|
4 | ;
|
---|
5 | XMLHDR() ; -- provides current XML standard header
|
---|
6 | QUIT "<?xml version=""1.0"" encoding=""utf-8"" ?>"
|
---|
7 | ;
|
---|
8 | SYMENC(STR) ; -- replace reserved xml symbols with their encoding.
|
---|
9 | N A,I,X,Y,Z,NEWSTR,QT
|
---|
10 | S (Y,Z)="",QT=""""
|
---|
11 | I STR["&" S NEWSTR=STR D S STR=Y_Z
|
---|
12 | . F X=1:1 S Y=Y_$PIECE(NEWSTR,"&",X)_"&",Z=$PIECE(STR,"&",X+1,999) Q:Z'["&"
|
---|
13 | I STR["<" F S STR=$PIECE(STR,"<",1)_"<"_$PIECE(STR,"<",2,99) Q:STR'["<"
|
---|
14 | I STR[">" F S STR=$PIECE(STR,">",1)_">"_$PIECE(STR,">",2,99) Q:STR'[">"
|
---|
15 | I STR["'" F S STR=$PIECE(STR,"'",1)_"'"_$PIECE(STR,"'",2,99) Q:STR'["'"
|
---|
16 | I STR[QT F S STR=$PIECE(STR,QT,1)_"""_$PIECE(STR,QT,2,99) Q:STR'[QT
|
---|
17 | ;
|
---|
18 | F I=1:1:$L(STR) D
|
---|
19 | . S X=$E(STR,I)
|
---|
20 | . S A=$A(X)
|
---|
21 | . IF A<31 S STR=$P(STR,X,1)_$P(STR,X,2,99)
|
---|
22 | Q STR
|
---|
23 | ;
|
---|