broke GPLXPATH into two files to be under 20K per SAC .. put test cases in GPLXPAT0.m
This commit is contained in:
parent
5dacc10cfa
commit
a4cb658edf
|
@ -0,0 +1,192 @@
|
|||
GPLXPAT0 ; CCDCCR/GPL - XPATH TEST CASES ; 6/1/08
|
||||
;;0.2;CCDCCR;nopatch;noreleasedate
|
||||
;Copyright 2008 WorldVistA. Licensed under the terms of the GNU
|
||||
;General Public License See attached copy of the License.
|
||||
;
|
||||
;This program is free software; you can redistribute it and/or modify
|
||||
;it under the terms of the GNU General Public License as published by
|
||||
;the Free Software Foundation; either version 2 of the License, or
|
||||
;(at your option) any later version.
|
||||
;
|
||||
;This program is distributed in the hope that it will be useful,
|
||||
;but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
;GNU General Public License for more details.
|
||||
;
|
||||
;You should have received a copy of the GNU General Public License along
|
||||
;with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
;
|
||||
W "NO ENTRY",!
|
||||
Q
|
||||
;
|
||||
;;><TEST>
|
||||
;;><INIT>
|
||||
;;>>>K GPL S GPL=""
|
||||
;;>>>D PUSH^GPLXPATH("GPL","FIRST")
|
||||
;;>>>D PUSH^GPLXPATH("GPL","SECOND")
|
||||
;;>>>D PUSH^GPLXPATH("GPL","THIRD")
|
||||
;;>>>D PUSH^GPLXPATH("GPL","FOURTH")
|
||||
;;>>?GPL(0)=4
|
||||
;;><INITXML>
|
||||
;;>>>K GXML S GXML=""
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<FIRST>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<THIRD>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<FOURTH>@@DATA1@@</FOURTH>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<FIFTH>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","@@DATA2@@")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</FIFTH>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<SIXTH ID=""SELF"" />")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</THIRD>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</FIRST>")
|
||||
;;><INITXML2>
|
||||
;;>>>K GXML S GXML=""
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<FIRST>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<THIRD>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<FOURTH>DATA1</FOURTH>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<FOURTH>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","DATA2")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</FOURTH>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</THIRD>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<_SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<FOURTH>DATA3</FOURTH>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</_SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</FIRST>")
|
||||
;;><PUSHPOP>
|
||||
;;>>>D ZLOAD^GPLUNIT("ZTMP","GPLXPAT0")
|
||||
;;>>>D ZTEST^GPLUNIT(.ZTMP,"INIT")
|
||||
;;>>?GPL(GPL(0))="FOURTH"
|
||||
;;>>>D POP^GPLXPATH("GPL",.GX)
|
||||
;;>>?GX="FOURTH"
|
||||
;;>>?GPL(GPL(0))="THIRD"
|
||||
;;>>>D POP^GPLXPATH("GPL",.GX)
|
||||
;;>>?GX="THIRD"
|
||||
;;>>?GPL(GPL(0))="SECOND"
|
||||
;;><MKMDX>
|
||||
;;>>>D ZLOAD^GPLUNIT("ZTMP","GPLXPAT0")
|
||||
;;>>>D ZTEST^GPLUNIT(.ZTMP,"INIT")
|
||||
;;>>>S GX=""
|
||||
;;>>>D MKMDX^GPLXPATH("GPL",.GX)
|
||||
;;>>?GX="//FIRST/SECOND/THIRD/FOURTH"
|
||||
;;><XNAME>
|
||||
;;>>?$$XNAME^GPLXPATH("<FOURTH>DATA1</FOURTH>")="FOURTH"
|
||||
;;>>?$$XNAME^GPLXPATH("<SIXTH ID=""SELF"" />")="SIXTH"
|
||||
;;>>?$$XNAME^GPLXPATH("</THIRD>")="THIRD"
|
||||
;;><INDEX>
|
||||
;;>>>D ZLOAD^GPLUNIT("ZTMP","GPLXPAT0")
|
||||
;;>>>D ZTEST^GPLUNIT(.ZTMP,"INITXML")
|
||||
;;>>>D INDEX^GPLXPATH("GXML")
|
||||
;;>>?GXML("//FIRST/SECOND")="2^12"
|
||||
;;>>?GXML("//FIRST/SECOND/THIRD")="3^9"
|
||||
;;>>?GXML("//FIRST/SECOND/THIRD/FIFTH")="5^7"
|
||||
;;>>?GXML("//FIRST/SECOND/THIRD/FOURTH")="4^4"
|
||||
;;>>?GXML("//FIRST/SECOND/THIRD/SIXTH")="8^8"
|
||||
;;>>?GXML("//FIRST/SECOND")="2^12"
|
||||
;;>>?GXML("//FIRST")="1^13"
|
||||
;;><INDEX2>
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML2")
|
||||
;;>>>D INDEX^GPLXPATH("GXML")
|
||||
;;>>?GXML("//FIRST/SECOND")="2^12"
|
||||
;;>>?GXML("//FIRST/SECOND/_SECOND")="9^11"
|
||||
;;>>?GXML("//FIRST/SECOND/_SECOND/FOURTH")="10^10"
|
||||
;;>>?GXML("//FIRST/SECOND/THIRD")="3^8"
|
||||
;;>>?GXML("//FIRST/SECOND/THIRD/FOURTH")="4^7"
|
||||
;;>>?GXML("//FIRST")="1^13"
|
||||
;;><MISSING>
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>S OUTARY="^TMP($J,""MISSINGTEST"")"
|
||||
;;>>>D MISSING^GPLXPATH("GXML",OUTARY)
|
||||
;;>>?@OUTARY@(1)="DATA1"
|
||||
;;>>?@OUTARY@(2)="DATA2"
|
||||
;;><MAP>
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>S MAPARY="^TMP($J,""MAPVALUES"")"
|
||||
;;>>>S OUTARY="^TMP($J,""MAPTEST"")"
|
||||
;;>>>S @MAPARY@("DATA2")="VALUE2"
|
||||
;;>>>D MAP^GPLXPATH("GXML",MAPARY,OUTARY)
|
||||
;;>>?@OUTARY@(6)="VALUE2"
|
||||
;;><MAP2>
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>S MAPARY="^TMP($J,""MAPVALUES"")"
|
||||
;;>>>S OUTARY="^TMP($J,""MAPTEST"")"
|
||||
;;>>>S @MAPARY@("DATA1")="VALUE1"
|
||||
;;>>>S @MAPARY@("DATA2")="VALUE2"
|
||||
;;>>>S @MAPARY@("DATA3")="VALUE3"
|
||||
;;>>>S GXML(4)="<FOURTH>@@DATA1@@ AND @@DATA3@@</FOURTH>"
|
||||
;;>>>D MAP^GPLXPATH("GXML",MAPARY,OUTARY)
|
||||
;;>>>D PARY^GPLXPATH(OUTARY)
|
||||
;;>>?@OUTARY@(4)="<FOURTH>VALUE1 AND VALUE3</FOURTH>"
|
||||
;;><QUEUE>
|
||||
;;>>>D QUEUE^GPLXPATH("BTLIST","GXML",2,3)
|
||||
;;>>>D QUEUE^GPLXPATH("BTLIST","GXML",4,5)
|
||||
;;>>?$P(BTLIST(2),";",2)=4
|
||||
;;><BUILD>
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QUERY^GPLXPATH("GXML","//FIRST/SECOND/THIRD/FOURTH","G2")
|
||||
;;>>>D ZTEST^GPLXPATH("QUEUE")
|
||||
;;>>>D BUILD^GPLXPATH("BTLIST","G3")
|
||||
;;><CP>
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D CP^GPLXPATH("GXML","G2")
|
||||
;;>>?G2(0)=13
|
||||
;;><QOPEN>
|
||||
;;>>>K G2,GBL
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QOPEN^GPLXPATH("GBL","GXML")
|
||||
;;>>?$P(GBL(1),";",3)=12
|
||||
;;>>>D BUILD^GPLXPATH("GBL","G2")
|
||||
;;>>?G2(G2(0))="</SECOND>"
|
||||
;;><QOPEN2>
|
||||
;;>>>K G2,GBL
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QOPEN^GPLXPATH("GBL","GXML","//FIRST/SECOND")
|
||||
;;>>?$P(GBL(1),";",3)=11
|
||||
;;>>>D BUILD^GPLXPATH("GBL","G2")
|
||||
;;>>?G2(G2(0))="</SECOND>"
|
||||
;;><QCLOSE>
|
||||
;;>>>K G2,GBL
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QCLOSE^GPLXPATH("GBL","GXML")
|
||||
;;>>?$P(GBL(1),";",3)=13
|
||||
;;>>>D BUILD^GPLXPATH("GBL","G2")
|
||||
;;>>?G2(G2(0))="</FIRST>"
|
||||
;;><QCLOSE2>
|
||||
;;>>>K G2,GBL
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QCLOSE^GPLXPATH("GBL","GXML","//FIRST/SECOND/THIRD")
|
||||
;;>>?$P(GBL(1),";",3)=13
|
||||
;;>>>D BUILD^GPLXPATH("GBL","G2")
|
||||
;;>>?G2(G2(0))="</FIRST>"
|
||||
;;>>?G2(1)="</THIRD>"
|
||||
;;><INSERT>
|
||||
;;>>>K G2,GBL,G3,G4
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QUERY^GPLXPATH("GXML","//FIRST/SECOND/THIRD/FIFTH","G2")
|
||||
;;>>>D INSERT^GPLXPATH("GXML","G2","//FIRST/SECOND/THIRD")
|
||||
;;>>>D INSERT^GPLXPATH("G3","G2","//")
|
||||
;;>>?G2(1)=GXML(9)
|
||||
;;><REPLACE>
|
||||
;;>>>K G2,GBL,G3
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QUERY^GPLXPATH("GXML","//FIRST/SECOND/THIRD/FIFTH","G2")
|
||||
;;>>>D REPLACE^GPLXPATH("GXML","G2","//FIRST/SECOND")
|
||||
;;>>?GXML(2)="<FIFTH>"
|
||||
;;><INSINNER>
|
||||
;;>>>K GXML,G2,GBL,G3
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QUERY^GPLXPATH("GXML","//FIRST/SECOND/THIRD","G2")
|
||||
;;>>>D INSINNER^GPLXPATH("GXML","G2","//FIRST/SECOND/THIRD")
|
||||
;;>>?GXML(10)="<FIFTH>"
|
||||
;;><INSINNER2>
|
||||
;;>>>K GXML,G2,GBL,G3
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QUERY^GPLXPATH("GXML","//FIRST/SECOND/THIRD","G2")
|
||||
;;>>>D INSINNER^GPLXPATH("G2","G2")
|
||||
;;>>?G2(8)="<FIFTH>"
|
||||
;;></TEST>
|
203
p/GPLXPATH.m
203
p/GPLXPATH.m
|
@ -346,22 +346,6 @@ MISSING(IXML,OARY) ; SEARTH THROUGH INXLM AND PUT ANY @@X@@ VARS IN OARY
|
|||
. . Q
|
||||
Q
|
||||
;
|
||||
MAPOLD(IXML,INARY,OXML) ; SUBSTITUTE @@X@@ VARS IN IXML WITH VALUES IN INARY
|
||||
; AND PUT THE RESULTS IN OXML
|
||||
I '$D(@IXML@(0)) W "MALFORMED XML PASSED TO MAP",! Q
|
||||
I $O(@INARY@(""))="" W "EMPTY ARRAY PASSED TO MAP",! Q
|
||||
N I,TNAM,TVAL
|
||||
S @OXML@(0)=@IXML@(0) ; TOTAL LINES IN OUTPUT
|
||||
F I=1:1:@OXML@(0) D ; LOOP THROUGH WHOLE ARRAY
|
||||
. S @OXML@(I)=@IXML@(I) ; COPY THE LINE TO OUTPUT
|
||||
. I @OXML@(I)?.E1"@@".E D ; IS THERE A VARIABLE HERE?
|
||||
. . S TNAM=$P(@OXML@(I),"@@",2) ; EXTRACT THE VARIABLE NAME
|
||||
. . I $D(@INARY@(TNAM)) D ; IS THE VARIABLE IN THE MAP?
|
||||
. . . S TVAL=@INARY@(TNAM) ; PULL OUT MAPPED VALUE
|
||||
. . . S @OXML@(I)=$P(@OXML@(I),"@@",1)_TVAL_$P(@OXML@(I),"@@",3)
|
||||
W "MAPPED",!
|
||||
Q
|
||||
;
|
||||
MAP(IXML,INARY,OXML) ; SUBSTITUTE MULTIPLE @@X@@ VARS WITH VALUES IN INARY
|
||||
; AND PUT THE RESULTS IN OXML
|
||||
I '$D(@IXML@(0)) W "MALFORMED XML PASSED TO MAP",! Q
|
||||
|
@ -436,200 +420,19 @@ PARY(GLO) ;PRINT AN ARRAY
|
|||
Q
|
||||
;
|
||||
TEST ; Run all the test cases
|
||||
D TESTALL^GPLUNIT("GPLXPATH")
|
||||
Q
|
||||
;
|
||||
OLDTEST ; RUN ALL THE TEST CASES
|
||||
N ZTMP
|
||||
D ZLOAD^GPLUNIT("ZTMP","GPLXPATH")
|
||||
D ZTEST^GPLUNIT(.ZTMP,"ALL")
|
||||
W "PASSED: ",TPASSED,!
|
||||
W "FAILED: ",TFAILED,!
|
||||
W !
|
||||
; W "THE TESTS!",!
|
||||
; ZWR ZTMP
|
||||
D TESTALL^GPLUNIT("GPLXPAT0")
|
||||
Q
|
||||
;
|
||||
ZTEST(WHICH) ; RUN ONE SET OF TESTS
|
||||
N ZTMP
|
||||
S DEBUG=1
|
||||
D ZLOAD^GPLUNIT("ZTMP","GPLXPATH")
|
||||
D ZLOAD^GPLUNIT("ZTMP","GPLXPAT0")
|
||||
D ZTEST^GPLUNIT(.ZTMP,WHICH)
|
||||
Q
|
||||
;
|
||||
TLIST ; LIST THE TESTS
|
||||
N ZTMP
|
||||
D ZLOAD^GPLUNIT("ZTMP","GPLXPATH")
|
||||
D ZLOAD^GPLUNIT("ZTMP","GPLXPAT0")
|
||||
D TLIST^GPLUNIT(.ZTMP)
|
||||
Q
|
||||
;
|
||||
;;><TEST>
|
||||
;;><INIT>
|
||||
;;>>>K GPL S GPL=""
|
||||
;;>>>D PUSH^GPLXPATH("GPL","FIRST")
|
||||
;;>>>D PUSH^GPLXPATH("GPL","SECOND")
|
||||
;;>>>D PUSH^GPLXPATH("GPL","THIRD")
|
||||
;;>>>D PUSH^GPLXPATH("GPL","FOURTH")
|
||||
;;>>?GPL(0)=4
|
||||
;;><INITXML>
|
||||
;;>>>K GXML S GXML=""
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<FIRST>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<THIRD>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<FOURTH>@@DATA1@@</FOURTH>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<FIFTH>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","@@DATA2@@")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</FIFTH>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<SIXTH ID=""SELF"" />")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</THIRD>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</FIRST>")
|
||||
;;><INITXML2>
|
||||
;;>>>K GXML S GXML=""
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<FIRST>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<THIRD>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<FOURTH>DATA1</FOURTH>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<FOURTH>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","DATA2")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</FOURTH>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</THIRD>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<_SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","<FOURTH>DATA3</FOURTH>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</_SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</SECOND>")
|
||||
;;>>>D PUSH^GPLXPATH("GXML","</FIRST>")
|
||||
;;><PUSHPOP>
|
||||
;;>>>D ZLOAD^GPLUNIT("ZTMP","GPLXPATH")
|
||||
;;>>>D ZTEST^GPLUNIT(.ZTMP,"INIT")
|
||||
;;>>?GPL(GPL(0))="FOURTH"
|
||||
;;>>>D POP^GPLXPATH("GPL",.GX)
|
||||
;;>>?GX="FOURTH"
|
||||
;;>>?GPL(GPL(0))="THIRD"
|
||||
;;>>>D POP^GPLXPATH("GPL",.GX)
|
||||
;;>>?GX="THIRD"
|
||||
;;>>?GPL(GPL(0))="SECOND"
|
||||
;;><MKMDX>
|
||||
;;>>>D ZLOAD^GPLUNIT("ZTMP","GPLXPATH")
|
||||
;;>>>D ZTEST^GPLUNIT(.ZTMP,"INIT")
|
||||
;;>>>S GX=""
|
||||
;;>>>D MKMDX^GPLXPATH("GPL",.GX)
|
||||
;;>>?GX="//FIRST/SECOND/THIRD/FOURTH"
|
||||
;;><XNAME>
|
||||
;;>>?$$XNAME^GPLXPATH("<FOURTH>DATA1</FOURTH>")="FOURTH"
|
||||
;;>>?$$XNAME^GPLXPATH("<SIXTH ID=""SELF"" />")="SIXTH"
|
||||
;;>>?$$XNAME^GPLXPATH("</THIRD>")="THIRD"
|
||||
;;><INDEX>
|
||||
;;>>>D ZLOAD^GPLUNIT("ZTMP","GPLXPATH")
|
||||
;;>>>D ZTEST^GPLUNIT(.ZTMP,"INITXML")
|
||||
;;>>>D INDEX^GPLXPATH("GXML")
|
||||
;;>>?GXML("//FIRST/SECOND")="2^12"
|
||||
;;>>?GXML("//FIRST/SECOND/THIRD")="3^9"
|
||||
;;>>?GXML("//FIRST/SECOND/THIRD/FIFTH")="5^7"
|
||||
;;>>?GXML("//FIRST/SECOND/THIRD/FOURTH")="4^4"
|
||||
;;>>?GXML("//FIRST/SECOND/THIRD/SIXTH")="8^8"
|
||||
;;>>?GXML("//FIRST/SECOND")="2^12"
|
||||
;;>>?GXML("//FIRST")="1^13"
|
||||
;;><INDEX2>
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML2")
|
||||
;;>>>D INDEX^GPLXPATH("GXML")
|
||||
;;>>?GXML("//FIRST/SECOND")="2^12"
|
||||
;;>>?GXML("//FIRST/SECOND/_SECOND")="9^11"
|
||||
;;>>?GXML("//FIRST/SECOND/_SECOND/FOURTH")="10^10"
|
||||
;;>>?GXML("//FIRST/SECOND/THIRD")="3^8"
|
||||
;;>>?GXML("//FIRST/SECOND/THIRD/FOURTH")="4^7"
|
||||
;;>>?GXML("//FIRST")="1^13"
|
||||
;;><MISSING>
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>S OUTARY="^TMP($J,""MISSINGTEST"")"
|
||||
;;>>>D MISSING^GPLXPATH("GXML",OUTARY)
|
||||
;;>>?@OUTARY@(1)="DATA1"
|
||||
;;>>?@OUTARY@(2)="DATA2"
|
||||
;;><MAP>
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>S MAPARY="^TMP($J,""MAPVALUES"")"
|
||||
;;>>>S OUTARY="^TMP($J,""MAPTEST"")"
|
||||
;;>>>S @MAPARY@("DATA2")="VALUE2"
|
||||
;;>>>D MAP^GPLXPATH("GXML",MAPARY,OUTARY)
|
||||
;;>>?@OUTARY@(6)="VALUE2"
|
||||
;;><MAP2>
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>S MAPARY="^TMP($J,""MAPVALUES"")"
|
||||
;;>>>S OUTARY="^TMP($J,""MAPTEST"")"
|
||||
;;>>>S @MAPARY@("DATA1")="VALUE1"
|
||||
;;>>>S @MAPARY@("DATA2")="VALUE2"
|
||||
;;>>>S @MAPARY@("DATA3")="VALUE3"
|
||||
;;>>>S GXML(4)="<FOURTH>@@DATA1@@ AND @@DATA3@@</FOURTH>"
|
||||
;;>>>D MAP^GPLXPATH("GXML",MAPARY,OUTARY)
|
||||
;;>>>D PARY^GPLXPATH(OUTARY)
|
||||
;;>>?@OUTARY@(4)="<FOURTH>VALUE1 AND VALUE3</FOURTH>"
|
||||
;;><QUEUE>
|
||||
;;>>>D QUEUE^GPLXPATH("BTLIST","GXML",2,3)
|
||||
;;>>>D QUEUE^GPLXPATH("BTLIST","GXML",4,5)
|
||||
;;>>?$P(BTLIST(2),";",2)=4
|
||||
;;><BUILD>
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QUERY^GPLXPATH("GXML","//FIRST/SECOND/THIRD/FOURTH","G2")
|
||||
;;>>>D ZTEST^GPLXPATH("QUEUE")
|
||||
;;>>>D BUILD^GPLXPATH("BTLIST","G3")
|
||||
;;><CP>
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D CP^GPLXPATH("GXML","G2")
|
||||
;;>>?G2(0)=13
|
||||
;;><QOPEN>
|
||||
;;>>>K G2,GBL
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QOPEN^GPLXPATH("GBL","GXML")
|
||||
;;>>?$P(GBL(1),";",3)=12
|
||||
;;>>>D BUILD^GPLXPATH("GBL","G2")
|
||||
;;>>?G2(G2(0))="</SECOND>"
|
||||
;;><QOPEN2>
|
||||
;;>>>K G2,GBL
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QOPEN^GPLXPATH("GBL","GXML","//FIRST/SECOND")
|
||||
;;>>?$P(GBL(1),";",3)=11
|
||||
;;>>>D BUILD^GPLXPATH("GBL","G2")
|
||||
;;>>?G2(G2(0))="</SECOND>"
|
||||
;;><QCLOSE>
|
||||
;;>>>K G2,GBL
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QCLOSE^GPLXPATH("GBL","GXML")
|
||||
;;>>?$P(GBL(1),";",3)=13
|
||||
;;>>>D BUILD^GPLXPATH("GBL","G2")
|
||||
;;>>?G2(G2(0))="</FIRST>"
|
||||
;;><QCLOSE2>
|
||||
;;>>>K G2,GBL
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QCLOSE^GPLXPATH("GBL","GXML","//FIRST/SECOND/THIRD")
|
||||
;;>>?$P(GBL(1),";",3)=13
|
||||
;;>>>D BUILD^GPLXPATH("GBL","G2")
|
||||
;;>>?G2(G2(0))="</FIRST>"
|
||||
;;>>?G2(1)="</THIRD>"
|
||||
;;><INSERT>
|
||||
;;>>>K G2,GBL,G3,G4
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QUERY^GPLXPATH("GXML","//FIRST/SECOND/THIRD/FIFTH","G2")
|
||||
;;>>>D INSERT^GPLXPATH("GXML","G2","//FIRST/SECOND/THIRD")
|
||||
;;>>>D INSERT^GPLXPATH("G3","G2","//")
|
||||
;;>>?G2(1)=GXML(9)
|
||||
;;><REPLACE>
|
||||
;;>>>K G2,GBL,G3
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QUERY^GPLXPATH("GXML","//FIRST/SECOND/THIRD/FIFTH","G2")
|
||||
;;>>>D REPLACE^GPLXPATH("GXML","G2","//FIRST/SECOND")
|
||||
;;>>?GXML(2)="<FIFTH>"
|
||||
;;><INSINNER>
|
||||
;;>>>K GXML,G2,GBL,G3
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QUERY^GPLXPATH("GXML","//FIRST/SECOND/THIRD","G2")
|
||||
;;>>>D INSINNER^GPLXPATH("GXML","G2","//FIRST/SECOND/THIRD")
|
||||
;;>>?GXML(10)="<FIFTH>"
|
||||
;;><INSINNER2>
|
||||
;;>>>K GXML,G2,GBL,G3
|
||||
;;>>>D ZTEST^GPLXPATH("INITXML")
|
||||
;;>>>D QUERY^GPLXPATH("GXML","//FIRST/SECOND/THIRD","G2")
|
||||
;;>>>D INSINNER^GPLXPATH("G2","G2")
|
||||
;;>>?G2(8)="<FIFTH>"
|
||||
;;></TEST>
|
||||
|
|
Loading…
Reference in New Issue