Home » Developer & Programmer » JDeveloper, Java & XML » xml data to html table with <ROW> tag data not displayed (Oracle 10g, Win7)
xml data to html table with <ROW> tag data not displayed [message #560070] Tue, 10 July 2012 06:32 Go to next message
nischalinn
Messages: 117
Registered: May 2012
Location: nepal
Senior Member
I've generated XML from oracle:
select dbms_xmlquery.getxml('select * from tbl_nm') from dual
<?xml version="1.0" encoding="ISO-8859-1"?>
<ROWSET>
    <ROW num="1">
      <NAME>admin</NAME>
      <PASSWORD>a</PASSWORD>
   </ROW>
   <ROW num="2">
      <NAME>user</NAME>
      <PASSWORD>u</PASSWORD>
   </ROW>
</ROWSET>

i tried to get this xml data in html table but the table was not displayed. When I changed the <ROW> tag into any other tag say <CD> the table was displayed. Why is it so???
Re: xml data to html table with <ROW> tag data not displayed [message #560075 is a reply to message #560070] Tue, 10 July 2012 06:55 Go to previous messageGo to next message
Michel Cadot
Messages: 59427
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
It is fair to feedback to those that help you, especially when they ask you a question. Let them without no answer without knowing if they help, if they give you the solution, if you got it elsewhere and what was the solution or workaround you applied is an inappropriate behaviour (without speaking about thanks).
I'm waiting for your feedback in your previous topic, until I get it I will no more help you.

Regards
Michel
Re: xml data to html table with <ROW> tag data not displayed [message #560076 is a reply to message #560075] Tue, 10 July 2012 06:57 Go to previous messageGo to next message
Michel Cadot
Messages: 59427
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Actually I'm waiting for your feedback in ALL the 3 topics you opened and you never "ended".

Regards
Michel
Re: xml data to html table with <ROW> tag data not displayed [message #560079 is a reply to message #560076] Tue, 10 July 2012 07:06 Go to previous messageGo to next message
nischalinn
Messages: 117
Registered: May 2012
Location: nepal
Senior Member
@ Michel Cadot: how to close an opened topic in this forum??
Re: xml data to html table with <ROW> tag data not displayed [message #560087 is a reply to message #560079] Tue, 10 July 2012 07:48 Go to previous messageGo to next message
Michel Cadot
Messages: 59427
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
You can't "close" but you can say "I got the solution, it is ... as the root of the problem was ... thanks to all".
This way we know we have no more to investigate in the topic but anyone can still add a new answer to improve the previous ones.

Regards
Michel
Re: xml data to html table with <ROW> tag data not displayed [message #560149 is a reply to message #560087] Tue, 10 July 2012 23:37 Go to previous messageGo to next message
nischalinn
Messages: 117
Registered: May 2012
Location: nepal
Senior Member
@Michel, I've checked all my previous posts. And thanks for the guidance.
Will you please get on with my problem??

thank you.
Re: xml data to html table with <ROW> tag data not displayed [message #560178 is a reply to message #560149] Wed, 11 July 2012 01:56 Go to previous messageGo to next message
Michel Cadot
Messages: 59427
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
This name is fixed by the function, you can use REPLACE to change it.
Or you can build the XML yourself using the xml functions like the xmlelement one you used in your previous topic.

Quote:
I've checked all my previous posts.

Yes but you didn't feedback.
For instance, in this one, you didn't tell what actually was the problem and how you solved it, so a future readers with the same problem will not know the solution or how to investigate on it.

Regards
Michel

[Updated on: Wed, 11 July 2012 03:22]

Report message to a moderator

Re: xml data to html table with <ROW> tag data not displayed [message #560190 is a reply to message #560178] Wed, 11 July 2012 02:42 Go to previous messageGo to next message
nischalinn
Messages: 117
Registered: May 2012
Location: nepal
Senior Member
thank you for the suggestion. I will consider it while posting further...
Re: xml data to html table with <ROW> tag data not displayed [message #560196 is a reply to message #560190] Wed, 11 July 2012 03:24 Go to previous messageGo to next message
Michel Cadot
Messages: 59427
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
So for this topic, future readers can't know the actual issue and solution?

Regards
Michel
Re: xml data to html table with <ROW> tag data not displayed [message #560197 is a reply to message #560149] Wed, 11 July 2012 03:54 Go to previous messageGo to next message
Michel Cadot
Messages: 59427
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
For instance, from:
SQL> select dbms_xmlquery.getxml('select empno, ename from emp where rownum<=3') res
  2  from dual
  3  /
RES
------------------------------------------------------------------------------------
<?xml version = '1.0'?>
<ROWSET>
   <ROW num="1">
      <EMPNO>7369</EMPNO>
      <ENAME>SMITH</ENAME>
   </ROW>
   <ROW num="2">
      <EMPNO>7499</EMPNO>
      <ENAME>ALLEN</ENAME>
   </ROW>
   <ROW num="3">
      <EMPNO>7521</EMPNO>
      <ENAME>WARD</ENAME>
   </ROW>
</ROWSET>

With replace:
SQL> select replace(
  2           replace(
  3             replace(
  4               replace(dbms_xmlquery.getxml(
  5                         'select empno, ename from emp where rownum<=3'),
  6                         '<ROWSET>', '<EMPLOYEES>'),
  7               '</ROWSET>', '</EMPLOYEES>'),
  8             'ROW num=', 'EMPLOYEE num='),
  9           '</ROW>', '</EMPLOYEE>') res
 10  from dual
 11  /
RES
----------------------------------------------------------------------------
<?xml version = '1.0'?>
<EMPLOYEES>
   <EMPLOYEE num="1">
      <EMPNO>7369</EMPNO>
      <ENAME>SMITH</ENAME>
   </EMPLOYEE>
   <EMPLOYEE num="2">
      <EMPNO>7499</EMPNO>
      <ENAME>ALLEN</ENAME>
   </EMPLOYEE>
   <EMPLOYEE num="3">
      <EMPNO>7521</EMPNO>
      <ENAME>WARD</ENAME>
   </EMPLOYEE>
</EMPLOYEES>

1 row selected.

Building the xml:
SQL> set lines 80
SQL> select xmlelement("EMPLOYEES", 
  2                    xmlagg(xmlelement("EMPLOYEE", 
  3                                      xmlforest(empno, ename)))) res
  4  from emp
  5  where rownum <= 3
  6  /
RES
--------------------------------------------------------------------------------
<EMPLOYEES><EMPLOYEE><EMPNO>7369</EMPNO><ENAME>SMITH</ENAME></EMPLOYEE><EMPLOYEE
><EMPNO>7499</EMPNO><ENAME>ALLEN</ENAME></EMPLOYEE><EMPLOYEE><EMPNO>7521</EMPNO>
<ENAME>WARD</ENAME></EMPLOYEE></EMPLOYEES>

1 row selected.

Regards
Michel
Re: xml data to html table with <ROW> tag data not displayed [message #560798 is a reply to message #560197] Tue, 17 July 2012 04:01 Go to previous message
nischalinn
Messages: 117
Registered: May 2012
Location: nepal
Senior Member
@Michel, thank you for the post...
Previous Topic: convert column data to xml format
Next Topic: Best Driver
Goto Forum:
  


Current Time: Sun Oct 26 03:06:37 CDT 2014

Total time taken to generate the page: 0.07558 seconds