cancel
Showing results for 
Search instead for 
Did you mean: 

why xpath in postgresql query return empty?

SOLVED
Silver Adventurer

why xpath in postgresql query return empty?

why my query with xpath return empty?, i want to return AE009W-674921, any idea? iam missing something?

i use postgres 10.4 on linux redhat 7.

here the example code:

 


select xpath ('soapenv:Envelope/soapenv:Body/val:sobre/val:cuerpo/val:documento/val:TransparenciaEventoInteroperacionSAI/val:AltaSaiOrganismo/val:FormularioSolicitud/val:NumSolicitud',
'<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:val="http://valida.aem.gob.cl" xmlns:xd="http://www.w3.org/2000/09/xmldsig#">
<soapenv:Header xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsseSmiley Frustratedecurity>
<wsse:UsernameToken>
<wsse:Username>SGS-PdT</wsse:Username>
<wsseSmiley Tongueassword>wro_bEif6</wsseSmiley Tongueassword>
<wsse:Nonce>7bc150b80d00b570a7c6b83bb91b0131a6ab40db</wsse:Nonce>
</wsse:UsernameToken>
</wsseSmiley Frustratedecurity>
</soapenv:Header>
<soapenv:Body>
<val:sobre>
<val:encabezado><Respuesta>
<Estado>OK</Estado>
<IdSobre>080801000120161223000018500</IdSobre>
<FechaResp>2016-12-23 17:03:05</FechaResp>
<NumSolicitud>AE009W-674921</NumSolicitud>
<Evento>TransaccionExitosa</Evento>
<Observaciones>La transaccion ha tenido exito</Observaciones>
</Respuesta>
<val:idSobre>080801000120161223000018500</val:idSobre>
<val:fechaHora>2016-12-23T17:03:04</val:fechaHora>
<valSmiley Tongueroveedor>
<val:nombre>CPLT</val:nombre>
<val:servicios>
<!--1 or more repetitions:-->
<val:servicio>INTEROPERACION PORTAL TRANSPARENCIA</val:servicio>
<!--1 or more repetitions:-->
<val:respuestaServicio>
<val:estado>OK</val:estado>
<val:glosa>RESPUESTA EXITOSA</val:glosa>
</val:respuestaServicio>
</val:servicios>
</valSmiley Tongueroveedor>
<val:consumidor>
<val:nombre>SVS</val:nombre>
<val:tramite>SOLICITUD DE ACCESO LEY 20.285 - AE009</val:tramite>
<val:certificado>
<xd:X509Data>
<!--You have a CHOICE of the next 6 items at this level-->
<xd:X509IssuerSerial>
<xd:X509IssuerName/>
<xd:X509SerialNumber>0</xd:X509SerialNumber>
</xd:X509IssuerSerial>
<xd:X509SKI>cid:280094084202</xd:X509SKI>
<xd:X509SubjectName/>
<xd:X509Certificate>cid:755220499240</xd:X509Certificate>
<xd:X509CRL>cid:1398831709316</xd:X509CRL>
<!--You may enter ANY elements at this point-->
</xd:X509Data>
</val:certificado>
</val:consumidor>
<!--Optional:-->
<val:fechaHoraReq>2016-12-23 16:47:25</val:fechaHoraReq>
<!--Optional:-->
<val:emisor>SVS</val:emisor>
<val:metadataOperacional>
<val:estadoSobre>00</val:estadoSobre>
<val:glosaSobre>TRANSACCION EXITOSA</val:glosaSobre>
</val:metadataOperacional>
</val:encabezado>
<!--1 or more repetitions:-->
<val:cuerpo>
<val:documento>
<!--You may enter ANY elements at this point-->
<val:TransparenciaEventoInteroperacionSAI>
<val:AltaSaiOrganismo>
<val:IdOrganismo>
<val:CodOrganismo>AE009</val:CodOrganismo>
<valSmiley Very HappyescOrganismo>Supe de Val y Seg</valSmiley Very HappyescOrganismo>
<val:Estado>Activo</val:Estado>
<valSmiley TongueadreOrganismo>AE000</valSmiley TongueadreOrganismo>
</val:IdOrganismo>
<val:FormularioSolicitud>
<val:NumSolicitud a="a1">AE009W-674921</val:NumSolicitud>
<val:FechaSolicitud>
<val:fechaTruncada>2016-12-23</val:fechaTruncada>
</val:FechaSolicitud>
<valSmiley Frustratedolicitante>
<val:nombres>S</val:nombres>
<val:apellidoPaterno>JA</val:apellidoPaterno>
<val:apellidoMaterno>RO</val:apellidoMaterno>
</valSmiley Frustratedolicitante>
<val:Apoderado>
<val:nombres/>
<val:apellidoPaterno/>
<val:apellidoMaterno/>
</val:Apoderado>
<val:Email>sj@gmail.com</val:Email>
<valSmiley Very HappyireccionPostal>
<val:Nombre/>
<val:Numero/>
<val:Comuna>
<val:CodigoComuna/>
</val:Comuna>
<val:Region>
<val:CodigoRegion/>
</val:Region>
<valSmiley Tongueais/>
</valSmiley Very HappyireccionPostal>
<val:TextoSolicitud>N/A</val:TextoSolicitud>
<valSmiley Surprisedbservaciones>Junto con saludar.</valSmiley Surprisedbservaciones>
<val:IdFormaRecepcion>ELEC</val:IdFormaRecepcion>
<val:EmailRecepcion>sj@gmail.com</val:EmailRecepcion>
<valSmiley Very HappyireccionPostalRecepcion>
<val:Nombre/>
<val:Numero/>
<val:Comuna>
<val:CodigoComuna/>
</val:Comuna>
<val:Region>
<val:CodigoRegion/>
</val:Region>
<valSmiley Tongueais/>
</valSmiley Very HappyireccionPostalRecepcion>
</val:FormularioSolicitud>
<val:IdOficinaRecogida/>
<val:IdFormaEntrega>PDF</val:IdFormaEntrega>
<valSmiley SurprisedbservacionesFormaEntrega/>
</val:AltaSaiOrganismo>
</val:TransparenciaEventoInteroperacionSAI>
</val:documento>
</val:cuerpo>
</val:sobre>
</soapenv:Body>
</soapenv:Envelope>'::xml,
ARRAY[ARRAY['soapenv','http://schemas.xmlsoap.org/soap/envelope/'], array['val','http://valida.aem.gob.cl']])

 

 

iam trying to get AE009W-674921 What am I doing wrong? Thanks in advance

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
EDB Team Member

Re: why xpath in postgresql query return empty?

Hi @asotolongo,

 

I have modified the attached xpath query and tested and it is giving the desired output.

 

xpath
-----------------
{AE009W-674921}

 

Could you please test the attached query and let us know in case of any issues/queries.

 

Regards,

Sudhir

5 REPLIES
EDB Team Member

Re: why xpath in postgresql query return empty?

Hi, asotolongo,

 

Can you kindly share the XPath query in text file attachment? As in post body, there are a lot of characters got converted into emoji format due to which it is difficult for us to reproduce the issue. 

 

Kindly let us know in case of any concerns or issues.

Silver Adventurer

Re: why xpath in postgresql query return empty?

hi @dhananjayjejur,  here is the query in pastebin link:  https://pastebin.com/22j3X12j  

 

 

regards

Silver Adventurer

Re: why xpath in postgresql query return empty?

sorry the linnk is broken , here is gain, https://pastebin.com/22j3X12j 

Highlighted
EDB Team Member

Re: why xpath in postgresql query return empty?

Hi @asotolongo,

 

I have modified the attached xpath query and tested and it is giving the desired output.

 

xpath
-----------------
{AE009W-674921}

 

Could you please test the attached query and let us know in case of any issues/queries.

 

Regards,

Sudhir

Silver Adventurer

Re: why xpath in postgresql query return empty?

hi @slonkar. that was the solution, thanks, iam missing / at the begining ;-) , thanks again