Bonjour à tous,
J'ai un probleme avec des tableau de tableau ,je galere depuis une eternité
je vais finir par devenir cinglé !!!!
Je m'explique :
Je dois ecrire une petite application qui va généré des fichiers xml
normalisé (on m'a fournit le fichier XSD qui decrit cette normalisation)
J'ai donc généré un fichier de class via xsd.exe a partir du fichier XSD que
l'on m'a transmis.
Le probleme c' est qu'il y a des décalration relativment complex de tableau
de tableau (jagged array) et là je m'y perd completement, impossible
d'instancier correctement n'y d'initailiser tout ça !!!!
si quelqu'un pouvait me filer un coup de main ....
Voila mon fichier de class
Public Class Presentation
'<remarks/>
Public Entity As String
'<remarks/>
<System.Xml.Serialization.XmlArrayItemAttribute("Row", IsNullable:=False), _
System.Xml.Serialization.XmlArrayItemAttribute("Col", IsNullable:=False,
NestingLevel:=1)> _
Public RawData()() As PresentationRowCol
'<remarks/>
<System.Xml.Serialization.XmlArrayItemAttribute("Col", IsNullable:=False)> _
Public Show() As PresentationCol
'<remarks/>
<System.Xml.Serialization.XmlArrayItemAttribute("Row", IsNullable:=False), _
System.Xml.Serialization.XmlArrayItemAttribute("Col", IsNullable:=False,
NestingLevel:=1)> _
Public DisplayData()() As PresentationRowCol1
End Class
Public Class PresentationRowCol
'<remarks/>
Public Name As String
'<remarks/>
Public Value As String
End Class
Public Class PresentationRowCol1
'<remarks/>
Public Name As String
'<remarks/>
Public Value As Object
End Class
Public Class PresentationCol
'<remarks/>
Public Name As String
End Class
Module Module1
Dim zp As New Presentation
Dim zprowcol As New PresentationRowCol
Sub Main()
zp.RawData = New PresentationRowCol(0)()
End Sub
End Module
et voila au final a quoi devrait ressembler le fichier xml :
<ZMessage>
<Action>Get</Action>
<Entity>P</Entity>
<Data>
<Entity>Asceline</Entity>
<RawData>
<Row>
<Col>
<Name>code</Name>
<Value>XXX</Value>
</Col>
<Col>
<Name>Ref</Name>
<Value>XXX</Value>
</Col>
</Row>
</RawData>
</Data>
</ZMessage>
Au secours !!!!
Merci d'avance
Olivier