943,657 Members | Top Members by Rank

Ad:
Dec 11th, 2008
0

Retrieve XML in HTML ?

Expand Post »
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>
Similar Threads
Reputation Points: 38
Solved Threads: 0
Master Poster
veledrom is offline Offline
724 posts
since Apr 2008
Dec 11th, 2008
0

Re: Retrieve XML in HTML ?

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>
Reputation Points: 38
Solved Threads: 0
Master Poster
veledrom is offline Offline
724 posts
since Apr 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in XML, XSLT and XPATH Forum Timeline: How to get exact xml file name
Next Thread in XML, XSLT and XPATH Forum Timeline: XML Formated Email ?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC