gohankid77
Technical User
Incoming Newbie to the site!
Note: My page is valid if I don't use the <xml> tag or the datasrc and datafld attributes.
In the past, I have used the <xml> tag, which is not supported by the W3C, to add data from an XML file into my HTML page. However, I recently came upon the W3C's validation service. My page is not valid. Is there a way for me to add XML to my XHTML page and make it valid without using a substantial amount of coding in JavaScript or another scripting language? I was thinking the <link> tag would work, but I have no idea how I would use it or what values I would use for the attributes. Here is a test page in XHTML 1.1 code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "<html>
<head>
<title>Test</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
th
{
text-align: left
}
-->
</style>
</head>
<body>
<!-- I know the XML tag is not a tag supported by the W3C -->
<xml id="test" src="test.xml"></xml>
<table style="border-width: 0px" datasrc="#test">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr>
<td><span datafld="abc"></span></td>
<td><span datafld="def"></span></td>
<td><span datafld="ghi"></span></td>
</tr>
</table>
</body>
</html>
And here is my test.xml file:
<?xml version="1.0" encoding="UTF-8" ?>
<test>
<abc>ABC</abc>
<def>DEF</def>
<ghi>GHI</ghi>
</test>
If you have any ideas about this. Please let me know.
Note: My page is valid if I don't use the <xml> tag or the datasrc and datafld attributes.
In the past, I have used the <xml> tag, which is not supported by the W3C, to add data from an XML file into my HTML page. However, I recently came upon the W3C's validation service. My page is not valid. Is there a way for me to add XML to my XHTML page and make it valid without using a substantial amount of coding in JavaScript or another scripting language? I was thinking the <link> tag would work, but I have no idea how I would use it or what values I would use for the attributes. Here is a test page in XHTML 1.1 code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "<html>
<head>
<title>Test</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css">
<!--
th
{
text-align: left
}
-->
</style>
</head>
<body>
<!-- I know the XML tag is not a tag supported by the W3C -->
<xml id="test" src="test.xml"></xml>
<table style="border-width: 0px" datasrc="#test">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
</tr>
<tr>
<td><span datafld="abc"></span></td>
<td><span datafld="def"></span></td>
<td><span datafld="ghi"></span></td>
</tr>
</table>
</body>
</html>
And here is my test.xml file:
<?xml version="1.0" encoding="UTF-8" ?>
<test>
<abc>ABC</abc>
<def>DEF</def>
<ghi>GHI</ghi>
</test>
If you have any ideas about this. Please let me know.