Impossibile selezionare elementi discendenti XML dal tipo 'type'

Aggiornamento: novembre 2007

XML descendant elements cannot be selected from type 'type'

È stato fatto riferimento a un elemento discendente XML per un oggetto che non è di tipo XElement, XDocument o IEnumerable(Of XElement). Per ulteriori informazioni, vedere Proprietà axis descendant XML.

' Generates an error.
Dim var = "sample text"...<childElement>

ID errore: BC36809

Per correggere l'errore

  • Assicurarsi che l'oggetto a un elemento discendente del quale si sta facendo riferimento sia fortemente tipizzato come XElement, XDocument o IEnumerable(Of XElement). Di seguito è riportato un esempio:

    Dim elem As XElement = <root>
                            <child />
                           </root>
    Dim var = elem...<child>
    

Vedere anche

Riferimenti

Proprietà axis descendant XML

Altre risorse

Proprietà Axis XML

XML in Visual Basic