The database contains an XML file containing Russian names of namespaces.

<ТегА xmlns="http://фр.рф/А/Б" xmlns:БББ="http://фр.рф/А/Б/варианты" xmlns:ВВВ="http://фр.рф/В"> <ТегБ> <БББ:ТегВ>содержимое</БББ:ТегВ> </ТегБ> <СлужебнаяИнформация> <ВВВ:GUID>ab959b10-3ce0-4e02-8a5b-e9eec399f3c5</ВВВ:GUID> <ВВВ:ДатаВремя>2016-05-07T14:45:11+03:00</ВВВ:ДатаВремя> </СлужебнаяИнформация> </ТегА> 

Request type:

 SELECT X.* FROM ShemaName.Tablename T, XMLTABLE( 'declare default element namespace "http://фр.рф/А/Б"; declare namespace U="http://фр.рф/А/Б/варианты"; $d' PASSING T.XMLField AS "d" COLUMNS T VARCHAR(1000) PATH 'ТегА/ТегБ/U:ТегВ' ) AS X 

Causes an error:

 ERROR [10504] [IBM][DB2/NT64] SQL16032N The string "http://фр.рф/А/Б" is not a valid URI. Error QName=err:XQST0046. 

If the request does not declare a namespace and use the PATH construct of the form

 '*:ТегА/*:ТегБ/*:ТегВ' 

then the query works, but for some reason it does not suit me (real XML is more complicated and the namespace is not just there).

Is there a way around this namespace naming restriction?

    1 answer 1

    Alternatively, you can encode the domain in punycode, and the query string in UTF, using percent ‐ encoding

    For example, instead of http://фр.рф/А/Б write http://xn--p1ah.xn--p1ai/%D0%90/%D0%91

    • Can. And so the request will even be executed without an error, only it will not return anything since the URI of the xmlns attribute is processed by the XML parser as a simple string. For this option to work, it is necessary that in XML the names of the spaces in punycode are. - Aggr