;; | ----------------------------------------------------------------------------- ;; | TX_ExtractXML ;; | ----------------------------------------------------------------------------- ;; | Function : Reads an XML file and extracts a complete section info ;; | Argument : 'Lst' - XML file list ;; | 'Section' - Section Name to read ;; | 'Multiple' - Read Multiple sections or not (T or nil) ;; | Return :" ;; | Update : March 12, 2009 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ----------------------------------------------------------------------------- (defun TX_ExtractXML ( Lst Section Multiple / itm len len1 cnt More tmp Found Comment _SectionSt _SectionStP _SectionEn SectionLst ) (setq len (length Lst) tmp (strcat " of " (itoa len)) cnt 0 More T Found nil Comment nil _SectionSt (strcase Section) _SectionStP (strcat (substr _SectionSt 1 (1- (strlen _SectionSt))) " " ) ; Part of SectionSt, without the '>' but with an trailing space _SectionEn (strcat "= len1 4) (progn (if (= (substr itm 1 4) "") (setq Comment nil) ) )) )) (if (= cnt len) (progn (if SectionLst (setq SectionLst (cons itm SectionLst) SectionLst (reverse SectionLst) SectionLstBig (append SectionLstBig (list SectionLst)) )) (setq More nil) )) ) SectionLstBig )