- Timestamp:
- Oct 6, 2009, 5:41:09 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CXPATH.m
r561 r570 57 57 Q 58 58 ; 59 MKMDX(STK,RTN ) ; MAKES A MUMPS INDEX FROM THE ARRAY STK59 MKMDX(STK,RTN,INREDUX) ; MAKES A MUMPS INDEX FROM THE ARRAY STK 60 60 ; RTN IS SET TO //FIRST/SECOND/THIRD FOR THREE ARRAY ELEMENTS 61 ; REDUX IS A STRING TO REMOVE FROM THE RESULT 61 62 S RTN="" 62 63 N I … … 66 67 . I @STK@(0)>1 D ; SUBSEQUENT ELEMENTS NEED A SEMICOLON 67 68 . . F I=2:1:@STK@(0) S RTN=RTN_"/"_@STK@(I) 69 I $G(INREDUX)'="" S RTN=$P(RTN,INREDUX,1)_$P(RTN,INREDUX,2) 68 70 Q 69 71 ; … … 200 202 Q 201 203 ; 202 INDEX(IZXML,VDX,NOINX,TEMPLATE) ; parse XML in IZXML and produce an XPATH index 204 INDEX(IZXML,VDX,NOINX,TEMPLATE,REDUX) ; parse XML in IZXML and produce 205 ; an XPATH index; REDUX is a string to be removed from each xpath 203 206 ; GPL 7/14/09 OPTIONALLY GENERATE AN XML TEMPLATE IF PASSED BY NAME 204 207 ; TEMPLATE IS IDENTICAL TO THE PARSED XML LINE BY LINE … … 213 216 N I,LINE,FIRST,LAST,CUR,TMP,MDX,FOUND,CURVAL,DVDX,LCNT 214 217 N C0CSTK ; LEAVE OUT FOR DEBUGGING 218 I '$D(REDUX) S REDUX="" 215 219 I '$D(NOINX) S NOINX=0 ; IF NOT PASSED, GENERATE AN INDEX 216 220 N ZXML … … 244 248 . . . S CUR=CUR_$G(LKASD(CUR,I)) ; HANDLE MULTIPLES 245 249 . . . D PUSH("C0CSTK",CUR) ; ADD TO THE STACK 246 . . . D MKMDX("C0CSTK",.MDX ) ; GENERATE THE M INDEX250 . . . D MKMDX("C0CSTK",.MDX,REDUX) ; GENERATE THE M INDEX 247 251 . . . ; W "MDX=",MDX,! 248 252 . . . I $D(@ZXML@(MDX)) D ; IN THE INDEX, IS A MULTIPLE … … 393 397 QUEUE(BLST,ARRAY,FIRST,LAST) ; ADD AN ENTRY TO A BLIST 394 398 ; 395 I DEBUGW "QUEUEING ",BLST,!399 I $G(DEBUG) W "QUEUEING ",BLST,! 396 400 D PUSH(BLST,ARRAY_";"_FIRST_";"_LAST) 397 401 Q
Note:
See TracChangeset
for help on using the changeset viewer.