why xpath in postgresql query return empty?

SOLVED
Highlighted
Gold 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">
<wsse:Security>
<wsse:UsernameToken>
<wsse:Username>SGS-PdT</wsse:Username>
<wsse:Password>wro_bEif6</wsse:Password>
<wsse:Nonce>7bc150b80d00b570a7c6b83bb91b0131a6ab40db</wsse:Nonce>
</wsse:UsernameToken>
</wsse:Security>
</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>
<val:proveedor>
<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>
</val:proveedor>
<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>
<val:DescOrganismo>Supe de Val y Seg</val:DescOrganismo>
<val:Estado>Activo</val:Estado>
<val:PadreOrganismo>AE000</val:PadreOrganismo>
</val:IdOrganismo>
<val:FormularioSolicitud>
<val:NumSolicitud a="a1">AE009W-674921</val:NumSolicitud>
<val:FechaSolicitud>
<val:fechaTruncada>2016-12-23</val:fechaTruncada>
</val:FechaSolicitud>
<val:Solicitante>
<val:nombres>S</val:nombres>
<val:apellidoPaterno>JA</val:apellidoPaterno>
<val:apellidoMaterno>RO</val:apellidoMaterno>
</val:Solicitante>
<val:Apoderado>
<val:nombres/>
<val:apellidoPaterno/>
<val:apellidoMaterno/>
</val:Apoderado>
<val:Email>sj@gmail.com</val:Email>
<val:DireccionPostal>
<val:Nombre/>
<val:Numero/>
<val:Comuna>
<val:CodigoComuna/>
</val:Comuna>
<val:Region>
<val:CodigoRegion/>
</val:Region>
<val:Pais/>
</val:DireccionPostal>
<val:TextoSolicitud>N/A</val:TextoSolicitud>
<val:Observaciones>Junto con saludar.</val:Observaciones>
<val:IdFormaRecepcion>ELEC</val:IdFormaRecepcion>
<val:EmailRecepcion>sj@gmail.com</val:EmailRecepcion>
<val:DireccionPostalRecepcion>
<val:Nombre/>
<val:Numero/>
<val:Comuna>
<val:CodigoComuna/>
</val:Comuna>
<val:Region>
<val:CodigoRegion/>
</val:Region>
<val:Pais/>
</val:DireccionPostalRecepcion>
</val:FormularioSolicitud>
<val:IdOficinaRecogida/>
<val:IdFormaEntrega>PDF</val:IdFormaEntrega>
<val:ObservacionesFormaEntrega/>
</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

 

 

Archived Discussions


Effective March 31st, we will no longer engage on PostgresRocks.


How to engage with us further?


  • Thought Leadership: EDB Blogs

  • Tips and Tricks: Postgres Tutorials

  • Customer Support: Create a Case Please note: Only customers with an active EDB support subscription and support portal authorization can create support ticket

  • Engage on Stackoverflow While engaging on Stackoverflow tag the question with EDB or EnterpriseDB.

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

View solution in original post

5 REPLIES 5
Highlighted
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.

Regards,
Dhananjay
Highlighted
Gold Adventurer

Re: why xpath in postgresql query return empty?

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

 

 

regards

Highlighted
Gold 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

View solution in original post

Highlighted
Gold Adventurer

Re: why xpath in postgresql query return empty?

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

© 2019 EnterpriseDB Corporation. All rights reserved.   |   Privacy Policy   |  Terms of Use   |   Trademarks