Dim comentario As XmlNode
Dim nodo As XmlNode
Dim nodo1 As XmlNode
Dim nodo2 As XmlNode
Dim nodo3 As XmlNode
Dim nodo4 As XmlNode
Dim nodo5 As XmlNode
Dim nodo6 As XmlNode
'Se comienza la construcción del xml
Dim dtsDatos As DataSet = objDBConsultor.gstDatosGenerales(id, 0, "", "", "", False, Date.Now, 0, 0, "", "", "", "", 0, "", "", "", False, "", Date.Now, 6)
If Not (dtsDatos.Tables("Datos") Is Nothing) Then
If (dtsDatos.Tables("Datos").Rows.Count = 1) Then
With dtsDatos.Tables("Datos").Rows(0)
Dim xmlDoc As XmlDocument = New XmlDocument
'Se hace declaraciones
Dim nododeclaracion As XmlDeclaration = xmlDoc.CreateXmlDeclaration("1.0", "ISO-8859-1", "")
xmlDoc.AppendChild(nododeclaracion)
'Se referencia el xslt
xmlDoc.AppendChild(xmlDoc.CreateProcessingInstruction("xml-stylesheet", "type='text/xsl' href='" + objGeneral.xmlBase + "/visualizar/xsl.xsl'"))
Dim nilAttribute As XmlAttribute = xmlDoc.CreateAttribute("xsi", "nil", "http://www.w3.org/2001/XMLSchema-instance")
nilAttribute.Value = "true"
'Se crea el nodo raiz
Dim nodoRaiz As XmlNode = xmlDoc.CreateElement("cv")
nodoRaiz.Attributes.Append(xmlDoc.CreateAttribute("xmlns"))
nodoRaiz.Attributes("xmlns").Value = objGeneral.xmlBase
nodoRaiz.Attributes.Append(xmlDoc.CreateAttribute("xmlns:core"))
nodoRaiz.Attributes("xmlns:core").Value = objGeneral.xmlBase & "/core"
nodoRaiz.Attributes.Append(xmlDoc.CreateAttribute("xmlns:xsi"))
nodoRaiz.Attributes("xmlns:xsi").Value = "http://www.w3.org/2001/XMLSchema-instance"
nodoRaiz.Attributes.Append(xmlDoc.CreateAttribute("xsi", "schemaLocation", "http://www.w3.org/2001/XMLSchema-instance"))
nodoRaiz.Attributes("xsi:schemaLocation").Value = objGeneral.xmlBase & " " & objGeneral.xmlBase & "/xsdCurrCons.xsd"
nodoRaiz.Attributes.Append(xmlDoc.CreateAttribute("strFechaGenero"))
nodoRaiz.Attributes("strFechaGenero").Value = String.Format("{0:yyyy/MM/dd}T{0:hh:mm:ss}.0", DateTime.Now)
nodo = xmlDoc.CreateElement("DatosGenerales")
nodo1 = xmlDoc.CreateElement("strRut")
nodo1.InnerText = String.Format("{0:###,###}", .Item("intRut")) & "-" & objGeneral.getDigRut(.Item("intRut"))
nodo.AppendChild(nodo1)
nodo1 = xmlDoc.CreateElement("strNombrecompleto")
If (Not (.Item("strApellidoMaterno") Is DBNull.Value)) Then
nodo1.InnerText = .Item("strNombres") + " " + .Item("strApellidoPaterno") + " " + .Item("strApellidoMaterno")
Else
nodo1.InnerText = .Item("strNombres") + " " + .Item("strApellidoPaterno")
End If
nodo.AppendChild(nodo1)
...
nodoRaiz.AppendChild(nodo)
xmlDoc.AppendChild(nodoRaiz)