Ver Mensaje Individual
  #4 (permalink)  
Antiguo 28/04/2005, 00:42
Avatar de Jose_minglein2
Jose_minglein2
 
Fecha de Ingreso: noviembre-2004
Mensajes: 2.344
Antigüedad: 22 años
Puntos: 8
Ok, rootk, pero es que el document lo cargo mediante XMLTextWriter, te pongo parte de mi cod:

Código PHP:
Dim enc As System.Text.Encoding
objXMLTW 
= New XmlTextWriter(path + usuario + ".xml", enc)

objXMLTW.WriteStartDocument()
objXMLTW.WriteStartElement("Document")
objxmltw.WriteStartElement("Actividades")
        
bd.abrir()
        
Dim dr As MySql.Data.MySqlClient.MySqlDataReader
        dr 
= bd.ObtenerActividades()
        While 
dr.Read()
            
objxmltw.WriteStartElement("Actividad")

            
objxmltw.WriteStartElement("Id")
            
objxmltw.WriteString(dr("id"))
            
objxmltw.WriteEndElement()

            
objxmltw.WriteStartElement("NombreAct")
            
objxmltw.WriteString(dr("nombreact"))
            
objxmltw.WriteEndElement()

            
objxmltw.WriteStartElement("Descripcion")
            
objxmltw.WriteString(dr("descripcion"))
            
objxmltw.WriteEndElement()

            
objxmltw.WriteEndElement()
        
End While
        
dr.Close()
        
bd.Cerrar()
        
objxmltw.WriteEndElement()

        
objxmltw.WriteStartElement("Clientes")
        
bd.abrir()

       
Cargo los clientes
       bd
.cerrar()
       
objxmltw.WriteEndElement() 

        
objXMLTW.WriteEndElement()

            
objXMLTW.WriteEndDocument() 
            
objXMLTW.Flush() 

            
objXMLTW.Close()
           

            
Dim doc As Xml.XmlDocument = New Xml.XmlDocument
            doc
.Load(path + usuario + ".xml")
                 Return 
doc 
Donde bd es mi objeto de conexión a la base de datos, ya te digo que cuando lo hago a través del explorer me habre el xml sin problemas, es decir el doc.load me lo hace bien, por eso no entiendo que me diga InvalidCastException cuando lo intento recoger desde un webform, puede ser un problema de estructura???

Este es el xml que devuelve desde el explorer:
Código PHP:
<?xml version="1.0" encoding="utf-8" ?> 
- <Document>
- <Actividades>
- <Actividad>
* <Id>1</Id> 
* <NombreAct>Hostelería</NombreAct> 
* <Descripcion /> 
* </Actividad>
- <Actividad>
* <Id>2</Id> 
* <NombreAct>Talleres</NombreAct> 
* <Descripcion /> 
* </Actividad>
- <Actividad>
* <Id>3</Id> 
* <NombreAct>Kioskos</NombreAct> 
* <Descripcion /> 
* </Actividad>
* </Actividades>
- <Clientes>
- <Cliente>
* <Id>1</Id> 
* <Nombre>Nombres</Nombre> 
* <Actividad>1</Actividad> 
* <Titular>aaa</Titular> 
* 
* </Cliente>
- ...
* </Clientes>
</Document>
Que me dices????Muchisimas gracias por tu ayuda