|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 4/10/2008 4:51:36 PM
Posts: 9,
Visits: 13
|
|
| I'm pulling db generated xml and using xslt to transform it to FC readable XML. The output xml is written to a webpage by document.write(fc_xml). This page is then used as the URL for dataURL. The content is not visible if fc_xml is loaded, but the source listing is correct. <?xml version="1.0" encoding="UTF-8"?> <chart caption="test" decimals="0" enableSmartLabels="1"> <set label="Alchemy" value="4" /> <set label="Orion/Pegasus" value="38" /> <set label="Other" value="56" /> <set label="SandCraft" value="34" /> <set label="Scalable Processor Solutions" value="57" /> </chart> I always get this error: "ERROR: Invalid XML encountered. A start-tag is not matched with an end-tag. Click the above "dataURL Invoked" link to see the XML in browser Or check the XML data provided."
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 4/10/2008 4:51:36 PM
Posts: 9,
Visits: 13
|
|
| Alright, now I know the problem with document.write(), it's doesn't work for XML. Now, I'm using the DOM to parse the string returned by an XSL transform. I then use the xml of the returned DOM object as the setDataXML. Now I get a different error message: ERROR: Invalid XML encountered. The XML declaration is not properly terminated. How can that be, the xml was created by DOM?
|
|
|
|
|
Supreme Being
      
Group: Moderators
Last Login: 10/5/2008 9:41:33 AM
Posts: 809,
Visits: 1,285
|
|
| Hi, Can you try passing the XML as String using toString().
Regards,
Sudipto Choudhury FusionCharts Team
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 4/10/2008 4:51:36 PM
Posts: 9,
Visits: 13
|
|
| I tried passing doc.xml.toString(). did not work. I tried removing the xml declaration, the example for setDataXML did not have it. did not work. I tried passing the string from xsl transform without the declaration. still did not work. The error says malformed XML. This is the string I'm setting. I pasted this string in, and still did not work. '<chart caption="test" decimals="0" enableSmartLabels="1"><set label="Alchemy" value="4" /><set label="Orion/Pegasus" value="38" /><set label="Other" value="56" /><set label="SandCraft" value="34" /><set label="Scalable Processor Solutions" value="57" /></chart>'
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 4/10/2008 4:51:36 PM
Posts: 9,
Visits: 13
|
|
| The setDataXML expects the string to have single quotes for the attributes. This is Version 3. I dropping back down to the Version2 or Free and see what happens. This works. myChart.setDataXML("<chart caption='test' decimals='0' enableSmartLabels='1'><set label='Alchemy' value='4' /><set label='Orion/Pegasus' value='38' /><set label='Other' value='56' /><set label='SandCraft' value='34' /><set label='Scalable Processor Solutions' value='57' /></chart>"); This does not work. myChart.setDataXML('<chart caption="test" decimals="0" enableSmartLabels="1"><set label="Alchemy" value="4" /><set label="Orion/Pegasus" value="38" /><set label="Other" value="56" /><set label="SandCraft" value="34" /><set label="Scalable Processor Solutions" value="57" /></chart>');
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 4/10/2008 4:51:36 PM
Posts: 9,
Visits: 13
|
|
| Just confirmed. FCFree has the same bug on setDataXML method. <set label='name' value='1' />, works <set label="name" value="1" />, does not work
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 4/10/2008 4:51:36 PM
Posts: 9,
Visits: 13
|
|
| One more idea, do a replace " with ' on my string using regular expression.
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 4/10/2008 4:51:36 PM
Posts: 9,
Visits: 13
|
|
| Finally!!!. Thanks for sugessting the string. It got me thru debug faster and with shorter script. I don't have to parse XML anymore, just send the XSL transformed string and replace the double quotes.
|
|
|
|
| | |