Skip site navigation (1) Skip section navigation (2)

Delete xml node from xml-document

From: "Oleg Malyovaniy" <deer_oleg(at)mail(dot)ru>
To: <pgsql-general(at)postgresql(dot)org>
Subject: Delete xml node from xml-document
Date: 2008-04-29 10:30:04
Message-ID: E1Jqn4x-0004Mx-00.deer_oleg-mail-ru@mx34.mail.ru (view raw or flat)
Thread:
Lists: pgsql-general
Hello!

 

I try to delete some node from xml using plpgsql language

How can I do it?

 

To sample

SELECT INTO xlst_templ '//myNode';

SELECT INTO v_xml XMLPARSE(DOCUMENT value) from myTable WHERE id=ids;

RAISE NOTICE '%', v_xml; -- variable v_xml contain my xml document.

SELECT INTO v_nodes xpath(xlst_templ, v_xml); -- variable v_nodes contain
array of xml elements "myNode"

 

what next?

How delete all nodes "myNode'" from document v_xml?

 

Thanks for your help.

 

Oleg A Malyovany

 

pgsql-general by date

Next:From: Pavel StehuleDate: 2008-04-29 11:42:13
Subject: Re: String Comparison and NULL
Previous:From: William TemperleyDate: 2008-04-29 08:59:04
Subject: Re: passing a temporary table with more than one column to a stored procedure

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group