voici le type d'erreur que j'ai en suivant l'exemple du blog
c'est toujours dans les test if
par exemple
'-----error "XmlSchemaComplexType" is a type and cannot be used as
an expression.
'--------------------
'
Dim schemaSet As XmlSchemaSet = New XmlSchemaSet
schemaSet.Add(Nothing, "schema.xsd")
schemaSet.Compile
'--------------------
'
For Each schema As XmlSchema In ss.Schemas
'------------------------------------------------
' stepping through global complex typesFor Each type As XmlSchemaType In
schema.SchemaTypes.Values
'------------------------------------------------
If (type = XmlSchemaComplexType) Then
'-----error "XmlSchemaComplexType" is a type and cannot be used as
an expression.
End If
Next
'------------------------------------------------
' stepping through global elements
'------------------------------------------------
For Each el As XmlSchemaElement In schema.Elements.Values
Next
'------------------------------------------------
' stepping through named groups
'------------------------------------------------
For Each xsa As XmlSchemaAnnotated In schema.Items
If (xsa = XmlSchemaGroup) Then
'-----error "XmlSchemaGroup" is a type and cannot be used as an
expression.
End If
Next
'------------------------------------------
'
Private Sub walkTheParticle(ByVal particle As XmlSchemaParticle)
If (particle = XmlSchemaElement) Then
'-----error "XmlSchemaElement" is a type and cannot be used as an
expression.
Dim elem As XmlSchemaElement = CType(particle,XmlSchemaElement)
' todo: insert your processing code here
If elem.RefName.IsEmpty Then
Dim type As XmlSchemaType =
CType(elem.ElementSchemaType,XmlSchemaType)
If (type = XmlSchemaComplexType) Then
'-----error "XmlSchemaComplexType" is a type and cannot be used as an
expression.
Dim ct As XmlSchemaComplexType =
CType(type,XmlSchemaComplexType)
If ct.QualifiedName.IsEmpty Then
walkTheParticle(ct.ContentTypeParticle)
End If
End If
End If
ElseIf (particle = XmlSchemaGroupBase) Then
'-----error "XmlSchemaGroupBase" is a type and cannot be used as an
expression.
Dim baseParticle As XmlSchemaGroupBase =
CType(particle,XmlSchemaGroupBase)
For Each subParticle As XmlSchemaParticle In baseParticle.Items
walkTheParticle(subParticle)
Next
End If
End Sub
'--------------------------
Private Sub start(ByVal ss As XmlSchemaSet)
For Each schema As XmlSchema In ss.Schemas
For Each type As XmlSchemaType In schema.SchemaTypes.Values
If (type = XmlSchemaComplexType) Then
'-----error "XmlSchemaComplexType" is a type and cannot be used as an
expression.
Dim ct As XmlSchemaComplexType =
CType(type,XmlSchemaComplexType)
walkTheParticle(ct.ContentTypeParticle)
End If
Next
For Each el As XmlSchemaElement In schema.Elements.Values
walkTheParticle(el)
Next
For Each xsa As XmlSchemaAnnotated In schema.Items
If (xsa = XmlSchemaGroup) Then
'-----error "XmlSchemaGroup" is a type and cannot be used as an
expression.
Dim xsg As XmlSchemaGroup = CType(xsa,XmlSchemaGroup)
walkTheParticle(xsg.Particle)
End If
Next
Next
End Sub
Post by dedZepsur cette page
http://www.xmlforasp.net/CodeBank/System_Xml_Schema/ParseSchema/ParseXMLSchema.aspx
l'auteur a reussi a faire ce que je cherche depuis plusieurs mois
dans le tutorial joint http://www.xmlforasp.net/codeSection.aspx?csID=78
le code source ne marche helas qu'avec asp.net 1
Sauriez vous le faire en asp.net 2.0
Cette demande est essentielle pour continuer mon travail
Merci a vous :)