Invalid XML data
FusionCharts Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        



Invalid XML data Expand / Collapse
Author
Message
Posted 4/18/2008 10:13:40 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/30/2008 11:07:50 PM
Posts: 9, Visits: 29
Hi,

I am using the Gantt.swf in FusionWidget V3 Eva version, and I am creating a Gantt chart with 8 tasks.

I need to add the link against the task, which means, when you click the task, it should run a javascript which needs to pass three php variables.

Before I put the link on, the chart works fine. But, when I put the link, I got the error.
when I put this in code:
link='javascript:launchdailyreport('report.php','".$daily_report[$i]["date"]."','".$daily_report[$i]["code"]."','".$daily_report[$i]["en"]."')'
I can see the xml in the page source when I render the page in IE
<task label='Start:22:00 Finish:06:16 Duration:8 hours 16 minutes' start='07/01/2008 22:00:00'  end='07/02/2008 06:16:00'  processId='13-Apr-2008'  link='javascript:launchreport('report.php','13-Apr-2008','XXX','YYY')'  />
and on the page, it shows "Invalid XML data"

and when I change all the single quote (') to %26apos; it is like
link='javascript:launchdailyreport(%26apos; report.php %26apos; , %26apos; ".$daily_report[$i]["date"]." %26apos; , %26apos; ".$daily_report[$i]["code"]."%26apos; , %26apos; ".$daily_report[$i]["en"]." %26apos; )'
I can see the the xml in the page source when I render the page in IE
<task label='Start:22:00 Finish:06:16 Duration:8 hours 16minutes' start='07/01/2008 22:00:00'  end='07/02/2008 06:16:00'  processId='13-Apr-2008'  link='javascript:launchreport(&apos'  />
and of course it is "Invalid XML data" error.

I dont know how to fix it.

Hope you could understand my situation. Thanks in advance.

Post #5775
Posted 4/19/2008 1:55:12 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Yesterday @ 5:59:55 AM
Posts: 578, Visits: 882
Hi,

Could you please send us the php code (or the code block) where you are generating this link?

It seems that somewhere the XML is getting broken.

Regards,

Sudipto Choudhury
FusionCharts Team

Post #5779
Posted 4/20/2008 7:55:30 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/30/2008 11:07:50 PM
Posts: 9, Visits: 29
I am using the FusionCharts_Gen.php which is in the free version \FusionChartsFree\Code\PHPClass\Includes to generate the xml, I modified a bit to fit the version 3, like change the swf file name without "FCF_", changed the to , and changed the "name" to "label".

In order to get the %26apos; I changed the Parameter Delimiter to be ";;" instead of the default ";".

but seems it cannot work with the %26apos;

Thanks
Post #5785
Posted 4/21/2008 12:45:18 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Yesterday @ 5:59:55 AM
Posts: 578, Visits: 882
Hi,

Could you please try seeting some other delimeter? like "$$" etc. and try again. Could you please send us the code that you are witing using PHP Class to generate this XML?

Regards,

Sudipto Choudhury
FusionCharts Team

Post #5787
Posted 4/21/2008 7:18:54 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/30/2008 11:07:50 PM
Posts: 9, Visits: 29
Thanks for the reply, I tried the different Parameter Delimiter, and get this result:

<task label='Start:22:00 Finish:06:30' start='07/01/2008 22:00:00'  end='07/02/2008 06:30:00'  processId='07-Apr-2008'  link='javascript:launchdailyreport(&apos;report.php&apos;,&apos;07-Apr-2008&apos;,&apos; XXX&apos;,&apos;YYY&apos'  />

here are the code for adding task for Gantt Chart

# Setting Tasks Parameter into TaskParam variables
  function setGanttTasksParams($strParam){
    $listArray=explode($this->del,$strParam);
    # Fetching all value and converting into xml attribute
    foreach ($listArray as $valueArray) {
      $paramValue=explode("=",$valueArray);
     if($this->validateParam($paramValue)==true){
       $this->GT_Tasks_Param .= $paramValue[0] . "='" . $this->encodeSpecialChars($paramValue[1]) . "' ";
    }
    }
  }  
 
  # Function addGanttTasks adding Tasks
  function addGanttTask($label="",$catParam=""){
     
    $strCatXML="";
   $strParam="";
  
   # cheking catParam not blank
   if($catParam!=""){
    $listArray=explode($this->del,$catParam);
    foreach ($listArray as $valueArray) {
     $paramValue=explode("=",$valueArray);
     if($this->validateParam($paramValue)==true){
      # creating parameter set
        if(trim(strtolower($paramValue[0]))=="link"){
          $strParam .= $paramValue[0] . "='" . urldecode($paramValue[1]) . "' ";
        }else{
        $strParam .= $paramValue[0] . "='" . $this->encodeSpecialChars($paramValue[1]) . "' ";
      }
     }
    }
    }
   # adding label and parameter set to category
    $strCatXML ="<task label='" . $label . "' " . $strParam . " />";
           
    # storing into GT_Tasks array
    $this->GT_Tasks[$this->GT_Tasks_Counter]=$strCatXML;
    # Increase Counter
    $this->GT_Tasks_Counter++;
  }

and the code to get the task xml

# Function getProcessesXML for getting Processes part XML
  function getTasksXML(){
   
   $partXML="";
   # adding processes parameter
   $partXML="<tasks " . $this->GT_Tasks_Param . " >";
   foreach($this->GT_Tasks as $part_type => $part_name){
    if($part_name!=""){
     # adding elements
     $partXML .= $part_name;
    }
   }
   
   # Closing <tasks>
   $partXML .="</tasks>";
   return $partXML;
  }

Thanks.

Post #5818
Posted 4/23/2008 7:02:53 AM
Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Moderators
Last Login: Yesterday @ 5:59:55 AM
Posts: 578, Visits: 882
hi,

I suppose you must be using addGanttTask($label="",$catParam="") function and in the param you are passing the link. e.g.

FC->setParamDelimiter(":");

FC->setParamFC->addGanttTask("abc","link=jsfnName(%26apos;a1%26apos;,%26apos;a2%26apos");

Could you please try once :

FC->setParamFC->addGanttTask("abc","link=jsfnName(&apos;a1&apos;,&apos;a2&apos");

(since addGanttTask() itself encodes the & to %26)

Regards,

Sudipto Choudhury
FusionCharts Team

Post #5883
Posted 4/23/2008 9:50:28 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/30/2008 11:07:50 PM
Posts: 9, Visits: 29
Thanks for your reply, but it still does not work.

link='javascript:launchdailyreport(&apos;report.php&apos;,&apos;07-Apr-2008&apos;,&apos;XXX&apos;,&apos;YYY&apos; );'

Post #5905
Posted 4/24/2008 1:01:11 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: Forum Members
Last Login: 4/30/2008 11:07:50 PM
Posts: 9, Visits: 29
Hi, thanks for the reply, I did a very simple thing and it is working now.

You are right, it transfers %26apos; to &apos;, so I manually update the &apos; back to %26apos before it render the chart and it is working.

Maybe this sound stupid

But anyway, thanks for your help
Post #5908
« Prev Topic | Next Topic »


Permissions Expand / Collapse