[630] | 1 | C0CMXP ; GPL - MXML based XPath utilities;12/04/09 17:05
|
---|
| 2 | ;;0.1;C0C;nopatch;noreleasedate
|
---|
| 3 | ;Copyright 2009 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 | MKTPLATE(INXML,OUTT) ;MAKE A TEMPLATE FROM INXML, RETURNED IN OUTT
|
---|
| 23 | ; BOTH PASSED BY NAME
|
---|
| 24 | ;
|
---|
| 25 | S C0CDOCID=$$PARSE(INXML,"C0CMKT")
|
---|
| 26 | S C0CDOM=$NA(^TMP("MXMLDOM",$J,C0CDOCID))
|
---|
| 27 | N ZI S ZI=""
|
---|
| 28 | F S ZI=$O(@C0CDOM@(ZI)) Q:ZI="" D ; FOR EACH NODE IN THE DOM
|
---|
| 29 | . W !,ZI,$$TAG(ZI)
|
---|
| 30 | Q
|
---|
| 31 | ;
|
---|
| 32 | UPDIE ; INTERNAL ROUTINE TO CALL UPDATE^DIE AND CHECK FOR ERRORS
|
---|
| 33 | K ZERR
|
---|
| 34 | D CLEAN^DILF
|
---|
| 35 | D UPDATE^DIE("","C0CFDA","","ZERR")
|
---|
| 36 | I $D(ZERR) D ;
|
---|
| 37 | . W "ERROR",!
|
---|
| 38 | . ZWR ZERR
|
---|
| 39 | . B
|
---|
| 40 | K C0CFDA
|
---|
| 41 | Q
|
---|
| 42 | ;
|
---|