1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: t_xml1.inc,v $
13 '* last change: $Author: jsi $ $Date: 2008-06-13 10:27:09 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* Owner : helge.delfs@sun.com
36 '* short description : simple XML-Parser for XML-Files from Registration-Database and Routines to work with SAX-Parser in Testtool
38 '***********************************************************************************
40 ' #1 hXMLGetFirstCharsForElement
47 ' #1 GetXMLValueGlobal
48 ' #1 GetExtractXMLValue
49 ' #1 GetExtractXMLValueList
50 ' #1 GetExtractXMLValueFromList
51 ' #1 hXMLSeekElementInTree
52 '\**********************************************************************************
54 function hXMLGotoElement ( sElementLine as String, optional bSilent as boolean) as boolean
55 '/// uses SAX Interface in testtool ///'
56 '///hXMLGotoElement ( sElementLine as String )
57 '///+Input : sElementLine => the tree in DOM as one string seperated with ';'
58 '///+ - - - - - to be more exact, the Attribute Values to 'oor:name' ///'
59 '///+ - - - -: bSilent => print warnings? ///'
61 '///+Return : was the Element found?
62 '///- you can jump directly to the correct entry in the DOM-tree
64 Dim sList (50) as String
71 dim bFoundCollect as boolean
72 dim iAttrCount as integer
73 dim bLocalSilent as boolean
75 if (isMissing(bSilent)) then
78 bLocalSilent = bSilent
82 ExtractSections ( sElementLine, sList () )
84 for i=1 to ListCount ( sList () ) ' for every Section
85 iMax = SAXGetChildCount()
88 ' ' ------------ debug start ----------------------
91 ' Printlog " " + i + ":(" + n + "/" + iMax + "): '" + SAXGetElementName
92 ' iAttrCount = SAXGetAttributeCount
93 ' for y = 1 to iAttrCount
94 ' Printlog " " + i + ":" + n + ":(" + y + "/" + iAttrCount + "): '"+SAXGetAttributeName (y) +"' : '"+SAXGetAttributeValue (y) +"' "
98 ' ' ------------- debug end -----------------------
99 while ((bFound = FALSE) AND (x < iMax)) ' compare the VALUE for the ATTRIBUTE 'oor:name' with the wanted ITEM
100 inc(x) ' do it until it fits; else print warnlog
102 if (SAXGetAttributeValue ("oor:name") <> sList (i)) then
108 if ((bFound = FALSE) AND (bSilent = FALSE)) then
109 Warnlog "hXMLGotoElement::ERROR! Element " + i + ": '" + sList (i) + "' not found :-("
111 bFoundCollect = bFound AND bFoundCollect
113 hXMLGotoElement = bFoundCollect
116 '-------------------------------------------------------------------------------
118 function hXMLGetFirstCharsForElement ( sElementLine as String, optional sXMLFile as String, optional bClose as Boolean ) as String
119 '/// uses SAX Interface in testtool ///'
120 Dim bCloseLocal as Boolean
121 '///hXMLGetFirstCharsForElement ( sElementLine as String, optional sXMLFile as String, optional bClose as Boolean ) as String
122 '///+Input : sElementLine => the tree in DOM as one string seperated with ';'
123 '///+- sXMLFile => ( optional ) if you want to open the DOM for a file you can set here the filename
124 '///+- bClose => ( optional ) if you want to close the DOM after getting the char, you can set this to TRUE ( default is FALSE )
126 '///+Return : the string for the element
127 '///- you can jump directly to the correct entry in the DOM-tree and get the char for that entry
128 '///- the DOM is closed after this return
130 if IsMissing( sXMLFile ) = FALSE then
131 SAXReadFile ( sXMLFile )
134 if IsMissing( bClose ) = TRUE then
140 hXMLGotoElement ( sElementLine )
142 if SAXGetNodeType = NodeTypeCharacter then
143 hXMLGetFirstCharsForElement = SAXGetChars
145 Warnlog "hXMLGetFirstCharsForElement : the element " + sElementLine + " has no chars"
146 hXMLGetFirstCharsForElement = ""
149 if bCloseLocal = TRUE then SAXRelease
152 '-------------------------------------------------------------------------------
154 function ExtractSections ( sInput as String, lsXMLsections() as String ) as Integer
155 '///Input : - sInput => a full section seperated with ';'
156 '///+- lsXMLsections => an empty list
157 '///+Output : the list ( lxXMLsections ) with seperated sectionnames
158 '///+Return : number of sections
160 Dim ii, iLen as Integer
161 Dim iList ( 50 ) as String
162 Dim bFirstEntry as Boolean
168 iLen = len ( sInput )
172 Dummy = mid ( sInput, ii, 1 )
173 if ( mid ( sInput, ii, 1 ) ) = ";" then ListAppend ( iList(), Str ( ii ) )
176 for ii=1 to ( ListCount ( iList () ) )
177 if bFirstEntry = TRUE then
178 ListAppend ( lsXMLsections(), Left ( sInput, Val(iList(1))-1 ) )
181 Dummy = mid ( sInput, Val(iList(ii))+1, Val(iList(ii+1))-Val(iList(ii))-1 )
182 ListAppend ( lsXMLsections(), Dummy )
185 sTemp = ListCount ( lsXMLsections() )
186 ExtractSections = sTemp
188 ListAppend (lsXMLsections(), sInput)
193 '-------------------------------------------------------------------------------
195 function GetXMLValue ( sXMLfile as String, sXMLsectionMaster as String, sXMLsection as String, optional bSilent as Boolean ) as String
196 '/// Input : - sXMLfile => Filename with full path ///
197 '///+ - - - - - sXMLsectionMaster => the master-section ( mostly in StarOffice the filename without extension ) ///
198 '///+ - - - - - sXMLsection => full way to the item ///
199 '///+ Output : - - ///
200 '///+ Return : - the value ///
201 '/// wraper for GetXMLValueGlobal ///'
202 if IsMIssing ( bSilent ) <> TRUE then
203 GetXMLValue = GetXMLValueGlobal ( sXMLfile, sXMLsectionMaster, sXMLsection, , , , bSilent )
205 GetXMLValue = GetXMLValueGlobal ( sXMLfile, sXMLsectionMaster, sXMLsection, , , , )
209 function GetXMLTagValue ( sXMLfile as String, sXMLsectionMaster as String, sXMLsection as String, sValue as String ) as String
210 '/// Input : - sXMLfile => Filename with full path ///
211 '///+ - - - - - sXMLsectionMaster => the master-section ( mostly in StarOffice the filename without extension ) ///
212 '///+ - - - - - sXMLsection => full way to the item ///
213 '///+ Output : - - ///
214 '///+ Return : - the value ///
215 '/// wraper for GetXMLValueGlobal ///'
216 GetXMLTagValue = GetXMLValueGlobal ( sXMLfile, sXMLsectionMaster, sXMLsection, ,sValue , , )
219 function GetXMLValueList ( lsXMLValue() as String, sXMLfile as String, sXMLsectionMaster as String, sXMLsection as String ) as String
220 '/// Input : - sXMLfile => Filename with full path ///
221 '///+ - - - - - sXMLsectionMaster => the master-section ( mostly in StarOffice the filename without extension ) ///
222 '///+ - - - - - sXMLsection => full way to the item ///
223 '///+ Output : - - ///
224 '///+ Return : - the value ///
225 '/// wraper for GetXMLValueGlobal ///'
226 Dim sLine, sLine1 as String
227 Dim i, iCounter as Integer
229 sLine = GetXMLValueGlobal ( sXMLfile, sXMLsectionMaster, sXMLsection, ,"cfg:value" , TRUE, )
233 GetXMLValueList = GetExtractXMLValueList ( lsXMLValue(), sLine, , )
237 '-------------------------------------------------------------------------------
239 function GetXMLValueType ( sXMLfile as String, sXMLsectionMaster as String, sXMLsection as String, optional sType ) as String
240 '/// Input : - sXMLfile => Filename with full path ///
241 '///+ - - - - - sXMLsectionMaster => the master-section ( mostly in StarOffice the filename without extension ) ///
242 '///+ - - - - - sXMLsection => full way to the item ///
243 '///+ Output : - - ///
244 '///+ Return : - the value ///
245 '/// wraper for GetXMLValueGlobal ///'
247 if IsMissing ( sType ) = TRUE then
253 GetXMLValueGlobal ( sXMLfile, sXMLsectionMaster, sXMLsection, sDummy, , , )
254 GetXMLValueType = sDummy
257 function GetXMLValueLine ( sXMLfile as String, sXMLsectionMaster as String, sXMLsection as String ) as String
258 '/// Input : - sXMLfile => Filename with full path ///
259 '///+ - - - - - sXMLsectionMaster => the master-section ( mostly in StarOffice the filename without extension ) ///
260 '///+ - - - - - sXMLsection => full way to the item ///
261 '///+ Output : - - ///
262 '///+ Return : - the value ///
263 '/// wraper for GetXMLValueGlobal ///'
264 GetXMLValueLine = GetXMLValueGlobal ( sXMLfile, sXMLsectionMaster, sXMLsection,,, TRUE, )
267 '-------------------------------------------------------------------------------
269 function GetXMLValueGlobal ( sXMLfile as String, sXMLsectionMaster as String, sXMLsection as String, optional sXMLType, optional sXMLTag, optional biWholeLine, optional bSil as Boolean ) as String
270 '/// uses no SAX Parser : just text search in the file ///'
271 '/// You can get the value of an item in a XML-file. The value of the item must be set between <value> and <value/>. ///
272 '///+ The item can be written in one line or in more lines. ///
273 '/// Input : - sXMLfile => Filename with full path ///
274 '///+ - - - - - sXMLsectionMaster => the master-section ( mostly in StarOffice the filename without extension ) ///
275 '///+ - - - - - sXMLsection => full way to the item ///'
276 '///+ - - - - - optional sXMLType => if you want to get the XML-Type this variable must be set ///'
277 '///+ - - - - - optional sXMLTag => if sXMLTag isn't set, "value" is the tag, else you must set the tag here ///'
278 '///+ Output : - optional sXMLType => if sXMLType is set, it will be returned the Type of the value as string ///'
279 '///+ Return : - the value of the searched item ///'
280 ' Dim FileNum as Integer
281 Dim Pos, iSec, i, j, iDum as Integer
282 Dim MasterSecOK, MasterSecEnd, SecOK, SecEnd, bThrough, bWholeLine as Boolean
283 Dim xmlZeile, xmlZeile2, sVariable, sDummy, sDummy2 as String
284 Dim lsSecList ( 1000 ) as String
285 Dim lsInterim ( 1000 ) as String
286 Dim textin as object, sfa as object, xInput as object
287 Dim bSilent as Boolean
289 if ( IsMissing ( bSil ) ) = TRUE then
295 if ( IsMissing ( biWholeLine ) ) = TRUE then
301 if Dir( sXMLfile ) = "" then
302 if bSilent = FALSE then Warnlog "GetXMLValueGlobal(...) : " + sXMLfile + " is missing!"
306 MasterSecOK = FALSE : MasterSecEND = FALSE
307 SecOK=FALSE : SecEND=FALSE
310 GetXMLValueGlobal = ""
315 iSec = ExtractSections ( sXMLsection, lsSecList () )
316 sVariable = lsSecList (iSec)
317 ListDelete ( lsSecList(), iSec )
319 if iSec = 0 then ListAppend ( lsSecList(), "" )
321 textin = createUnoService( "com.sun.star.io.TextInputStream" )
322 textin.setEncoding("utf8")
323 sfa = createUnoService( "com.sun.star.ucb.SimpleFileAccess" )
324 xInput = sfa.openFileRead( sXMLfile )
325 textin.setInputStream( xInput )
327 do until textin.isEOF()
328 xmlZeile = textin.readLine()
330 xmlZeile = TrimTab ( Trim ( xmlZeile ) )
331 xmlZeile2 = lCASE( xmlZeile ) ' control case-insensitiv
333 if MasterSecOK = FALSE then ' master-section ( com.sun.star. ... )
334 if xmlZeile2= "<" + lCASE( sXMLsectionMaster ) + ">" OR Instr ( xmlZeile2, "<" + lCASE( sXMLsectionMaster ) + " " ) <> 0 then
337 if xmlZeile2 = "<" + lCASE( sXMLsectionMaster ) + "/>" then
338 if bSilent = FALSE then warnlog "GetXMLValueGlobal(...) : '" + sXMLsectionMaster + "' -> master-section has no entries!"
343 if xmlZeile2= "</" + lCASE( sXMLsectionMaster ) + ">" OR xmlZeile2= "<" + lCASE( sXMLsectionMaster ) + "/>" then
344 if bSilent = FALSE then warnlog "GetXMLValueGlobal(...) : '" + lsSecList (Pos) + "' -> entry could not be found!"
348 if ( Instr (xmlZeile2, lCASE ( "<" + lsSecList (Pos)) ) <> 0 AND iSec > 0 ) AND Pos < iSec+1 then
349 iDum = Instr ( lsSecList (Pos), " " )
350 if iDum <> 0 then lsSecList(Pos) = Left ( lsSecList(Pos), iDum -1 )
351 if xmlZeile2 = "<" + lCASE( lsSecList (Pos) ) + "/>" then
353 if bSilent = FALSE then Warnlog "GetXMLValueGlobal(...) : '" + svariable + "' -> entry could not be found"
355 if bSilent = FALSE then Warnlog "GetXMLValueGlobal(...) : '" + lsSecList (Pos) + "' -> entry could not be found"
363 sDummy2 = Mid ( xmlZeile2, 2, len ( svariable ) + 1 )
364 if sDummy2 = lCase ( svariable ) + ">" OR sDummy2 = lCase ( svariable ) + " " OR bThrough = TRUE then
365 iDum = Instr ( svariable, " " ) ' inserted because an error in GetXMLValueLineExtra 3.11.00 (TZ)
366 if iDum <> 0 then svariable = Left ( svariable, iDum -1 ) ' inserted because an error in GetXMLValueLineExtra 3.11.00 (TZ)
367 sDummy = Mid ( xmlZeile2, len ( xmlZeile2 ) - 1 - len ( svariable), len ( svariable)+1 )
368 if ( bThrough = FALSE AND ( sDummy = "/" + lCase ( svariable ) OR Right (sDummy, 1 ) = "/" ) ) OR ( bThrough = TRUE AND sDummy = "/" + lCase ( svariable ) ) then
369 if ListCount ( lsInterim () ) = 0 then
370 if bWholeLine = TRUE then
371 GetXMLValueGlobal = xmlZeile
373 if ( IsMissing ( sXMLTag ) ) = TRUE then
374 if ( IsMissing ( sXMLType ) ) = TRUE then
375 GetXMLValueGlobal = GetExtractXMLValue ( xmlZeile,, )
377 GetXMLValueGlobal = GetExtractXMLValue ( xmlZeile, sXMLType, )
380 if ( IsMissing ( sXMLType ) ) = TRUE then
381 GetXMLValueGlobal = GetExtractXMLValue ( xmlZeile,, sXMLTag )
383 GetXMLValueGlobal = GetExtractXMLValue ( xmlZeile, sXMLType, sXMLTag )
388 ListAppend ( lsInterim (), xmlZeile2 )
389 if bWholeLine = TRUE then
390 for j=1 to ListCount ( lsInterim () )
391 GetXMLValueGlobal = GetXMLValueGlobal + lsInterim (j)
394 if ( IsMissing ( sXMLTag ) ) = TRUE then
395 if ( IsMissing ( sXMLType ) ) = TRUE then
396 GetXMLValueGlobal = GetExtractXMLValueFromList ( lsInterim (),, )
398 GetXMLValueGlobal = GetExtractXMLValueFromList ( lsInterim (), sXMLType, )
401 if ( IsMissing ( sXMLType ) ) = TRUE then
402 GetXMLValueGlobal = GetExtractXMLValueFromList ( lsInterim (),, sXMLTag )
404 GetXMLValueGlobal = GetExtractXMLValueFromList ( lsInterim (), sXMLType, sXMLTag )
412 if xmlZeile2 <> "" then
414 ListAppend ( lsInterim (), xmlZeile2 )
423 xInput.closeInput '* uno-file-close
425 if bSilent = FALSE then
426 if MasterSecOK = FALSE then warnlog "GetXMLValueGlobal (...) : '" + sXMLsectionMaster + "' -> Master-section was not found!"
431 '-------------------------------------------------------------------------------
433 function GetExtractXMLValue ( sFullLine as String, optional sXMLType, optional sXMLTag ) as String
434 '/// Get the value-string, when the text is only in one line. ///'
435 '/// Input : - sFullLine => the whole line out of XML-File ///'
436 '/// Output : - optional sXMLType => if sXMLType is set, it will be returned the Type of the value as string ///'
437 '/// Return : - the text between <value> and <value/> ///'
438 Dim i, ii, iStart, iEnd as Integer
439 Dim sInterim, ssTag as String
441 if ( IsMissing ( sXMLTag ) ) = TRUE then
447 sInterim = lCase ( sFullLine )
449 if InStr ( sInterim, "<" + ssTag + "/>" ) <> 0 then
450 GetExtractXMLValue = ""
452 iStart = InStr ( sInterim, "<" + ssTag + ">" )
453 iEnd = InStr ( sInterim, "</" + ssTag + ">" )
454 if iStart <> 0 AND iEnd <> 0 then
455 if iStart + len(ssTag) + 2 = iEnd then
456 GetExtractXMLValue = ""
458 GetExtractXMLValue = Mid ( sFullLine, iStart + len ( ssTag )+2, iEnd - iStart - len ( ssTag ) - 2 )
463 if ( IsMissing ( sXMLType ) ) = FALSE then
464 sXMLType = lcase (sXMLType)
465 ii = InStr ( sInterim, sXMLType + "=" )
466 if ii = 0 then ii = InStr ( sInterim, sXMLType + " =" )
467 if ii = 0 then ii = InStr ( sInterim, sXMLType + " =" )
472 for i=ii to len ( sInterim ) - ii
473 if Mid ( sInterim, i, 1 ) = chr (34) then
478 for i=(iStart+1) to len ( sInterim ) - (iStart+1)
479 if Mid ( sInterim, i, 1 ) = chr (34) then
484 sXMLType = Mid ( sFullLine, iStart+1, iEnd-iStart-1 )
490 '-------------------------------------------------------------------------------
492 function GetExtractXMLValueList ( lsXMLValues (), sFullLine as String, optional sXMLType, optional sXMLTag ) as Integer
493 '/// Get the value-string, when the text is only in one line ///'
497 Dim i, ii, iStart, iEnd as Integer
498 Dim sInterim, ssTag as String
502 if ( IsMissing ( sXMLTag ) ) = TRUE then
508 sInterim = lCase ( sFullLine )
509 ii = len( sInterim ) / len ( ssTag ) ' maximal so viele Wiederholungen, wie es sTags gibt
512 if InStr ( sInterim, "<" + ssTag + "/>" ) = 0 then
513 iStart = InStr ( sInterim, "<" + ssTag + ">" )
514 iEnd = InStr ( sInterim, "</" + ssTag + ">" )
515 if iStart <> 0 AND iEnd <> 0 then
516 if iStart + len(ssTag) + 2 = iEnd then
517 ListAppend ( lsXMLValues(), "" )
518 sInterim = Mid ( sInterim, iEnd + len (ssTag)+2, len (sInterim) - iEnd - len (ssTag) - 1 - 2 )
520 ListAppend ( lsXMLValues(), Mid ( sInterim, iStart + len(ssTag)+2, iEnd - iStart - len(ssTag)-2 ) )
521 sInterim = Mid ( sInterim, iEnd + len (ssTag), len (sInterim) - iEnd - len (ssTag) - 1 )
528 GetExtractXMLValueList = ListCount ( lsXMLValues() )
530 if ( IsMissing ( sXMLType ) ) = FALSE then
531 sXMLType = lcase (sXMLType)
532 ii = InStr ( sInterim, sXMLType + "=" )
533 if ii = 0 then ii = InStr ( sInterim, sXMLType + " =" )
534 if ii = 0 then ii = InStr ( sInterim, sXMLType + " =" )
539 for i=ii to len ( sInterim ) - ii
540 if Mid ( sInterim, i, 1 ) = chr (34) then
545 for i=(iStart+1) to len ( sInterim ) - (iStart+1)
546 if Mid ( sInterim, i, 1 ) = chr (34) then
551 sXMLType = Mid ( sFullLine, iStart+1, iEnd-iStart-1 )
557 '-------------------------------------------------------------------------------
559 function GetExtractXMLValueFromList ( lsList() as String, optional sXMLType, optional sXMLTag ) as String
560 '/// Get the value-string, when the text is in a list ( when the item is written in more than one line ). ///'
561 '/// Input : - lsList() => the list of the whole entry of the xml-item ///'
562 '/// Output : - optional sXMLType => if sXMLType is set, it will be returned the Type of the value as string ///'
563 '/// Return : - the text between <value> and <value/> ///'
564 Dim i, ii, iStart, iEnd as Integer
565 Dim sInterim, sInterim1, ssTag as String
567 if ( IsMissing ( sXMLTag ) ) = TRUE then
573 for i=1 to ListCount ( lsList() )
574 sInterim1 = sInterim1 + lsList(i)
577 sInterim = lCase ( sInterim1 )
579 if InStr ( sInterim, "<"+ ssTag +"/>" ) <> 0 then
580 GetExtractXMLValueFromList = ""
582 iStart = InStr ( sInterim, "<" + ssTag + ">" )
583 iEnd = InStr ( sInterim, "</" + ssTag + ">" )
584 if iStart <> 0 AND iEnd <> 0 then
585 if iStart + len(ssTag) + 2 = iEnd then
586 GetExtractXMLValueFromList = ""
588 GetExtractXMLValueFromList = Mid ( sInterim1, iStart + len ( ssTag )+2, iEnd - iStart - len ( ssTag ) - 2 )
593 if ( IsMissing ( sXMLType ) ) = FALSE then
594 sXMLType = lcase (sXMLType)
595 ii = InStr ( sInterim, sXMLType + "=" )
596 if ii = 0 then ii = InStr ( sInterim, sXMLType + " =" )
597 if ii = 0 then ii = InStr ( sInterim, sXMLType + " =" )
602 for i=ii to len ( sInterim ) - ii
603 if Mid ( sInterim, i, 1 ) = chr (34) then
608 for i=(iStart+1) to len ( sInterim ) - (iStart+1)
609 if Mid ( sInterim, i, 1 ) = chr (34) then
614 sXMLType = Mid ( sInterim1, iStart+1, iEnd-iStart-1 )
619 '-----------------------------------------------------------------------------
621 function hXMLSeekElementInTree ( sSeekThisNodeXML as STRING ) as BOOLEAN
622 hXMLSeekElementInTree = FALSE
623 ' Peter Junge: 2005-07-29
624 '///<u><b>Recursion to find XML element</b></u>///
625 '///Input: 'sSeekThisNodeXML' - XML element to seek, e.g. 'foo:bar'///
626 '///(A XML DOM has to be loaded before)///
627 '///Seek begins at current XML pointer///
628 '///Return: TRUE if element was found, else FALSE///
629 '///BEHAVIOUR: XML pointer is set to 'foo:bar' if found, if not XML pointer is reset to initial element///
630 '///NOTE: Currently only the first appearence of 'foo:bar' is found.///
631 '///NOTE: If e.g. the Nth element should be found you have to modify this function///
632 '///NOTE: There should be further enhancements possible, e.g. find element with specific attribute///
633 dim iIndex as INTEGER
634 '///<ul><li>Check if current node matches 'sSeekThisNodeXML'</li>///
635 if SAXGetElementName() = sSeekThisNodeXML then
636 '///<li>MATCH: Function returns TRUE</li>///
637 hXMLSeekElementInTree = TRUE
639 '///<li>NO MATCH: LOOKUP if current node has elements</li>///
640 for iIndex = 1 to SAXGetChildCount()
641 '///<li>-> (Loop) Set pointer on child</li>///
642 SAXSeekElement ( iIndex )
643 '///<li>-> Check if child is a XML element</li>///
644 if SAXGetNodeType() = 556 then
645 '///<li>-> RECURSION: function recalls itself for current element</li>///
646 if hXMLSeekElementInTree ( sSeekThisNodeXML ) = TRUE then
647 '///<li>Don't forget to pass back the result TRUE to recursions parent</li>///
648 hXMLSeekElementInTree = TRUE
649 '///<li>Exit loop if found</li>///
653 '///<li>NO MATCH: Go back to parent in DOM tree</li></ul>///