Re: Prevent x005F from xml

From: Peter Kroon <plakroon(at)gmail(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Prevent x005F from xml
Date: 2012-11-26 19:51:02
Message-ID: CAOh+DOkSB9OtF9mi=Xkenei1hnXHZaeF0gLTLwvdULcFmWnG0Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I came up with this.
select replace( xmlelement(name my_xslt_tag,(select xmlparse(content
'<![CDATA[<foo>bar</foo><bar>foo</bar>]]>')))::text ,'_x005F','')::xml;

It works but it's not very fast.

2012/11/23 Peter Kroon <plakroon(at)gmail(dot)com>

> When I run this query:
> SELECT
> xmlelement(name my_xslt_tag,
> (SELECT XMLPARSE (CONTENT '<![CDATA[<foo>bar</foo><bar>foo</bar>]]>'))
> )
>
> I get this result:
>
> "<my_x005F_xslt_tag><![CDATA[<foo>bar</foo><bar>foo</bar>]]></my_x005F_xslt_tag>"
>
> Running soemthing similar in mssql prevents the x005F
> SELECT 'data' AS p,'data' AS k
> FOR XML RAW('xmlst')
>
> How do I prevent the x005F in the tagname without changing the tagname?
>
> Best,
> Peter Kroon
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Kroon 2012-11-26 19:56:12 Re: Npgsql
Previous Message Mark Volz 2012-11-26 18:56:17 Adding Default Privileges to a schema for a role