Changes in ccr/trunk/p/GPLXPATH.m [27:3]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/GPLXPATH.m
r27 r3 189 189 . W "ERROR IN COPY BAD SOURCE LENGTH: ",CPSRC,! 190 190 . Q 191 ; I '$D(@CPDEST@(0)) S @CPDEST@(0)=0 ; IF THE DEST IS EMPTY, INITIALIZE192 191 D QUEUE("CPINSTR",CPSRC,1,@CPSRC@(0)) ; BLIST FOR ENTIRE ARRAY 193 192 D BUILD("CPINSTR",CPDEST) … … 239 238 ; XML AT THE END OF THE XPATH POINT 240 239 ; INSXML AND INSNEW ARE PASSED BY NAME INSXPATH IS A VALUE 241 N INSBLD,INSTMP240 ; N INSBLD,INSTMP 242 241 I DEBUG W "DOING INSERT ",INSXML,INSNEW,INSXPATH,! 243 242 I DEBUG F G1=1:1:@INSXML@(0) W @INSXML@(G1),! 244 I '$D(@INSXML@(0)) D Q ; INSERT INTO AN EMPTY ARRAY 245 . D CP^GPLXPATH(INSNEW,INSXML) ; JUST COPY INTO THE OUTPUT 243 I '$D(@INSXML@(0)) D ; INSERT INTO AN EMPTY ARRAY 244 . W "DOING A BAD COPY",! 245 . D CP^GPLXPATH(INSNEW,INXML) ; JUST COPY INTO THE OUTPUT 246 246 I $D(@INSXML@(0)) D ; IF ORIGINAL ARRAY IS NOT EMPTY 247 . W "GOT HERE",! 247 248 . I $D(INSXPATH) D ; XPATH PROVIDED 248 249 . . D QOPEN("INSBLD",INSXML,INSXPATH) ; COPY THE BEFORE … … 255 256 . I '$D(INSXPATH) D ; NO XPATH PROVIDED, CLOSE AT ROOT 256 257 . . D QCLOSE("INSBLD",INSXML,"//") ; CLOSE WITH ROOT XPATH 257 . D BUILD("INSBLD", "INSTMP") ; PUT RESULTS IN INDEST258 . D CP^GPLXPATH( "INSTMP",INSXML) ; COPY BUFFER TO SOURCE258 . D BUILD("INSBLD",INSTMP) ; PUT RESULTS IN INDEST 259 . D CP^GPLXPATH(INSTMP,INSXML) ; COPY BUFFER TO SOURCE 259 260 Q 260 261 ; … … 333 334 Q 334 335 ; 335 TEST ; Run all the test cases 336 D TESTALL^GPLUNIT("GPLXPATH") 336 TEST ; RUN ALL THE TEST CASES 337 N ZTMP 338 D ZLOAD^GPLUNIT("ZTMP","GPLXPATH") 339 D ZTEST^GPLUNIT(.ZTMP,"ALL") 340 W "PASSED: ",TPASSED,! 341 W "FAILED: ",TFAILED,! 342 W ! 343 ; W "THE TESTS!",! 344 ; ZWR ZTMP 337 345 Q 338 346 ; 339 OLDTEST ; RUN ALL THE TEST CASES340 N ZTMP341 D ZLOAD^GPLUNIT("ZTMP","GPLXPATH")342 D ZTEST^GPLUNIT(.ZTMP,"ALL")343 W "PASSED: ",TPASSED,!344 W "FAILED: ",TFAILED,!345 W !346 ; W "THE TESTS!",!347 ; ZWR ZTMP348 Q349 ;350 347 ZTEST(WHICH) ; RUN ONE SET OF TESTS 351 N ZTMP 352 S DEBUG=1 353 D ZLOAD^GPLUNIT("ZTMP","GPLXPATH") 354 D ZTEST^GPLUNIT(.ZTMP,WHICH) 355 Q 356 ; 348 N ZTMP 349 D ZLOAD^GPLUNIT("ZTMP","GPLXPATH") 350 D ZTEST^GPLUNIT(.ZTMP,WHICH) 351 Q 352 ; 357 353 TLIST ; LIST THE TESTS 358 354 N ZTMP … … 469 465 ;;>>>D ZTEST^GPLXPATH("INITXML") 470 466 ;;>>>D QOPEN^GPLXPATH("GBL","GXML") 471 ;;>>?$P(GBL(1)," ;",3)=12467 ;;>>?$P(GBL(1),"^",3)=12 472 468 ;;>>>D BUILD^GPLXPATH("GBL","G2") 473 469 ;;>>?G2(G2(0))="</SECOND>" … … 476 472 ;;>>>D ZTEST^GPLXPATH("INITXML") 477 473 ;;>>>D QOPEN^GPLXPATH("GBL","GXML","//FIRST/SECOND") 478 ;;>>?$P(GBL(1)," ;",3)=11474 ;;>>?$P(GBL(1),"^",3)=12 479 475 ;;>>>D BUILD^GPLXPATH("GBL","G2") 480 476 ;;>>?G2(G2(0))="</SECOND>" … … 483 479 ;;>>>D ZTEST^GPLXPATH("INITXML") 484 480 ;;>>>D QCLOSE^GPLXPATH("GBL","GXML") 485 ;;>>?$P(GBL(1)," ;",3)=13481 ;;>>?$P(GBL(1),"^",3)=13 486 482 ;;>>>D BUILD^GPLXPATH("GBL","G2") 487 483 ;;>>?G2(G2(0))="</FIRST>" … … 490 486 ;;>>>D ZTEST^GPLXPATH("INITXML") 491 487 ;;>>>D QCLOSE^GPLXPATH("GBL","GXML","//FIRST/SECOND/THIRD") 492 ;;>>?$P(GBL(1)," ;",3)=13488 ;;>>?$P(GBL(1),"^",3)=13 493 489 ;;>>>D BUILD^GPLXPATH("GBL","G2") 494 490 ;;>>?G2(G2(0))="</FIRST>" … … 498 494 ;;>>>D ZTEST^GPLXPATH("INITXML") 499 495 ;;>>>D QUERY^GPLXPATH("GXML","//FIRST/SECOND/THIRD/FIFTH","G2") 500 ;;>>>D INSERT^GPLXPATH("GXML","G2"," //FIRST/SECOND/THIRD")501 ;;>>>D INSERT^GPLXPATH("G3","G2"," //")502 ;;>>?G2(1)=G XML(9)496 ;;>>>D INSERT^GPLXPATH("GXML","G2","G3","//FIRST/SECOND/THIRD") 497 ;;>>>D INSERT^GPLXPATH("G3","G2","G4","//FIRST/SECOND/THIRD") 498 ;;>>?G2(1)=G3(9) 503 499 ;;><REPLACE> 504 500 ;;>>>K G2,GBL,G3
Note:
See TracChangeset
for help on using the changeset viewer.