fixed DEBUG bug in XPath
This commit is contained in:
parent
752f5b392c
commit
c7c5019a30
10
p/C0CXPATH.m
10
p/C0CXPATH.m
|
@ -583,12 +583,12 @@ TRIM(THEXML) ; TAKES OUT ALL NULL ELEMENTS
|
|||
N I,J,TMPXML,DEL,FOUND,INTXT
|
||||
S FOUND=0
|
||||
S INTXT=0
|
||||
I DEBUG W "DELETING EMPTY ELEMENTS",!
|
||||
I $G(DEBUG) W "DELETING EMPTY ELEMENTS",!
|
||||
F I=1:1:(@THEXML@(0)-1) D ; LOOP THROUGH ENTIRE ARRAY
|
||||
. S J=@THEXML@(I)
|
||||
. I J["<text>" D
|
||||
. . S INTXT=1 ; IN HTML SECTION, DON'T TRIM
|
||||
. . I DEBUG W "IN HTML SECTION",!
|
||||
. . I $G(DEBUG) W "IN HTML SECTION",!
|
||||
. N JM,JP,JPX ; JMINUS AND JPLUS
|
||||
. S JM=@THEXML@(I-1) ; LINE BEFORE
|
||||
. I JM["</text>" S INTXT=0 ; LEFT HTML SECTION,START TRIM
|
||||
|
@ -596,16 +596,16 @@ TRIM(THEXML) ; TAKES OUT ALL NULL ELEMENTS
|
|||
. I INTXT=0 D ; IF NOT IN AN HTML SECTION
|
||||
. . S JPX=$TR(JP,"/","") ; REMOVE THE SLASH
|
||||
. . I J=JPX D ; AN EMPTY ELEMENT ON TWO LINES
|
||||
. . . I DEBUG W I,J,JP,!
|
||||
. . . I $G(DEBUG) W I,J,JP,!
|
||||
. . . S FOUND=1 ; FOUND SOMETHING TO BE DELETED
|
||||
. . . S DEL(I)="" ; SET LINE TO DELETE
|
||||
. . . S DEL(I+1)="" ; SET NEXT LINE TO DELETE
|
||||
. . I J["><" D ; AN EMPTY ELEMENT ON ONE LINE
|
||||
. . . I DEBUG W I,J,!
|
||||
. . . I $G(DEBUG) W I,J,!
|
||||
. . . S FOUND=1 ; FOUND SOMETHING TO BE DELETED
|
||||
. . . S DEL(I)="" ; SET THE EMPTY LINE UP TO BE DELETED
|
||||
. . . I JM=JPX D ;
|
||||
. . . . I DEBUG W I,JM_J_JPX,!
|
||||
. . . . I $G(DEBUG) W I,JM_J_JPX,!
|
||||
. . . . S DEL(I-1)=""
|
||||
. . . . S DEL(I+1)="" ; SET THE SURROUNDING LINES FOR DEL
|
||||
; . I J'["><" D PUSH("TMPXML",J)
|
||||
|
|
Loading…
Reference in New Issue