Alles anzeigenIch hab eben schnell ne Funktion gebastelt welche das ganze in ne angenehmerer Datenstruktur einliest...
Spoiler anzeigen
[autoit]Local $sRawData = FileRead("test.xsd")
[/autoit] [autoit][/autoit] [autoit]$oFile = _ParseXSD($sRawData)
[/autoit] [autoit][/autoit] [autoit]For $ComplexType In $oFile ; alle ComplexTypes durchlaufen
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$oElementList = $oFile($ComplexType)
ConsoleWrite($ComplexType & @LF)
For $Element In $oElementList ; alle Elemente des Complextypes durchlaufen
$name = $Element
$type = $oElementList($Element)
ConsoleWrite(@TAB & "name: " & $name & @TAB & "type:" & $type & @LF)
Next
NextFunc _ParseXSD($sData)
[/autoit]
Local $oResult = ObjCreate("Scripting.Dictionary"), $oSubResult = ObjCreate("Scripting.Dictionary"), $aElements
$aComplexTypes = StringRegExp($sRawData, '(?ms):complexType name="(.+?)">(.+?)<\/xs:complexType', 3)
If @error Or Mod(UBound($aComplexTypes), 2) > 0 Then Return SetError(1)
For $i = 0 To UBound($aComplexTypes) - 1 Step +2
$aElements = StringRegExp($aComplexTypes[$i + 1], '"(.+?)"', 3)
If @error Or Mod(UBound($aElements), 2) > 0 Then Return SetError(2)
$oSubResult.RemoveAll
For $y = 0 To UBound($aElements) - 1 Step +2
$oSubResult.add($aElements[$y], $aElements[$y + 1])
Next
$oResult.add($aComplexTypes[$i], $oSubResult)
Next
Return $oResult
EndFunc ;==>_ParseXSD
Hey Christoph,
Gefällt mir auch gut Und da das Scripting Dictonary ja sogar schneller als Arrays sind, passt mir das ganz gut - danke dir
Gruß,
Spider