Ver Mensaje Individual
  #10 (permalink)  
Antiguo 17/04/2007, 16:44
Avatar de Developer9
Developer9
(Desactivado)
 
Fecha de Ingreso: abril-2005
Ubicación: Mi Ecuador del alma
Mensajes: 4.196
Antigüedad: 19 años, 1 mes
Puntos: 47
Re: Caracteres especiales en xml

Cita:
Iniciado por monoswim Ver Mensaje
Pero en que lenguaje estás trabajando ? me imagino que el XML debe estar correcto, si lo abres desde el navegador no te tira error ?

Entonces es un problema del lenguaje que estés usando...

Espero que te sirva

Saludos

Ya toy aquí otra vez. Corrección, en el Internet Explorer si me da error, me dice:

Código:
The XML page cannot be displayed 
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later. 


--------------------------------------------------------------------------------

An invalid character was found in text content. Error processing resource 'file:///C:/Documents and Settings...
Si con mi xml en SQL Server hago esto:

Código:
declare @DocXml varchar(max)
set @DocXml='<Usuario PS_IdUsuario="jsevillano" PS_Token="5WYS6DS1MRHD39PAMAPMIHLOJFJ7CJW+" PS_Maquina="127.0.0.1" PS_UsrSitio="5F13FCC73195141140B807B6FB7E6CB2" PS_TokenSitio="A958CD89BC72772214C3EAEA7887D2E0C332284FDD73D88A496B06FE9B783FA6FEE7F279B826F7F1" PS_MaqSitio="ABSISTE022" PS_IdEmpresa="4" PS_IdSucursal="7" PS_IdAplicacion="1" PS_IdFormulario="cmp_frmOrdenCompraRapida.aspx" PS_Login="S"><ResultSet><Provision IdEmpresa="4" NumDocumento="318" IdOficina="7" NumDocAsociado="318" IdTipoDocumento="1" NumFacturaRef="0" IdOrdenChq="" IdTipoParticipante="2" IdParticipante="2293" FechaEmision="04-17-2007" FechaPago="04-17-2007" FechaRecepcion="05-19-2007" FechaDescto="" PlazoDiaPP="0" DiaVencimiento="0" IdMoneda="1" IdUrgenciaPago="1" TipoDocAsociado="7" NumGuiaRemi="" IdResponsable="2183" ReferenciaPago="" DetalleVario="Guía de REmisión Nº 5" SubTotal="520.00" OtroDescuento="0.00" TotalDocumento="520.00" BaseImpBien0="520.00" BaseImpBien12="0.00" MontoIvaPrtcjeBien="0.00" BaseImpServ0="0" BaseImpServ12="0.00" MontoIvaPrtcjeServ="0.00" BaseIce="0.00" IdPrctjeIce="0" IdPrctjeIceValor="0" MontoIce="0.00" IdPrctajeIvaBien="1" IdPrctajeIvaServ="1" IdPrctajeIvaValorBien="12" IdPrctajeIvaValorServ="12" IdZona="1" IdUsuario="2183" IdTranModulo="30" IdModulo="13" FechaSolicitud="04-17-2007" IdFormaPago="1873" FacturaCruce="N" TipoDocProcesado="1"/></ResultSet></Usuario>'

declare @IdXML int
exec sp_xml_preparedocument @IdXML OUTPUT, @DocXml
se cae

Pero si hago esto otro:

Código:
declare @DocXml xml
set @DocXml='<Usuario PS_IdUsuario="jsevillano" PS_Token="5WYS6DS1MRHD39PAMAPMIHLOJFJ7CJW+" PS_Maquina="127.0.0.1" PS_UsrSitio="5F13FCC73195141140B807B6FB7E6CB2" PS_TokenSitio="A958CD89BC72772214C3EAEA7887D2E0C332284FDD73D88A496B06FE9B783FA6FEE7F279B826F7F1" PS_MaqSitio="ABSISTE022" PS_IdEmpresa="4" PS_IdSucursal="7" PS_IdAplicacion="1" PS_IdFormulario="cmp_frmOrdenCompraRapida.aspx" PS_Login="S"><ResultSet><Provision IdEmpresa="4" NumDocumento="318" IdOficina="7" NumDocAsociado="318" IdTipoDocumento="1" NumFacturaRef="0" IdOrdenChq="" IdTipoParticipante="2" IdParticipante="2293" FechaEmision="04-17-2007" FechaPago="04-17-2007" FechaRecepcion="05-19-2007" FechaDescto="" PlazoDiaPP="0" DiaVencimiento="0" IdMoneda="1" IdUrgenciaPago="1" TipoDocAsociado="7" NumGuiaRemi="" IdResponsable="2183" ReferenciaPago="" DetalleVario="Guía de REmisión Nº 5" SubTotal="520.00" OtroDescuento="0.00" TotalDocumento="520.00" BaseImpBien0="520.00" BaseImpBien12="0.00" MontoIvaPrtcjeBien="0.00" BaseImpServ0="0" BaseImpServ12="0.00" MontoIvaPrtcjeServ="0.00" BaseIce="0.00" IdPrctjeIce="0" IdPrctjeIceValor="0" MontoIce="0.00" IdPrctajeIvaBien="1" IdPrctajeIvaServ="1" IdPrctajeIvaValorBien="12" IdPrctajeIvaValorServ="12" IdZona="1" IdUsuario="2183" IdTranModulo="30" IdModulo="13" FechaSolicitud="04-17-2007" IdFormaPago="1873" FacturaCruce="N" TipoDocProcesado="1"/></ResultSet></Usuario>'
select @DocXml
Si funciona. Y hasta le puedo hacer clic al xml resultante y ver como están los caracteres especiales ("Guía de Remisión Nº 5") dentro de él. El problema son las tildes y el º

Alguien sabe como trabajar con caracteres especiales en SQL Server?