Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I am trying create reload the dashboard using below condition but not able to do that.
getting below error:
XML document must have a top level element.
Dashboard script Script:
LET vFilePath='\TaskLogIndex\TaskLogIndex_*.xml';
LET vSize =FileSize('$(vFilePath)'); //test the file size
IF vSize > 3000 THEN
LOAD
LogID,
TaskName,
Date,
Time,
ClusterID,
FullLogPath,
FileSize() as fsz
FROM $(vFilePath)(XmlSimple, Table is [Root/LogIndex]);
ENDIF
Thank you,
YJ
This error occurs when you have extra Tag in your XML code?
Thank you anil,
Could you please help me.
I want to load file which is greater than 3 KB but my IF condition doesnt work properly.
please provide your thoughts.
Try this?
LET vSize = filesize(myfile);
IF '$(vSize)' > 3000 THEN
LOAD * FROM myfile;
ENDIF
So, In your expression you may forget this?
LET vFilePath='\TaskLogIndex\TaskLogIndex_*.xml';
LET vSize =FileSize('$(vFilePath)'); //test the file size
IF '$(vSize)' > 3000 THEN
LOAD
LogID,
TaskName,
Date,
Time,
ClusterID,
FullLogPath,
FileSize() as fsz
FROM $(vFilePath)(XmlSimple, Table is [Root/LogIndex]);
ENDIF
IF $(vSize) > 3000 then
...
ENDIF
In spite of the previous comments, this syntax is correct, so changing it is not necessary:
IF vSize > 3000 THEN
The error you are getting is that the XML file is not well-formed as it lacks a root (or top-level) element. A well-formed XML dopcument will have the layout
<?xml version="1.0" ?>
<rootnode>
<elementnode></elementnode>
<elementnode></elementnode>
...
</rootnode>
Your document may be lacking the header node and/or root node
https://www.google.co.za/search?source=hp&q=well-formed+XML&oq=well-formed+XML
You probably are trying to load a corrupted file, would you mind posting it?