pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: boris <boris@localhost.localdomain>
To: pgsql-sql@postgresql.org
Subject: select xpath ...
Date: Sat, 17 Sep 2011 13:48:03 -0400
Message-ID: <j52me3$ehq$1@speranza.aioe.org> (raw)

hi all,
I've inserted xml file :

<?xml version="1.0"?>
<document xmlns:s1="urn:myorg/s1" xmlns="urn:myorg" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
	<id num="111-222-333-4444"/>
	<title>zzzzzz</title>
......................


to a table:

CREATE TABLE "temp".tempxml
(
   record xml
)

I can get it using:
select * from temp.tempxml


but, I can't get any values using xpath. ex:


   select (xpath('/document/title/text()', record ))[1] from temp.tempxml


am I doing it right?

thanks.






view thread (5+ messages)  latest in thread

Message-ID: <j52me3$ehq$1@speranza.aioe.org>
Permalink:  ../j52me3$ehq$1@speranza.aioe.org/
Also on:    postgresql.org/message-id/j52me3$ehq$1@speranza.aioe.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: boris@localhost.localdomain
  Subject: Re: select xpath ...
  In-Reply-To: <j52me3$ehq$1@speranza.aioe.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox