J'ai testé le fichier <Mame.xml> de 34 Mo (tout de même) directement avec la lib EXPAT.
Et de cette façon, je ne rencontre pas le problème décrit dans le premier post.
Code : Tout sélectionner
;======================================================================
;
; Dépendances:
;
; 1. Mame.xml [Voir indications de Thyphoon]
; 2. libexpat.lib [http://sourceforge.net/projects/expat/]
; 3. libexpat.dll [http://sourceforge.net/projects/expat/]
;
;======================================================================
Structure XML_ATTRIBUTES
StructureUnion
*addr
name.STRING
EndStructureUnion
value.STRING
EndStructure
ImportC "libexpat.lib"
XML_ParserCreate(*encoding)
XML_ParserFree(*parser)
XML_Parse(*parser, xml.s, length.l, isFinal.l)
XML_SetStartElementHandler(*parser, *XML_StartElementHandler)
EndImport
;======================================================================
ProcedureC my_StartElementHandler(*userData, elementName.s, *attributes.XML_ATTRIBUTES)
Protected attrName.s, attrValue.s
Protected name.s, sourceFile.s, isBios.s, runnable.s, cloneOf.s, romOf.s, sampleOf.s
If elementName = "game"
While *attributes\addr
attrName = *attributes\name\s
attrValue = *attributes\value\s
Select attrName
Case "name": name = attrValue
Case "sourcefile": sourceFile = attrValue
Case "isbios": isBios = attrValue
Case "runnable": runnable = attrValue
Case "cloneof": cloneOf = attrValue
Case "romof": romOf = attrValue
Case "sampleof": sampleOf = attrValue
EndSelect
*attributes + 8
Wend
If runnable = "yes" And cloneOf = "" And (isBios = "no" Or isBios = "")
Debug name
EndIf
EndIf
EndProcedure
If OpenFile(0, "Mame.xml")
*parser = XML_ParserCreate(0)
If *parser
XML_SetStartElementHandler(*parser, @my_StartElementHandler())
While Not Eof(0)
lineStr.s = ReadString(0)
lineLen.l = Len(lineStr)
XML_Parse(*parser, lineStr, lineLen, #False)
Wend
XML_ParserFree(*parser)
EndIf
CloseFile(0)
EndIf