?
Solved

How to get XML tag attribute in a PL/SQL package from oracle

Posted on 2003-03-27
2
Medium Priority
?
1,861 Views
Last Modified: 2013-11-19
Here is my tag XML :
<Individual>
     <ByName FreeReference="REFERENTIE DN">
     </ByName>
</Individual>

I want to get the value equal to freereference (= attribute of byname).
I know how to get a value in a tag (XSLPROCESSOR.VALUEOF) but I cannot get the attribute value. I think i had to use XMLDOM.GETATTRIBUTES but I can find the way to use it.

How can I do that ?

Thanks a lot.
0
Comment
Question by:fba_mainsys
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
vanmeerendonk earned 100 total points
ID: 8218304
I hacked a small example
you should be able to read that

declare
  l_clob clob;
  l_parser    xmlparser.PARSER;
  l_doc       xmldom.DOMDOCUMENT;
  l_node_list xmldom.DOMNODELIST;
  l_root      xmldom.DOMNODE;
begin
  l_clob:= dbms_xmlquery.getxml('select col1 "@ref", kol2 "KOL_2" from table where rownum <= 1') ;
  l_parser := xmlparser.newparser;
  xmlparser.setvalidationmode(l_parser, FALSE);
  xmlparser.parseclob(l_parser,l_clob);
    l_doc       := xmlparser.getDocument(l_parser);
    l_node_list := xmldom.getelementsbytagname(l_doc, '*');
    l_root      := xmldom.item(l_node_list,1);
    pl(xmldom.getnodevalue(xmldom.getNamedItem(xmldom.getattributes(l_root),'ref')));
    xmldom.freeDocument (l_doc);
  xmlparser.freeparser(l_parser);
END ;
/
0
 

Author Comment

by:fba_mainsys
ID: 8218520
Thanks a lot, it works fine !!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
The viewer will learn how to dynamically set the form action using jQuery.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question