Changeset 649
- Timestamp:
- Dec 15, 2009, 6:18:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CMXP.m
r648 r649 26 26 S @ARY@("XML TEMPLATE FIELD")=3 27 27 S @ARY@("XPATH BINDING SUBFILE")=178.1014 28 S @ARY@("REDUX FIELD")=2.5 28 29 Q 29 30 ; … … 34 35 S C0CXTFLD=@ARY@("XML TEMPLATE FIELD") 35 36 S C0CXPBF=@ARY@("XPATH BINDING SUBFILE") 37 S C0CRDUXF=@ARY@("REDUX FIELD") 36 38 Q 37 39 ; … … 77 79 Q 78 80 ; 79 MKTPLATE(OUTT,INXML,REDUX) ;MAKE A TEMPLATE FROM INXML, RETURNED IN OUTT 80 ; BOTH PASSED BY NAME 81 COMPILE(INTID,UFARY) ; COMPILES AN XML TEMPLATE AND GENERATES XPATH BINDINGS 82 ; UFARY IF SPECIFIED WILL REDIRECT THE XML FILE TO USE 83 ; INTID IS THE IEN OF THE RECORD TO USE IN THE XML FILE 84 ; XML IS PULLED FROM THE "XML" FIELD AND THE COMPILED RESULT PUT 85 ; IN THE "XML TEMPLATE" FIELD. ALL XPATHS USED IN THE TEMPLATE 86 ; WILL BE POPULATED TO THE XPATH BINDINGS SUBFILE AS .01 87 I '$D(UFARY) D ; 88 . S UFARY="UFARY" ; FILE ARRAY 89 . D INITXPF("UFARY") ;IF FILE ARRAY NOT PASSED, INITIALIZE 90 D SETXPF(UFARY) ;SET FILE VARIABLES 91 B 92 ;N C0CXML,C0CREDUX,C0CTEMP,C0CIDX 93 D GETXML("C0CXML",INTID,UFARY) 94 S C0CREDUX=$$GET1^DIQ(C0CXPF,INTID_",",C0CRDUXF,"E") ;XPATH REDUCTION STRING 95 D MKTPLATE("C0CTEMP","C0CIDX","C0CXML",C0CREDUX) ; CREATE TEMPLATE AND IDX 96 D ADDTEMP("C0CTEMP",INTID,UFARY) ; WRITE THE TEMPLATE TO FILE 97 D ADDXP("C0CIDX",INTID,UFARY) ;CREATE XPATH SUBFILE ENTRIES FOR EVERY XPATH 98 Q 99 ; 100 MKTPLATE(OUTT,OUTIDX,INXML,REDUX) ;MAKE A TEMPLATE FROM INXML, RETURNED IN OUTT 101 ; BOTH PASSED BY NAME. THE REDUX XPATH REDUCTION STRING IS USED IF PASSED 102 ; OUTIDX IS AN ARRAY OF THE XPATHS USED IN MAKING THE TEMPLATE 81 103 ; 82 104 S C0CXLOC=$NA(^TMP("C0CXML",$J)) … … 97 119 . . W !,ZD(1) 98 120 . . K @C0CDOM@(ZI,"T") ; KILL THE DATA 99 . . S @C0CDOM@(ZI,"T",1)="@@"_$G(GIDX2(ZI))_"@@" 121 . . N ZXPATH 122 . . S ZXPATH=$G(GIDX2(ZI)) ;FIND AN XPATH FOR THIS NODE 123 . . S @C0CDOM@(ZI,"T",1)="@@"_ZXPATH_"@@" 124 . . I ZXPATH'="" S @OUTIDX@(ZXPATH)="" ; PASS BACK XPATH USED IN IDX 100 125 D OUTXML^C0CMXML(OUTT,C0CDOCID) 101 126 Q
Note:
See TracChangeset
for help on using the changeset viewer.