Changeset 513
- Timestamp:
- May 27, 2009, 1:47:06 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CXPATH.m
r512 r513 104 104 Q 105 105 ; 106 VDX2XPG(OUTXPG,INVDX) ; CONVERT AN VDX ARRAY TO XP D106 VDX2XPG(OUTXPG,INVDX) ; CONVERT AN VDX ARRAY TO XPG 107 107 ; VDX: @VDX@(XPATH)=VALUE 108 108 ; XPG: @(VDX(X1,X2,X3,X4))@=VALUE … … 123 123 . S ZN=OUTXPG_"("_ZW2_")" 124 124 . S @ZN=@INVDX@(ZI) 125 Q 126 ; 127 XML2XPG(OUTXPG,INXML) ; CONVERT AN XML ARRAY, PASSED BY NAME TO AN XPG ARRAY 128 ; XPG MEANS XPATH GLOBAL AND HAS THE FORM @OUTXPG@("X1","X2","X3")=VALUE 129 ; 130 ;N G1 131 D INDEX(INXML,"G1") ; PRODUCES A VDX ARRAY IN G1 132 D VDX2XPG(OUTXPG,"G1") ; CONVERTS THE VDX ARRAY TO XPG FORM 133 Q 134 ; 135 DO 136 D XPG2XML("^GPL2B","^GPL2A") 137 Q 138 ; 139 XPG2XML(OUTXML,INXPG,NUM) ; 140 ; OUTPUT XML FROM AN XPG FILE 141 I '$D(NUM) D ; FIRST TIME THROUGH 142 . K @OUTXML 143 . S NUM=1 144 . S ZA="" 145 S G=INXPG 146 S G=@G I G="" Q ; 147 F D ; S G=$Q(@G) Q:G="" D ; 148 . F ZI=1:1:$QL(G) D ; 149 . . I ZI<$QL(G) D ; 150 . . . S ZB=$QS(G,ZI) 151 . . . I ZA(ZA(0))'=ZB ZOPEN(ZB) 152 . . . E ZCLOSE(ZB) 153 . . S ZV="" 154 . . S G2=$QS(G,ZI) 155 . . I ZI=$QL(G) S ZV=@G 156 . . W G2," ",ZV 157 . S G=@G I G="" Q ; 158 . W ! 159 Q 160 ; 161 ZOPEN(WHAT) 162 D PUSH("GA",WHAT) 163 D PUSH(OUTXML,"<"_WHAT_">") 164 Q 165 ; 166 ZCLOSE(WHAT) 167 D POP("GA",.TMP) 168 D PUSH(OUTXML,"</"_WHAT_">") 169 Q 170 ; 171 ZVAL(WHAT,VAL) 172 D PUSH(OUTXML,"<"_WHAT_">"_VAL_"</"_WHAT_">") 125 173 Q 126 174 ;
Note:
See TracChangeset
for help on using the changeset viewer.