I'm with Chris in point 1<myApp:ColorTag color="green"><myApp:Color>red</myApp:Color><myApp:Color>blue</myApp:Color></myApp:ColorTag>This should evaluate to green.
<myApp:ColorTag><myApp:Color>red</myApp:Color><myApp:Color>blue</myApp:Color></myApp:ColorTag>This should evaluate to blue.This is the problem that I see if we try to convert to an array if there is more than one element
<myApp:ColorTag><myApp:Color>red</myApp:Color></myApp:ColorTag>we will end with My.Color and this will return red
then<myApp:ColorTag Color="green"><myApp:Color>red</myApp:Color><myApp:Color>blue</myApp:Color></myApp:ColorTag>we will have My.Color = ["green","red", "blue"]
I would contend that we're using XML notation to assign values in a
programming language (the EL). We're not using DOM traversal or
XPath.
In order to support your proposed interpretation of parameters as
> I'd like to hear an argument against having multiple child tags define
> multiple child values (rather than redefining the same one) before we
> proceed. This is already in the spec, and we should have a good reason for
> changing it.
additive, we would need to create a DOM-like API to support walking
the nodes. There is not that ability current in the EL.
Additionally, we would have to treat all parameters as an array of one
element. It becomes the equivalent of what one would get when
invoking:
document.getElementsByTagName("body");
There is only one <body>, but you would still get an array.
It
greatly complicates how the EL would interpret things to use your
proposed DOM-node like behavior. Given a parameter "Title", accessing
simple parameter values would become
${My.Title[0]} instead of the currently specified ${My.Title}.
As far as your statement that "this is already in the spec", that is
not actually the case. The whole point of this proposal is to clarify
the behavior of parameters because it is not clearly defined in the
spec. Shindig may have implemented it that way, but MySpace did not.
We're using a simple hash table and overwriting parameters when
duplicates are found.
On Mon, Oct 12, 2009 at 11:04 AM, goosemanjack <cc...@myspace.com> wrote:In order to support your proposed interpretation of parameters as
> I'd like to hear an argument against having multiple child tags define
> multiple child values (rather than redefining the same one) before we
> proceed. This is already in the spec, and we should have a good reason for
> changing it.
additive, we would need to create a DOM-like API to support walking
the nodes. There is not that ability current in the EL.
Additionally, we would have to treat all parameters as an array of one
element. It becomes the equivalent of what one would get when
invoking:
document.getElementsByTagName("body");
There is only one <body>, but you would still get an array.Agreed that internally you would represent these as an array.
It
greatly complicates how the EL would interpret things to use your
proposed DOM-node like behavior. Given a parameter "Title", accessing
simple parameter values would become
${My.Title[0]} instead of the currently specified ${My.Title}.You can still use ${My.Title} - the value of evaluating a list is the merged text content of all of the elements in the array.
Once again I have been proven wrong. The only reference I had found
previously was in os:Render
http://www.opensocial.org/Technical-Resources/opensocial-spec-v09/OpenSocial-Templating.html#rfc.section.12
"4.Replace the os:Render tag with child nodes of all the tags found in
step (3)."
To me the logical interpretation was to concatenate the strings, not
cycle an array. Even though the spec in the location your have
pointed out seems to indicate that the original behavior is to treat
the multiple parameters as DOM element list, we believe this is a spec
bug. It conflicts with the general expressions definition that
states: "Expressions are usually evaluated as strings."
This overloading of the EL definition with strings, objects, and DOM-
like elements adds too much complexity with no clear benefit,
especially in light of the fact that there are multiple other methods
of generating list and array-like structures.
--
For more options, visit this group at http://groups.google.com/group/opensocial-and-gadgets-spec?hl=en.
You received this message because you are subscribed to the Google Groups "OpenSocial and Gadgets Specification Discussion" group.
To post to this group, send email to opensocial-an...@googlegroups.com.
To unsubscribe from this group, send email to opensocial-and-gadg...@googlegroups.com.
> ...
>
> read more »