Hi there..
I am just about pulling my hair out on this one.
OK here is the deal.. There is an XML file at which i want to pull data from and display on my website. The aforementioned XML page starts with :-
<?xml version="1.0"?>
<!DOCTYPE server_status SYSTEM "mythic.dtd">
<server_status>
<server name="Pendragon" type="Test">
<population>214</population>
<status>Up</status>
<relic name="Scabbard of Excalibur" type="Melee" realm="Albion">
<owner>Albion</owner>
</server>
</server_status>
I cut it down quite a bit on here, but the original is much bigger. Now without the line <!DOCTYPE server_status SYSTEM "mythic.dtd"> I am able to at least query the XML file itself by using the following in my HTML file
<script type="text/javascript" for="window" event="onload">
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"
xmlDoc.async="false";
xmlDoc.load("servers.xml"
nodes = xmlDoc.documentElement.childNodes;
server.innerText = nodes.item(0).text;
</script>
<span id="server">
But if i put back the DTD line i get nothing. I get an Oject missing error on the "nodes = xml etc...." line.
Why do I get this... I want to know how to pull any/some or all of the data from the XML page into an HTML document.
I understand that the DTD file is there to define the building blocks of the XML file, but why can i not extract data from the XML file now. What do i need to type in?
The DTD file is as follows
<!ELEMENT server_status (server+)>
<!ATTLIST server_status xmlns CDATA #REQUIRED>
<!ELEMENT server (population, status, relic+, keep+)>
<!ATTLIST server name CDATA #REQUIRED>
<!ATTLIST server type CDATA "Normal">
<!ELEMENT population (#PCDATA)>
<!ELEMENT status (#PCDATA)>
<!ELEMENT relic (owner)>
<!ATTLIST relic name CDATA #REQUIRED>
<!ATTLIST relic type (Melee|Magic) "Melee">
<!ATTLIST relic realm CDATA #REQUIRED>
<!ELEMENT keep (owner)>
<!ATTLIST keep name CDATA #REQUIRED>
<!ATTLIST keep realm CDATA #REQUIRED>
<!ELEMENT owner (#PCDATA)>
I really dont know much about this subject
Cheers
I am just about pulling my hair out on this one.
OK here is the deal.. There is an XML file at which i want to pull data from and display on my website. The aforementioned XML page starts with :-
<?xml version="1.0"?>
<!DOCTYPE server_status SYSTEM "mythic.dtd">
<server_status>
<server name="Pendragon" type="Test">
<population>214</population>
<status>Up</status>
<relic name="Scabbard of Excalibur" type="Melee" realm="Albion">
<owner>Albion</owner>
</server>
</server_status>
I cut it down quite a bit on here, but the original is much bigger. Now without the line <!DOCTYPE server_status SYSTEM "mythic.dtd"> I am able to at least query the XML file itself by using the following in my HTML file
<script type="text/javascript" for="window" event="onload">
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM"
xmlDoc.async="false";
xmlDoc.load("servers.xml"
nodes = xmlDoc.documentElement.childNodes;
server.innerText = nodes.item(0).text;
</script>
<span id="server">
But if i put back the DTD line i get nothing. I get an Oject missing error on the "nodes = xml etc...." line.
Why do I get this... I want to know how to pull any/some or all of the data from the XML page into an HTML document.
I understand that the DTD file is there to define the building blocks of the XML file, but why can i not extract data from the XML file now. What do i need to type in?
The DTD file is as follows
<!ELEMENT server_status (server+)>
<!ATTLIST server_status xmlns CDATA #REQUIRED>
<!ELEMENT server (population, status, relic+, keep+)>
<!ATTLIST server name CDATA #REQUIRED>
<!ATTLIST server type CDATA "Normal">
<!ELEMENT population (#PCDATA)>
<!ELEMENT status (#PCDATA)>
<!ELEMENT relic (owner)>
<!ATTLIST relic name CDATA #REQUIRED>
<!ATTLIST relic type (Melee|Magic) "Melee">
<!ATTLIST relic realm CDATA #REQUIRED>
<!ELEMENT keep (owner)>
<!ATTLIST keep name CDATA #REQUIRED>
<!ATTLIST keep realm CDATA #REQUIRED>
<!ELEMENT owner (#PCDATA)>
I really dont know much about this subject
Cheers