Impossibile selezionare elementi XML dal tipo 'type'

Aggiornamento: novembre 2007

XML elements cannot be selected from type 'type'

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

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

ID errore: BC36807

Per correggere l'errore

  • Assicurarsi che l'oggetto a un attributo 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à XML Child Axis

Altre risorse

Proprietà Axis XML

XML in Visual Basic