What do you mean? How are you using your browser to get the count. Can you show us your stylesheet?
Hi,
Am not using any stylesheet here. I'm working on Gentran Integration Suite and the xml file which I've given is the file generated from Gentran server. I want to get DocumentId count in developing one of the Business Process(BP), so I tried externally to find the count(Pls check below), but couldn't. To my surprise count(//DocumentId) worked well in the server. But I don't know why it's not working with the below code. Could please help me. Thanks in Advance...
// Sample HTML file
<code>
<html>
<body>
<script type="text/javascript">
function loadXMLDoc(fname)
{
var xmlDoc;
// code for IE
if (window.ActiveXObject)
{
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
{
xmlDoc=document.implementation.createDocument("","",null);
}
else
{
alert('Your browser cannot handle this script');
}
xmlDoc.async=false;
xmlDoc.load(fname);
return(xmlDoc);
}
xml=loadXMLDoc("/home/miracle/Desktop/ProcessData.xml");
path = "count(//DocumentId)"
// code for IE
if (window.ActiveXObject)
{
var nodes=xml.selectNodes(path);
for (i=0;i<nodes.length;i++)
{
document.write(nodes[i].childNodes[0].nodeValue);
document.write("<br />");
}
}
// code for Mozilla, Firefox, Opera, etc.
else if (document.implementation && document.implementation.createDocument)
{
var nodes=xml.evaluate(path, xml, null, XPathResult.ANY_TYPE, null);
var result=nodes.iterateNext();
while (result)
{
document.write(result.childNodes[0].nodeValue);
document.write("<br />");
result=nodes.iterateNext();
}
}
</script>
</body>
</html>
</code>
// Here is XML file generated by Gentran server
<code>
<?xml version="1.0" encoding="UTF-8"?>
<ProcessData>
<SessionBeginTime>2009-07-15 09:01:37.687</SessionBeginTime>
<SessionToken>FTPClientAdapter_FTPClientAdapter_node1_12476736976871096:9472</SessionToken>
<Status>0</Status>
<ServerResponse>
<Code>250</Code>
<Text>250 CWD successful. "/Prav1" is current directory.</Text>
</ServerResponse>
<TranscriptDocumentId>dev4206:80f4cb:1227ba94d1e:5b70</TranscriptDocumentId>
<TranscriptDocument_1 SCIObjectID="dev4206:80f4cb:1227ba94d1e:5b73"/>
<TranscriptDocumentId>dev4206:80f4cb:1227ba94d1e:5b89</TranscriptDocumentId>
<TranscriptDocument_2 SCIObjectID="dev4206:80f4cb:1227ba94d1e:5b8c"/>
<TranscriptDocument_4 SCIObjectID="dev4206:80f4cb:1227ba94d1e:5be8"/>
<FSA_Document1.txt SCIObjectID="dev4206:80f4cb:1227ba94d1e:5be9"/>
<FSA_Document2.txt SCIObjectID="dev4206:80f4cb:1227ba94d1e:5bea"/>
<FSA_Document3.txt SCIObjectID="dev4206:80f4cb:1227ba94d1e:5beb"/>
<FSA_Document4.txt SCIObjectID="dev4206:80f4cb:1227ba94d1e:5bec"/>
<Status>0</Status>
<TranscriptDocumentId>dev4206:80f4cb:1227ba94d1e:5bde</TranscriptDocumentId>
<ServerResponse>
<Code>226</Code>
<Text>226 Transfer OK</Text>
</ServerResponse>
<DocumentList>
<DocumentId>dev4206:80f4cb:1227ba94d1e:5ba8</DocumentId>
<DocumentId>dev4206:80f4cb:1227ba94d1e:5bb5</DocumentId>
<DocumentId>dev4206:80f4cb:1227ba94d1e:5bb8</DocumentId>
<DocumentId>dev4206:80f4cb:1227ba94d1e:5bbb</DocumentId>
</DocumentList>
<count>1</count>
</ProcessData>
</code>