Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • ccr/trunk/p/GPLXPATH.m

    r27 r3  
    189189       . W "ERROR IN COPY BAD SOURCE LENGTH: ",CPSRC,!
    190190       . Q
    191        ; I '$D(@CPDEST@(0)) S @CPDEST@(0)=0 ; IF THE DEST IS EMPTY, INITIALIZE
    192191       D QUEUE("CPINSTR",CPSRC,1,@CPSRC@(0)) ; BLIST FOR ENTIRE ARRAY
    193192       D BUILD("CPINSTR",CPDEST)
     
    239238       ; XML AT THE END OF THE XPATH POINT
    240239       ; INSXML AND INSNEW ARE PASSED BY NAME INSXPATH IS A VALUE
    241        N INSBLD,INSTMP
     240       ; N INSBLD,INSTMP
    242241       I DEBUG W "DOING INSERT ",INSXML,INSNEW,INSXPATH,!
    243242       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
    246246       I $D(@INSXML@(0)) D  ; IF ORIGINAL ARRAY IS NOT EMPTY
     247       . W "GOT HERE",!
    247248       . I $D(INSXPATH) D  ; XPATH PROVIDED
    248249       . . D QOPEN("INSBLD",INSXML,INSXPATH) ; COPY THE BEFORE
     
    255256       . I '$D(INSXPATH) D  ; NO XPATH PROVIDED, CLOSE AT ROOT
    256257       . . D QCLOSE("INSBLD",INSXML,"//") ; CLOSE WITH ROOT XPATH
    257        . D BUILD("INSBLD","INSTMP") ; PUT RESULTS IN INDEST
    258        . D CP^GPLXPATH("INSTMP",INSXML) ; COPY BUFFER TO SOURCE
     258       . D BUILD("INSBLD",INSTMP) ; PUT RESULTS IN INDEST
     259       . D CP^GPLXPATH(INSTMP,INSXML) ; COPY BUFFER TO SOURCE
    259260       Q
    260261       ;
     
    333334      Q
    334335      ;
    335 TEST  ; Run all the test cases
    336       D TESTALL^GPLUNIT("GPLXPATH")
     336TEST   ; 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
    337345      Q
    338346      ;
    339 OLDTEST   ; RUN ALL THE TEST CASES
    340         N ZTMP
    341         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 ZTMP
    348         Q
    349         ;
    350347ZTEST(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      ;
    357353TLIST ; LIST THE TESTS
    358354      N ZTMP
     
    469465;;>>>D ZTEST^GPLXPATH("INITXML")
    470466;;>>>D QOPEN^GPLXPATH("GBL","GXML")
    471 ;;>>?$P(GBL(1),";",3)=12
     467;;>>?$P(GBL(1),"^",3)=12
    472468;;>>>D BUILD^GPLXPATH("GBL","G2")
    473469;;>>?G2(G2(0))="</SECOND>"
     
    476472;;>>>D ZTEST^GPLXPATH("INITXML")
    477473;;>>>D QOPEN^GPLXPATH("GBL","GXML","//FIRST/SECOND")
    478 ;;>>?$P(GBL(1),";",3)=11
     474;;>>?$P(GBL(1),"^",3)=12
    479475;;>>>D BUILD^GPLXPATH("GBL","G2")
    480476;;>>?G2(G2(0))="</SECOND>"
     
    483479;;>>>D ZTEST^GPLXPATH("INITXML")
    484480;;>>>D QCLOSE^GPLXPATH("GBL","GXML")
    485 ;;>>?$P(GBL(1),";",3)=13
     481;;>>?$P(GBL(1),"^",3)=13
    486482;;>>>D BUILD^GPLXPATH("GBL","G2")
    487483;;>>?G2(G2(0))="</FIRST>"
     
    490486;;>>>D ZTEST^GPLXPATH("INITXML")
    491487;;>>>D QCLOSE^GPLXPATH("GBL","GXML","//FIRST/SECOND/THIRD")
    492 ;;>>?$P(GBL(1),";",3)=13
     488;;>>?$P(GBL(1),"^",3)=13
    493489;;>>>D BUILD^GPLXPATH("GBL","G2")
    494490;;>>?G2(G2(0))="</FIRST>"
     
    498494;;>>>D ZTEST^GPLXPATH("INITXML")
    499495;;>>>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)=GXML(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)
    503499;;><REPLACE>
    504500;;>>>K G2,GBL,G3
Note: See TracChangeset for help on using the changeset viewer.