Buen dia...
Como puedo pasar un archivo xml a un excel? el xml es de esta forma:
<mas xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance xsi:noNamespaceSchemaLocation="1001.xsd">
<cab>
<ano>2008</ano>
<Codigo>1</CodCpt>
<Formato>1001</Formato>
<FecInicial>2007-01-01</FecInicial>
<FecFinal>2007-12-30</FecFinal>
<ValorTotal>1000000</ValorTotal>
<CantReg>2</CantReg>
</cab>
<valores tdoc="31" num="16453244" ape1="DÍAZ" ape2="LÓPEZ" nom1="JHONNY" nom2="WILMER" Pago="10643189" />
<valores tdoc="13" num="31192323" ape1="PATIÑO" ape2="GARCIA" nom1="OLMA" Pago="14700000" />
</mas>
Lei q se puede llenar un dataset con los datos del xml y luego exportarlo a excel; para llenar el ds tomé esta rutina:
Dim dSet As New DataSet
Dim fs As FileStream
'open the xml file so we can use it to fill the dataset
Try
fs = New FileStream("C:\file.xml, FileMode.Open)
Catch e As Exception
Debug.WriteLine(e)
End Try
'fill the dataset
Try
dSet.ReadXml(fs)
Catch ex As Exception
Debug.WriteLine(ex)
Finally
fs.Close()
End Try
pero el dataset solo se esta llenando con los datos del tag <cab>...necesito tambien los de los tag <valores>, supongo q deben ir en otro DS y en el excel en otra hoja, pero no se como hacerlo...Espero me puedan ayudar a llegar a la solucion