I am attempting to share data between xforms and the Google Map api. I have a xforms:textarea that references an instance. This all works fine if I get the data from a URL to GXml.parse(), but when I pass the data in a control, it does not parse. (javascript): var EventText = ORBEON.xforms.Document.getValue('event-text-ctrl'); var xml = GXml.parse(EventText) Looking at this with the GMap log, the content is the same, except that the URL content has broken lines in it and does not have an XML declaration. Could it be that GXml.parse() has a line length limit? Is it possible to add the Saxon indent= and indent-spaces= to xxforms:serialize? xforms snippet: <!-- Holds the serialized copy of events for javascript processing --> <xforms:instance id="event-text"> <config xmlns=""> <text/> </config> </xforms:instance> <xforms:bind nodeset="instance('event-text')" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xforms:bind nodeset="text" type="xs:string" calculate="xxforms:serialize( instance('events'), 'xml' )"/> </xforms:bind> ... <xforms:group ref="instance('event-text')"> <xforms:textarea ref="text" id="event-text-ctrl" /> </xforms:group> URL: http://nees.ucsb.edu/facilities/data/events Regards, Hank Hank Ratzesberger NEES@UCSB Institute for Crustal Studies, University of California, Santa Barbara 805-893-8042 -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
It is possible to work around the problem, in my case, by serializing it as html: calculate="xxforms:serialize( instance('events'), 'html' ) Cheers, Hank On Apr 14, 2008, at 11:25 AM, Hank Ratzesberger wrote: > > I am attempting to share data between xforms and the Google Map api. > > I have a xforms:textarea that references an instance. This all works > fine if I get the data from a URL to GXml.parse(), but when I pass the > data in a control, it does not parse. > > (javascript): > > var EventText = ORBEON.xforms.Document.getValue('event-text-ctrl'); > > var xml = GXml.parse(EventText) > > Looking at this with the GMap log, the content is the same, except > that the URL content has broken lines in it and does not have an > XML declaration. > > Could it be that GXml.parse() has a line length limit? > > Is it possible to add the Saxon indent= and indent-spaces= to > xxforms:serialize? > > xforms snippet: > > <!-- Holds the serialized copy of events for javascript > processing --> > <xforms:instance id="event-text"> > <config xmlns=""> > <text/> > </config> > </xforms:instance> > > <xforms:bind nodeset="instance('event-text')" > xmlns:xs="http://www.w3.org/2001/XMLSchema"> > <xforms:bind nodeset="text" type="xs:string" > calculate="xxforms:serialize( instance('events'), 'xml' )"/> > </xforms:bind> > > ... > > <xforms:group ref="instance('event-text')"> > <xforms:textarea ref="text" id="event-text-ctrl" /> > </xforms:group> > > URL: > > http://nees.ucsb.edu/facilities/data/events > > Regards, > Hank > > Hank Ratzesberger > NEES@UCSB > Institute for Crustal Studies, > University of California, Santa Barbara > 805-893-8042 > > > > > > > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws NEES@UCSB Institute for Crustal Studies, University of California, Santa Barbara 805-893-8042 -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Hank,
On Mon, Apr 14, 2008 at 4:32 PM, Hank Ratzesberger <[hidden email]> wrote: > It is possible to work around the problem, in my case, by > serializing it as html: > > calculate="xxforms:serialize( instance('events'), 'html' ) Could it be that the parser does not like the XML declaration? If that is the case, I think it would be better serialize in XML and then remove the declaration in the generated string. Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ Personal Blog: http://avernet.blogspot.com/ -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Hi Alex, OK, I tried this: calculate="substring-after( xxforms:serialize( instance('events'), 'xml'), '?>' )"/> Which looks good according to the xforms-inspector -- skips over the declaration. However, it does not work. So, I think the issue is that their parser has a line length limit, and this could be embedded in the browser (I have only tested Firefox so far, Google API docs say this function is dependent on browser support.) Thanks, Hank On Apr 16, 2008, at 7:45 PM, Alessandro Vernet wrote: > Hank, > > On Mon, Apr 14, 2008 at 4:32 PM, Hank Ratzesberger > <[hidden email]> wrote: >> It is possible to work around the problem, in my case, by >> serializing it as html: >> >> calculate="xxforms:serialize( instance('events'), 'html' ) > > Could it be that the parser does not like the XML declaration? If that > is the case, I think it would be better serialize in XML and then > remove the declaration in the generated string. > > Alex > -- > Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise > Orbeon's Blog: http://www.orbeon.com/blog/ > Personal Blog: http://avernet.blogspot.com/ > > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws NEES@UCSB Institute for Crustal Studies, University of California, Santa Barbara 805-893-8042 -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Hank,
On Thu, Apr 17, 2008 at 10:08 AM, Hank Ratzesberger <[hidden email]> wrote: > calculate="substring-after( xxforms:serialize( instance('events'), 'xml'), > '?>' )"/> > > Which looks good according to the xforms-inspector -- skips over the > declaration. However, it does not work. > > So, I think the issue is that their parser has a line length > limit, and this could be embedded in the browser (I have > only tested Firefox so far, Google API docs say this function > is dependent on browser support.) solution, but I am curious: what is the difference in this case between the value returned with 'xml' and 'html', besides 'xml' including an XML declaration? Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ Personal Blog: http://avernet.blogspot.com/ Twitter - http://twitter.com/avernet -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Alex,
No prob.em... In html mode, the output wraps to about 40 columns (in the inspector), there are spaces between elements, e.g.: <config xmlns:widget="http://www.orbeon.com/oxf/xml/ widget"><text><exist:result xmlns:exist="http://exist.sourceforge.net/ NS/exist" exist:hits="5419" exist:start="1" exist:count="10"> <origin> <nass>-1</nass> <evid>14003864</evid> <etype></etype> <depdp>-999</depdp> <time>2003-11-15T03:38:19.780Z</time> .... In xml mode, there are no spaces between elements, and the elements are all "one one line" . e.g.: <config xmlns:widget="http://www.orbeon.com/oxf/xml/widget"><text><? xml version="1.0" encoding="UTF-8"?><exist:result xmlns:exist="http:// exist.sourceforge.net/NS/exist" exist:hits="5419" exist:start="1" exist:count="10"><origin><nass>-1</nass><evid>14003864</evid><etype/ ><depdp>-999</depdp><time>2003-11-15T03:38:19.780Z</time><review>-</ review><msid>-1</msid><lat>33.467</lat><auth>cit_14003864</ auth><dtype>-</dtype><ms>- ...... not sure what that will look like, email client is breaking it up on '-' characters. Thanks, Hank On Apr 18, 2008, at 3:49 PM, Alessandro Vernet wrote: > Hank, > > On Thu, Apr 17, 2008 at 10:08 AM, Hank Ratzesberger > <[hidden email]> wrote: >> calculate="substring-after( xxforms:serialize( instance >> ('events'), 'xml'), >> '?>' )"/> >> >> Which looks good according to the xforms-inspector -- skips over the >> declaration. However, it does not work. >> >> So, I think the issue is that their parser has a line length >> limit, and this could be embedded in the browser (I have >> only tested Firefox so far, Google API docs say this function >> is dependent on browser support.) > > Could be. I don't want to annoy you with this since you have a working > solution, but I am curious: what is the difference in this case > between the value returned with 'xml' and 'html', besides 'xml' > including an XML declaration? > > Alex > -- > Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise > Orbeon's Blog: http://www.orbeon.com/blog/ > Personal Blog: http://avernet.blogspot.com/ > Twitter - http://twitter.com/avernet > > -- > You receive this message as a subscriber of the [hidden email] > mailing list. > To unsubscribe: mailto:[hidden email] > For general help: mailto:[hidden email]?subject=help > OW2 mailing lists service home page: http://www.ow2.org/wws NEES@UCSB Institute for Crustal Studies, University of California, Santa Barbara 805-893-8042 -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Administrator
|
Hank,
On Fri, Apr 18, 2008 at 4:14 PM, Hank Ratzesberger <[hidden email]> wrote: > In xml mode, there are no spaces between elements, and the elements are all > "one one line" . e.g.: > [...] I see. And I wouldn't think that this should make a difference. Like you said, this looks like a "special requirement" (or bug?) in the Google Maps API. Alex -- Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise Orbeon's Blog: http://www.orbeon.com/blog/ Personal Blog: http://avernet.blogspot.com/ Twitter - http://twitter.com/avernet -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help OW2 mailing lists service home page: http://www.ow2.org/wws |
Free forum by Nabble | Edit this page |