Changeset 646 for ccr/trunk/p


Ignore:
Timestamp:
Dec 8, 2009, 5:29:27 PM (15 years ago)
Author:
George Lilly
Message:

improved xpath handling

Location:
ccr/trunk/p
Files:
3 edited

Legend:

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

    r598 r646  
    111111 S ZI=""
    112112 F  S ZI=$O(C0CXP(ZI)) Q:ZI=""  D  ; FOR EACH XPATH
    113  . D DEMUX("ZJ",ZI) ;
     113 . D DEMUX^C0CMXP("ZJ",ZI) ;
    114114 . W ZJ,!
    115115 . S ZK=$P(ZJ,"^",3) ; PULL OUT THE XPATH
     
    131131 D CCRRPC^C0CCCR(.ZT,C0CDFN,"LABLIMIT:T-1000")
    132132 M @AOUT=ZT
    133  Q
    134  ;
    135 DEMUX(OUTX,INX) ;PARSES XPATH PASSED BY VALUE IN INX TO REMOVE [x] MULTIPLES
    136  ; RETURNS OUTX: MULTIPLE^SUBMULTIPLE^XPATH
    137  N ZX,ZY,ZZ,ZZ1,ZMULT,ZSUB
    138  S (ZMULT,ZSUB)=""
    139  S ZX=$P(INX,"[",2)
    140  I ZX'="" D  ; THERE IS A [x] MULTIPLE
    141  . S ZY=$P(INX,"[",1) ;FIRST PART OF XPATH
    142  . S ZMULT=$P(ZX,"]",1) ; NUMBER OF THE MULTIPLE
    143  . S ZX=ZY_$P(ZX,"]",2) ; REST OF THE XPATH
    144  . I $P(ZX,"[",2)'="" D  ; A SUB MULTIPLE EXISTS
    145  . . S ZZ=$P(ZX,"[",1) ; FIRST PART OF XPATH
    146  . . S ZX=$P(ZX,"[",2) ; DELETE THE [
    147  . . S ZSUB=$P(ZX,"]",1) ; NUMBER OF THE SUBMULTIPLE
    148  . . S ZX=ZZ_$P(ZX,"]",2) ; REST OF THE XPATH
    149  E  S ZX=INX ;NO MULTIPLE HERE
    150  S @OUTX=ZMULT_"^"_ZSUB_"^"_ZX ;RETURN MULTIPLE^SUBMULTIPLE^XPATH
    151133 Q
    152134 ;
  • ccr/trunk/p/C0CMXML.m

    r639 r646  
    181181 D END^C0CMXMLB ;END THE DOCUMENT
    182182 M @ZRTN=^TMP("MXMLBLD",$J)
    183  K ^TMP("MXMLBLD",$J),^TMP("MXMLDOM",$J)
     183 K ^TMP("MXMLBLD",$J)
    184184 Q
    185185 ;
  • ccr/trunk/p/C0CMXP.m

    r640 r646  
    8787 Q
    8888 ;
     89DEMUX(OUTX,INX) ;PARSES XPATH PASSED BY VALUE IN INX TO REMOVE [x] MULTIPLES
     90 ; RETURNS OUTX: MULTIPLE^SUBMULTIPLE^XPATH
     91 N ZX,ZY,ZZ,ZZ1,ZMULT,ZSUB
     92 S (ZMULT,ZSUB)=""
     93 S ZX=$P(INX,"[",2)
     94 I ZX'="" D  ; THERE IS A [x] MULTIPLE
     95 . S ZY=$P(INX,"[",1) ;FIRST PART OF XPATH
     96 . S ZMULT=$P(ZX,"]",1) ; NUMBER OF THE MULTIPLE
     97 . S ZX=ZY_$P(ZX,"]",2) ; REST OF THE XPATH
     98 . I $P(ZX,"[",2)'="" D  ; A SUB MULTIPLE EXISTS
     99 . . S ZZ=$P(ZX,"[",1) ; FIRST PART OF XPATH
     100 . . S ZX=$P(ZX,"[",2) ; DELETE THE [
     101 . . S ZSUB=$P(ZX,"]",1) ; NUMBER OF THE SUBMULTIPLE
     102 . . S ZX=ZZ_$P(ZX,"]",2) ; REST OF THE XPATH
     103 E  S ZX=INX ;NO MULTIPLE HERE
     104 S @OUTX=ZMULT_"^"_ZSUB_"^"_ZX ;RETURN MULTIPLE^SUBMULTIPLE^XPATH
     105 Q
     106 ;
    89107UPDIE   ; INTERNAL ROUTINE TO CALL UPDATE^DIE AND CHECK FOR ERRORS
    90108 K ZERR
Note: See TracChangeset for help on using the changeset viewer.