M
mwschenckCRL
I have an HTML, XML, and Javascript file.
I need the HTML page when accessed to display what ever is in the XML
file.
I have these files zipped that I can send, or please look at the
snippet below.
what should display on the HTML page in a table is
name 1 (e-mail address removed)
name 2 (e-mail address removed)
this wont because it is personal and private
personal 1 (e-mail address removed)
Thank you
=====================
<html>
<!-- Load our XML utilities for data islands and templates -->
<head><script src="xml.js"></script></head>
<!-- Expand all templates on document load -->
<body onload="XML.expandTemplates()">
<!-- This is an XML data island with our data -->
<xml id="data" style="display:none"> <!-- hidden with CSS -->
<contacts>
<contact name="name 1"><email>[email protected]</email></contact>
<contact name="name 2"><email>[email protected]</email></contact>
<contact name="name 3"><email>[email protected]</email></contact>
</contacts>
</xml>
<!-- These are just regular HTML elements -->
<table>
<tr><th>Name</th><th>Address</th></tr>
<!-- This is a template. Data comes from the data island with id
"data". -->
<!-- The template will be expanded and copied once for each <contact>
tag -->
<tr datasource="#data" foreach="//contact">
<!-- The "name" attribute of the <contact> is inserted into this
element -->
<td data="@name"></td>
<!-- The content of the <email> child of the <contact> goes in here -->
<td data="email"></td>
</tr> <!-- end of the template -->
</table>
</body>
</html>
<?xml version="1.0"?>
<contacts>
<contact name="name 1"><email>[email protected]</email></contact>
<contact name="name 2"><email>[email protected]</email></contact>
<contact name="personal 1"
Personal="true"><email>[email protected]</email></contact>
</contacts>
I need the HTML page when accessed to display what ever is in the XML
file.
I have these files zipped that I can send, or please look at the
snippet below.
what should display on the HTML page in a table is
name 1 (e-mail address removed)
name 2 (e-mail address removed)
this wont because it is personal and private
personal 1 (e-mail address removed)
Thank you
=====================
<html>
<!-- Load our XML utilities for data islands and templates -->
<head><script src="xml.js"></script></head>
<!-- Expand all templates on document load -->
<body onload="XML.expandTemplates()">
<!-- This is an XML data island with our data -->
<xml id="data" style="display:none"> <!-- hidden with CSS -->
<contacts>
<contact name="name 1"><email>[email protected]</email></contact>
<contact name="name 2"><email>[email protected]</email></contact>
<contact name="name 3"><email>[email protected]</email></contact>
</contacts>
</xml>
<!-- These are just regular HTML elements -->
<table>
<tr><th>Name</th><th>Address</th></tr>
<!-- This is a template. Data comes from the data island with id
"data". -->
<!-- The template will be expanded and copied once for each <contact>
tag -->
<tr datasource="#data" foreach="//contact">
<!-- The "name" attribute of the <contact> is inserted into this
element -->
<td data="@name"></td>
<!-- The content of the <email> child of the <contact> goes in here -->
<td data="email"></td>
</tr> <!-- end of the template -->
</table>
</body>
</html>
<?xml version="1.0"?>
<contacts>
<contact name="name 1"><email>[email protected]</email></contact>
<contact name="name 2"><email>[email protected]</email></contact>
<contact name="personal 1"
Personal="true"><email>[email protected]</email></contact>
</contacts>