Timeline.DefaultEventSource.loadXML method specifically looks for named attributes on the event element. It does not look for child elements. It would be possible to write your own XML parser to handle child elements instead of nodes.
While the data encoded in your examples may be the same, the two forms are not equivalent. --Mike On Sep 24, 2011, at 11:49 PM, Robert wrote: > I am trying to get data from a SQL Server database into the Simile > Timeline. For testing I have been using SQL queries and copy/pasting > the data returned into Example.xml between the <data></data> tags. > > If I generate my data with > Select * from dbo.TimeLineData(@User) As Event For XML AUTO > then the data is generated like > <Event trackNum="1" link="http://www.nzgdb.co.nz/gdb_pages/gdb2.aspx? > linkid=C2A089E7-1AD9-4EB5-AF58-01EBBE839DFA" title="OWLD, > John(1749-1832)" start="01 Jan 1749" latestStart="30 Jun 1749" > durationEvent="true" end="Apr 20 1832" caption="Father's Father's > Father" textColor="black" /> > > This works correctly. > > However if I generate it as > Select * from dbo.TimeLineData(@User) As Event For XML AUTO, > ELEMENTS > then it is generated like > <Event> > <trackNum>1</trackNum> > <link>http://www.nzgdb.co.nz/gdb_pages/gdb2.aspx? > linkid=C2A089E7-1AD9-4EB5-AF58-01EBBE839DFA</link> > <title>OWLD, John(1749-1832)</title> > <start>01 Jan 1749</start> > <latestStart>30 Jun 1749</latestStart> > <durationEvent>true</durationEvent> > <end>Apr 20 1832</end> > <caption>Father's Father's Father</caption> > <textColor>black</textColor> > </Event> > and when I copy/paste this into Example.xml the timeline fails, with > message > Microsoft JScript runtime error: Object expected > and the debugger highlights the third "}" on line 2590 of simile-ajax- > bundle.js, This line is: - > }}}catch(C){SimileAjax.Debug.exception("XmlHttp: Error handling > onReadyStateChange",C); > > Does the timeline accept XML only in the first form? My > understanding is that the two forms are equivalent and equally valid. > > Obviously copy/paste won't work outside testing, so I'm trying to move > to the next step, having my program prepare the XML. Unfortunately > the built-in ASP.NET GetXml method returns the XML in the Elements > form. Is there something I can do within Simile to accept the XML in > this form, or will I have to find a solution with ASP.NET? > > -- > You received this message because you are subscribed to the Google Groups > "SIMILE Widgets" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/simile-widgets?hl=en. > -- You received this message because you are subscribed to the Google Groups "SIMILE Widgets" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/simile-widgets?hl=en.
