Changeset 640


Ignore:
Timestamp:
Dec 6, 2009, 9:49:56 PM (15 years ago)
Author:
George Lilly
Message:

xml file support

File:
1 edited

Legend:

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

    r639 r640  
    2020 Q
    2121 ;
     22INITXPF(ARY) ;INITIAL XML/XPATH FILE ARRAY
     23 ;
     24 S @ARY@("XML FILE NUMBER")=178.101
     25 S @ARY@("XML SOURCE FIELD")=2.1
     26 S @ARY@("XML TEMPLATE FIELD")=3
     27 S @ARY@("XPATH BINDING SUBFILE")=178.1014
     28 Q
     29 ;
     30SETXPF(ARY) ; SET FILE AND FIELD VARIABLES FROM XPF ARRAY
     31 ;
     32 S C0CXPF=@ARY@("XML FILE NUMBER")
     33 S C0CXFLD=@ARY@("XML SOURCE FIELD")
     34 S C0CXTFLD=@ARY@("XML TEMPLATE FIELD")
     35 S C0CXPBF=@ARY@("XPATH BINDING SUBFILE")
     36 Q
     37 ;
     38ADDXP(INARY,TID,FARY) ;ADD XPATH .01 FIELD TO BINDING SUBFILE OF TEMPLATE TID
     39 I '$D(FARY) D  ;
     40 . S FARY="FARY" ; FILE ARRAY
     41 . D INITXPF("FARY") ;IF FILE ARRAY NOT PASSED, INITIALIZE
     42 D SETXPF(FARY) ;SET FILE VARIABLES
     43 N C0CA,C0CB
     44 S C0CA="" S C0CB=0
     45 F  S C0CA=$O(@INARY@(C0CA)) Q:C0CA=""  D  ; FOR EACH XPATH
     46 . S C0CB=C0CB+1 ; COUNT OF XPATHS
     47 . S C0CFDA(C0CXPBF,"?+"_C0CB_","_TID_",",.01)=C0CA
     48 . D UPDIE ; CREATE THE BINDING SUBFILE FOR THIS XPATH
     49 Q
     50 ;
     51ADDXML(INXML,TEMPID,FARY) ;ADD XML TO A TEMPLATE ID TEMPID
     52 ; INXML IS PASSED BY NAME
     53 I '$D(FARY) D  ;
     54 . S FARY="FARY" ; FILE ARRAY
     55 . D INITXPF("FARY") ;IF FILE ARRAY NOT PASSED, INITIALIZE
     56 D SETXPF(FARY) ;SET FILE VARIABLES
     57 D WP^DIE(C0CXPF,TEMPID_",",C0CXFLD,,INXML)
     58 Q
     59 ;
     60ADDTEMP(INXML,TEMPID,FARY) ;ADD XML TEMPLATE TO TEMPLATE RECORD TEMPID FIELD 3
     61 ;
     62 I '$D(FARY) D  ;
     63 . S FARY="FARY" ; FILE ARRAY
     64 . D INITXPF("FARY") ;IF FILE ARRAY NOT PASSED, INITIALIZE
     65 D SETXPF(FARY) ;SET FILE VARIABLES
     66 D WP^DIE(C0CXPF,TEMPID_",",C0CXTFLD,,INXML)
     67 Q
     68 ;
     69GETXML(OUTXML,TEMPID,FARY) ;GET THE XML FROM TEMPLATE TEMPID
     70 ;
     71 I '$D(FARY) D  ;
     72 . S FARY="FARY" ; FILE ARRAY
     73 . D INITXPF("FARY") ;IF FILE ARRAY NOT PASSED, INITIALIZE
     74 D SETXPF(FARY) ;SET FILE VARIABLES
     75 I $$GET1^DIQ(C0CXPF,TEMPID_",",C0CXFLD,,OUTXML)'=OUTXML D  Q  ;
     76 . W "ERROR RETRIEVING TEMPLATE",!
     77 Q
     78 ;
    2279MKTPLATE(INXML,OUTT) ;MAKE A TEMPLATE FROM INXML, RETURNED IN OUTT
    2380 ; BOTH PASSED BY NAME
    2481 ;
    25  S C0CDOCID=$$PARSE(INXML,"C0CMKT")
     82 S C0CDOCID=$$PARSE^C0CMXML(INXML,"C0CMKT")
    2683 S C0CDOM=$NA(^TMP("MXMLDOM",$J,C0CDOCID))
    2784 N ZI S ZI=""
    2885 F  S ZI=$O(@C0CDOM@(ZI)) Q:ZI=""  D  ; FOR EACH NODE IN THE DOM
    29  . W !,ZI,$$TAG(ZI)
     86 . W !,ZI,$$TAG^C0CMXML(ZI)
    3087 Q
    3188 ;
Note: See TracChangeset for help on using the changeset viewer.