Changeset 1336 for ccr/trunk/p/C0CDOM.m
- Timestamp:
- Jan 4, 2012, 9:39:08 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CDOM.m
r1204 r1336 1 C0CDOM 1 C0CDOM ; GPL - DOM PROCESSING ROUTINES ;6/6/11 17:05 2 2 ;;0.1;C0C;nopatch;noreleasedate;Build 38 3 3 ;Copyright 2011 George Lilly. Licensed under the terms of the GNU … … 20 20 Q 21 21 ; 22 DOMO(ZOID,ZPATH,ZNARY,ZXIDX,ZXPARY,ZNUM,ZREDUX) 22 DOMO(ZOID,ZPATH,ZNARY,ZXIDX,ZXPARY,ZNUM,ZREDUX) ; RECURSIVE ROUTINE TO POPULATE 23 23 ; THE XPATH INDEX ZXIDX, PASSED BY NAME 24 24 ; THE XPATH ARRAY XPARY, PASSED BY NAME … … 82 82 Q 83 83 ; 84 PARSE(INXML,INDOC) 84 PARSE(INXML,INDOC) ;CALL THE MXML PARSER ON INXML, PASSED BY NAME 85 85 ; INDOC IS PASSED AS THE DOCUMENT NAME - DON'T KNOW WHERE TO STORE THIS NOW 86 86 ; EXTRINSIC WHICH RETURNS THE DOCID ASSIGNED BY MXML … … 88 88 Q $$EN^MXMLDOM(INXML,"W") 89 89 ; 90 ISMULT(ZOID) 90 ISMULT(ZOID) ; RETURN TRUE IF ZOID IS ONE OF A MULTIPLE 91 91 N ZN 92 92 ;I $$TAG(ZOID)["entry" B … … 95 95 Q 0 96 96 ; 97 FIRST(ZOID) 97 FIRST(ZOID) ;RETURNS THE OID OF THE FIRST CHILD OF ZOID 98 98 Q $$CHILD^MXMLDOM(C0CDOCID,ZOID) 99 99 ; 100 PARENT(ZOID) 100 PARENT(ZOID) ;RETURNS THE OID OF THE PARENT OF ZOID 101 101 Q $$PARENT^MXMLDOM(C0CDOCID,ZOID) 102 102 ; 103 ATT(RTN,NODE) 103 ATT(RTN,NODE) ;GET ATTRIBUTES FOR ZOID 104 104 S HANDLE=C0CDOCID 105 105 K @RTN … … 107 107 Q 108 108 ; 109 TAG(ZOID) 109 TAG(ZOID) ; RETURNS THE XML TAG FOR THE NODE 110 110 ;I ZOID=149 B ;GPLTEST 111 111 N X,Y … … 116 116 Q Y 117 117 ; 118 NXTSIB(ZOID) 118 NXTSIB(ZOID) ; RETURNS THE NEXT SIBLING 119 119 Q $$SIBLING^MXMLDOM(C0CDOCID,ZOID) 120 120 ; 121 DATA(ZT,ZOID) 121 DATA(ZT,ZOID) ; RETURNS DATA FOR THE NODE 122 122 ;N ZT,ZN S ZT="" 123 123 ;S C0CDOM=$NA(^TMP("MXMLDOM",$J,C0CDOCID)) … … 126 126 Q 127 127 ; 128 OUTXML(ZRTN,INID,NO1ST) 128 OUTXML(ZRTN,INID,NO1ST) ; USES C0CMXMLB (MXMLBLD) TO OUTPUT XML FROM AN MXMLDOM 129 129 ; 130 130 S C0CDOCID=INID … … 137 137 Q 138 138 ; 139 NDOUT(ZOID) 139 NDOUT(ZOID) ;CALLBACK ROUTINE - IT IS RECURSIVE 140 140 N ZI S ZI=$$FIRST(ZOID) 141 141 I ZI'=0 D ; THERE IS A CHILD
Note:
See TracChangeset
for help on using the changeset viewer.