Re: XML namespace problem
From: timo <timo.talja_at_luukku.com>
Date: Mon, 09 Mar 2009 09:47:24 GMT
Message-ID: <MA5tl.25$a06.9_at_read4.inet.fi>
>> Hi all,
>> I'm facing difficulties with namespaces when reading XML to database; xml
>> is like this;
>>
>> <?xml version="1.0" encoding="ISO-8859-1"?>
>> <?xml-stylesheet type="text/xsl" href="../oper_fct.xsl"?>
>> <test abc:thisone="O1" xmlns="abc" xmlns:abc="abc"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="abc ../abc_abc.xsd">
>> <blaa>
>> ABCABC
>> </blaa>
>> </test>
>>
>> Problem is to read out that attribute "abc:thisone"; I've tried many ways
>> to get it in PL/SQL like
>> ....
>> xlsprocessor.valueof(l_node, '_at_abc:thisone')
>> ...
>> and I've tried
>> ...
>> xlsprocessor.valueof(l_node, '_at_thisone')
>> ...
>>
>> What is the right way to get it ???
>> Any help would be appreciated,
>> BR,
>> Timo
>>
>>
>>
Date: Mon, 09 Mar 2009 09:47:24 GMT
Message-ID: <MA5tl.25$a06.9_at_read4.inet.fi>
Hi Maxim,
thanks; your solution works, great !
[Quoted] Still I should read with "xlsprocessor.valueof" and still I haven't found a
way to define namespace to it in PL/SQL; should it be like
...
xlsprocessor.valueof(l_node,'_at_thisone','abc')
or
xlsprocessor.valueof(l_node,'_at_abc:thisone','abc')
or
xlsprocessor.valueof(l_node,'_at_thisone','xmlns=abc="abc"')
or what....???
If you've got an anwer for this please do let me know it ,
BR,
Timo
"Maxim Demenko" <mdemenko_at_gmail.com> wrote in message news:49B254BC.1010001_at_gmail.com...
> timo schrieb:
>> Hi all,
>> I'm facing difficulties with namespaces when reading XML to database; xml
>> is like this;
>>
>> <?xml version="1.0" encoding="ISO-8859-1"?>
>> <?xml-stylesheet type="text/xsl" href="../oper_fct.xsl"?>
>> <test abc:thisone="O1" xmlns="abc" xmlns:abc="abc"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="abc ../abc_abc.xsd">
>> <blaa>
>> ABCABC
>> </blaa>
>> </test>
>>
>> Problem is to read out that attribute "abc:thisone"; I've tried many ways
>> to get it in PL/SQL like
>> ....
>> xlsprocessor.valueof(l_node, '_at_abc:thisone')
>> ...
>> and I've tried
>> ...
>> xlsprocessor.valueof(l_node, '_at_thisone')
>> ...
>>
>> What is the right way to get it ???
>> Any help would be appreciated,
>> BR,
>> Timo
>>
>>
>>
>
> You should specify the namespaces you are using. You can do it in plain
> sql like this:
>
> SQL> with t as (
> 2 select xmltype('<?xml version="1.0" encoding="ISO-8859-1"?>
> 3 <?xml-stylesheet type="text/xsl" href="../oper_fct.xsl"?>
> 4 <test abc:thisone="O1" xmlns="abc" xmlns:abc="abc"
> 5 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> 6 xsi:schemaLocation="abc ../abc_abc.xsd">
> 7 <blaa>
> 8 ABCABC
> 9 </blaa>
> 10 </test>') x from dual)
> 11 select extractvalue(x,'//_at_abc:thisone','xmlns:abc="abc"') attr
> 12 from t
> 13 ;
>
> ATTR
> ----------
> O1
>
>
> If your program logic requires the use of xlsprocessor.valueof , then you
> should specify your namespaces in that call as well ( it accepts a
> namespace parameter).
>
>
> Best regards
>
> Maxim
Received on Mon Mar 09 2009 - 10:47:24 CET
