Changeset 1586 for ccr/trunk/p/C0CDOM.m
- Timestamp:
- Oct 30, 2012, 1:11:02 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/C0CDOM.m
r1544 r1586 1 C0CDOM ; GPL - DOM PROCESSING ROUTINES ;6/6/11 17:05 2 ;;1.2;C0C;;May 11, 2012;Build 47 3 ;Copyright 2011 George Lilly. Licensed under the terms of the GNU 4 ;General Public License See attached copy of the License. 5 ; 6 ;This program is free software; you can redistribute it and/or modify 7 ;it under the terms of the GNU General Public License as published by 8 ;the Free Software Foundation; either version 2 of the License, or 9 ;(at your option) any later version. 10 ; 11 ;This program is distributed in the hope that it will be useful, 12 ;but WITHOUT ANY WARRANTY; without even the implied warranty of 13 ;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 ;GNU General Public License for more details. 15 ; 16 ;You should have received a copy of the GNU General Public License along 17 ;with this program; if not, write to the Free Software Foundation, Inc., 18 ;51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 ; 20 Q 21 ; 22 DOMO(ZOID,ZPATH,ZNARY,ZXIDX,ZXPARY,ZNUM,ZREDUX) ; RECURSIVE ROUTINE TO POPULATE 1 C0CDOM ; GPL - DOM PROCESSING ROUTINES ;6/6/11 17:05 2 ;;1.2;CCD/CCR GENERATION UTILITIES;;Oct 30, 2012;Build 50 3 ;Copyright 2011 George Lilly. 4 ; 5 ; This program is free software: you can redistribute it and/or modify 6 ; it under the terms of the GNU Affero General Public License as 7 ; published by the Free Software Foundation, either version 3 of the 8 ; License, or (at your option) any later version. 9 ; 10 ; This program is distributed in the hope that it will be useful, 11 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 12 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 ; GNU Affero General Public License for more details. 14 ; 15 ; You should have received a copy of the GNU Affero General Public License 16 ; along with this program. If not, see <http://www.gnu.org/licenses/>. 17 ; 18 ; 19 Q 20 ; 21 DOMO(ZOID,ZPATH,ZNARY,ZXIDX,ZXPARY,ZNUM,ZREDUX) ; RECURSIVE ROUTINE TO POPULATE 23 22 ; THE XPATH INDEX ZXIDX, PASSED BY NAME 24 23 ; THE XPATH ARRAY XPARY, PASSED BY NAME … … 82 81 Q 83 82 ; 84 PARSE(INXML,INDOC) 83 PARSE(INXML,INDOC) ;CALL THE MXML PARSER ON INXML, PASSED BY NAME 85 84 ; INDOC IS PASSED AS THE DOCUMENT NAME - DON'T KNOW WHERE TO STORE THIS NOW 86 85 ; EXTRINSIC WHICH RETURNS THE DOCID ASSIGNED BY MXML … … 88 87 Q $$EN^MXMLDOM(INXML,"W") 89 88 ; 90 ISMULT(ZOID) 89 ISMULT(ZOID) ; RETURN TRUE IF ZOID IS ONE OF A MULTIPLE 91 90 N ZN 92 91 ;I $$TAG(ZOID)["entry" B … … 95 94 Q 0 96 95 ; 97 FIRST(ZOID) 96 FIRST(ZOID) ;RETURNS THE OID OF THE FIRST CHILD OF ZOID 98 97 Q $$CHILD^MXMLDOM(C0CDOCID,ZOID) 99 98 ; 100 PARENT(ZOID) 99 PARENT(ZOID) ;RETURNS THE OID OF THE PARENT OF ZOID 101 100 Q $$PARENT^MXMLDOM(C0CDOCID,ZOID) 102 101 ; 103 ATT(RTN,NODE) 102 ATT(RTN,NODE) ;GET ATTRIBUTES FOR ZOID 104 103 S HANDLE=C0CDOCID 105 104 K @RTN … … 107 106 Q 108 107 ; 109 TAG(ZOID) 108 TAG(ZOID) ; RETURNS THE XML TAG FOR THE NODE 110 109 ;I ZOID=149 B ;GPLTEST 111 110 N X,Y … … 116 115 Q Y 117 116 ; 118 NXTSIB(ZOID) 117 NXTSIB(ZOID) ; RETURNS THE NEXT SIBLING 119 118 Q $$SIBLING^MXMLDOM(C0CDOCID,ZOID) 120 119 ; 121 DATA(ZT,ZOID) 120 DATA(ZT,ZOID) ; RETURNS DATA FOR THE NODE 122 121 ;N ZT,ZN S ZT="" 123 122 ;S C0CDOM=$NA(^TMP("MXMLDOM",$J,C0CDOCID)) … … 126 125 Q 127 126 ; 128 OUTXML(ZRTN,INID,NO1ST) 127 OUTXML(ZRTN,INID,NO1ST) ; USES C0CMXMLB (MXMLBLD) TO OUTPUT XML FROM AN MXMLDOM 129 128 ; 130 129 S C0CDOCID=INID … … 137 136 Q 138 137 ; 139 NDOUT(ZOID) 138 NDOUT(ZOID) ;CALLBACK ROUTINE - IT IS RECURSIVE 140 139 N ZI S ZI=$$FIRST(ZOID) 141 140 I ZI'=0 D ; THERE IS A CHILD
Note:
See TracChangeset
for help on using the changeset viewer.