Retrieve XML in HTML ?

Please support our XML, XSLT and XPATH advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: Apr 2008
Posts: 495
Reputation: veledrom is an unknown quantity at this point 
Solved Threads: 0
veledrom veledrom is offline Offline
Posting Pro in Training

Retrieve XML in HTML ?

 
0
  #1
Dec 11th, 2008
Hi,

This is my XML file. I want to retrieve information stored in a HTML Table in index.html page. How can i do it?

Thanks

XML, XSLT and XPATH Syntax (Toggle Plain Text)
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <memo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="memo.xsd">
  3. <header>
  4. <companyName>XML development LTD</companyName>
  5. <to>myemail@yahoo.com</to>
  6. <from>xml@yahoo.com</from>
  7. <date>1979-11-07</date>
  8. <reg>I don't know the reg</reg>
  9. </header>
  10. <body>
  11. <message>
  12. <parag>Hello, How are you today?</parag>
  13. <sign></sign>
  14. </message>
  15. </body>
  16. </memo>

I couldn't do more than this:
XML, XSLT and XPATH Syntax (Toggle Plain Text)
  1. <xml id="mamoData" src="memo.xml"></xml>
  2. <table datasrc="#memoData" border="1px">
  3. <thead>
  4. <th>COMPANY</th>
  5. <th>TO</th>
  6. <th>FROM</th>
  7. <th>DATE</th>
  8. <th>REG</th>
  9. </thead>
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 495
Reputation: veledrom is an unknown quantity at this point 
Solved Threads: 0
veledrom veledrom is offline Offline
Posting Pro in Training

Re: Retrieve XML in HTML ?

 
0
  #2
Dec 11th, 2008
Did it.
XML, XSLT and XPATH Syntax (Toggle Plain Text)
  1. <html>
  2. <head>
  3. <title>Memo</title>
  4. </head>
  5. <body>
  6. <xml id="memoData" src="memo.xml"></xml>
  7.  
  8. <table datasrc="#memoData" datafld="header" border="1">
  9. <tr>
  10. <td colspan="2">HEADER</td>
  11. </tr>
  12. <tr>
  13. <td>Company</td>
  14. <td>&nbsp;<span datasrc="#memoData" datafld="companyName"></span></td>
  15. </tr>
  16. <tr>
  17. <td>To</td>
  18. <td>&nbsp;<span datasrc="#memoData" datafld="to"></span></td>
  19. </tr>
  20. <tr>
  21. <td>From</td>
  22. <td>&nbsp;<span datasrc="#memoData" datafld="from"></span></td>
  23. </tr>
  24. <tr>
  25. <td>Date</td>
  26. <td>&nbsp;<span datasrc="#memoData" datafld="date"></span></td>
  27. </tr>
  28. <tr>
  29. <td>Reg</td>
  30. <td>&nbsp;<span datasrc="#memoData" datafld="reg"></span></td>
  31. </tr>
  32. </table>
  33.  
  34. <table datasrc="#memoData" datafld="body" border="1">
  35. <tr>
  36. <td colspan="2">BODY</td>
  37. </tr>
  38. <tr>
  39. <td>Paragraph</td>
  40. <td>
  41. <table datasrc="#memoData" datafld="message">
  42. <tr>
  43. <td>&nbsp;<span datasrc="#memoData" datafld="parag"></span></td>
  44. </tr>
  45. </table>
  46. </td>
  47. </tr>
  48. <tr>
  49. <td>Signature</td>
  50. <td>
  51. <table datasrc="#memoData" datafld="message">
  52. <tr>
  53. <td>&nbsp;<span datasrc="#memoData" datafld="sign"></span></td>
  54. </tr>
  55. </table>
  56. </td>
  57. </tr>
  58. </table>
  59.  
  60. </body>
  61. </html>
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the XML, XSLT and XPATH Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC