Click here to Skip to main content
15,909,199 members
Home / Discussions / XML / XSL
   

XML / XSL

 
QuestionXPATH problem Pin
Rohit16db15-Dec-09 3:23
Rohit16db15-Dec-09 3:23 
AnswerRe: XPATH problem Pin
Stuart Dootson15-Dec-09 11:31
professionalStuart Dootson15-Dec-09 11:31 
QuestionMissunderstanding schema namespaces Pin
FJJCENTU6-Dec-09 2:00
FJJCENTU6-Dec-09 2:00 
AnswerRe: Missunderstanding schema namespaces Pin
Dimitri Witkowski27-Dec-09 0:08
Dimitri Witkowski27-Dec-09 0:08 
QuestionXML ASP to ASP.net with url parameters [modified] Pin
smichael4-Dec-09 15:59
smichael4-Dec-09 15:59 
QuestionCreate HTML with XML including Images and XSL Pin
FJJCENTU4-Dec-09 6:58
FJJCENTU4-Dec-09 6:58 
AnswerRe: Create HTML with XML including Images and XSL Pin
Brij14-Dec-09 7:51
mentorBrij14-Dec-09 7:51 
QuestionA XMLHttpRequest Request: It looked simple enough, now I just want it to work. Pin
Greth30-Nov-09 3:45
Greth30-Nov-09 3:45 
I've followed a simple example to load an xml file into a table using 'httprequest'. I know my way around code, but this is my first time coding a webpage in 6 years, a 'quicky temp replacement' for a small business website catalog. I'm a hapless newbie once again.

The below code worked fine with a sample xml file I made (one with only two records), but when I exported the full file from a database it only returned one line in the table (the xml files have the exact same structure, only more entries).
Also, when using this in Firefox it never stops loading. And eventhough there is a clause to make it work with IE, it doesn't.
Any help is appreciated, even if it is a complete alternative way of tackling this ... rather basic thing ...

The code:
<html>
<head>

<script type="text/javascript">
var xmlDoc;
if (window.XMLHttpRequest)
  {
  xhttp=new XMLHttpRequest();
  }
else // Internet Explorer 5/6
  {
  xhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xhttp.open("GET","Cat2.xml",false);
xhttp.send("");
xmlDoc=xhttp.responseXML;

var x=xmlDoc.getElementsByTagName("FMPDSORESULT");

function display()
{
document.write("<table border='0'>");
var x=xmlDoc.getElementsByTagName("ROW");
for (i=0;i<x.length;i++)
  {
  document.write("<tr><td>");
  document.write("<a href=");
  document.write(x[i].getElementsByTagName("IMG")[0].childNodes[0].nodeValue);
  document.write(">");
  document.write("<img src=");
  document.write(x[i].getElementsByTagName("THUMB")[0].childNodes[0].nodeValue);
  document.write("/></a>");
  document.write("</td><td>");
  document.write(x[i].getElementsByTagName("DESCRNL")[0].childNodes[0].nodeValue);
  document.write("</td><td>");
  document.write(x[i].getElementsByTagName("DESCRFR")[0].childNodes[0].nodeValue);
  document.write("</td></tr>");
 
  }
document.write("</table>");
}
</script>
</head>

<body>
<button onClick="display()">VINDICATION</button>

</body>
</html>

The xml file (one entry)
<?xml version="1.0" ?>
   <FMPDSORESULT>
     <ROW MODID="15" RECORDID="27599">
        <DESCRFR></DESCRFR>
        <DESCRNL>
          Een polychrome art deco vaas van zachte pasta. Onderaan gemerkt.
        </DESCRNL>
        <DIM>
          (11 cm)
        </DIM>
        <EST>
          € 25/30
        </EST>
        <THUMB>
&quot;
          Images/pics/Thumb/008_thumb.jpg
&quot;
        </THUMB>
        <IMG>
&quot;
          Images/pics/008.jpg
&quot;
        </IMG>
        <AUTEUR>
          A. Dubois
        </AUTEUR>
      </ROW>

AnswerRe: A XMLHttpRequest Request: It looked simple enough, now I just want it to work. Pin
Stuart Dootson2-Dec-09 22:43
professionalStuart Dootson2-Dec-09 22:43 
GeneralRe: A XMLHttpRequest Request: It looked simple enough, now I just want it to work. Pin
Vindhyachal_Kumar22-Dec-09 4:27
professionalVindhyachal_Kumar22-Dec-09 4:27 
QuestionSpecification for Data Transfer in XML format? Pin
Anuj Chauhan from India29-Nov-09 21:43
Anuj Chauhan from India29-Nov-09 21:43 
AnswerRe: Specification for Data Transfer in XML format? Pin
dan!sh 29-Nov-09 23:15
professional dan!sh 29-Nov-09 23:15 
QuestionStoring XML data into SQL database Pin
KSR8125-Nov-09 8:44
KSR8125-Nov-09 8:44 
AnswerRe: Storing XML data into SQL database Pin
Ashfield26-Nov-09 1:22
Ashfield26-Nov-09 1:22 
QuestionExample modal popup in XSL Pin
Dangermouse50023-Nov-09 23:41
Dangermouse50023-Nov-09 23:41 
QuestionProcedure for sending XML between Web Computers without Web Services Pin
FJJCENTU19-Nov-09 12:11
FJJCENTU19-Nov-09 12:11 
AnswerRe: Procedure for sending XML between Web Computers without Web Services Pin
Richard MacCutchan19-Nov-09 22:10
mveRichard MacCutchan19-Nov-09 22:10 
QuestionHow to embed images in to xml file? Pin
chandrusofts16-Nov-09 22:07
chandrusofts16-Nov-09 22:07 
AnswerRe: How to embed images in to xml file? Pin
Ghydo16-Nov-09 23:45
Ghydo16-Nov-09 23:45 
GeneralRe: How to embed images in to xml file? Pin
ammaippan19-Nov-09 19:44
ammaippan19-Nov-09 19:44 
GeneralRe: How to embed images in to xml file? Pin
Ghydo20-Nov-09 0:02
Ghydo20-Nov-09 0:02 
GeneralRe: How to embed images in to xml file? Pin
ammaippan23-Nov-09 0:33
ammaippan23-Nov-09 0:33 
GeneralRe: How to embed images in to xml file? Pin
Ghydo23-Nov-09 6:42
Ghydo23-Nov-09 6:42 
Question'_Chairs' is an unexpected token. The expected token is '='. Line 1, position 545. Pin
Vimalsoft(Pty) Ltd16-Nov-09 0:03
professionalVimalsoft(Pty) Ltd16-Nov-09 0:03 
AnswerRe: '_Chairs' is an unexpected token. The expected token is '='. Line 1, position 545. Pin
Richard MacCutchan16-Nov-09 0:17
mveRichard MacCutchan16-Nov-09 0:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.