Changeset 513 for ccr/trunk/p/C0CXPATH.m


Ignore:
Timestamp:
May 27, 2009, 1:47:06 PM (15 years ago)
Author:
George Lilly
Message:

updates to xpath lib for webservices processingq

File:
1 edited

Legend:

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

    r512 r513  
    104104 Q
    105105 ;
    106 VDX2XPG(OUTXPG,INVDX) ; CONVERT AN VDX ARRAY TO XPD
     106VDX2XPG(OUTXPG,INVDX) ; CONVERT AN VDX ARRAY TO XPG
    107107 ; VDX: @VDX@(XPATH)=VALUE
    108108 ; XPG: @(VDX(X1,X2,X3,X4))@=VALUE
     
    123123 . S ZN=OUTXPG_"("_ZW2_")"
    124124 . S @ZN=@INVDX@(ZI)
     125 Q
     126 ;
     127XML2XPG(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 ;
     135DO
     136 D XPG2XML("^GPL2B","^GPL2A")
     137 Q
     138 ;
     139XPG2XML(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 ;
     161ZOPEN(WHAT)
     162 D PUSH("GA",WHAT)
     163 D PUSH(OUTXML,"<"_WHAT_">")
     164 Q
     165 ;
     166ZCLOSE(WHAT)
     167 D POP("GA",.TMP)
     168 D PUSH(OUTXML,"</"_WHAT_">")
     169 Q
     170 ;
     171ZVAL(WHAT,VAL)
     172 D PUSH(OUTXML,"<"_WHAT_">"_VAL_"</"_WHAT_">")
    125173 Q
    126174 ;
Note: See TracChangeset for help on using the changeset viewer.