Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support inline array/struct syntax in M2 properties #45

Open
mpwoodward opened this issue Mar 1, 2012 · 0 comments
Open

Support inline array/struct syntax in M2 properties #45

mpwoodward opened this issue Mar 1, 2012 · 0 comments

Comments

@mpwoodward
Copy link

(Moved from http://trac.mach-ii.com/machii/ticket/666)

I'd like to be able to do this in the config file:

<property name="myArray" value=['one','two','three'] />
<property name="myStruct" value={first='one',second='two'} />

and arrays or structs of arrays, etc... I know you support this already using the tag-based syntax, just looking for something a little more concise.

Thanks!

-Jason

Changed 22 months ago by peterjfarrell

Cc matt_woodward, kurt_wiersma, mike_rogers, adrian_scott, brian_fitzgerald added
Description modified (diff)
Thanks for the ideal Jason -- definitely something I'd like to look into supporting. However without the quotes value={first='one',second='two'} -- this is not valid XML. We'd have to look into supporting it in another way. I'm just throwing this out as an idea:

<property name="myArray" complex="['one','two','three']" />

The reason why I'm not suggesting it as an value is because it would be very hard for us to distinguish from a straight string versus a complex notation (this is ambiguous):

<property name="myStruct" value="{first='one',second='two'}" />

The value attribute has always been straight strings so I think we need to keep to that. Any other ideas on how to do this while remaining valid XML?

comment:2 Changed 22 months ago by peterjfarrell

BTW, you got a very evil ticket number if you get my drift ;-)

comment:3 Changed 22 months ago by peterjfarrell

Just a thought after discussing this with Matt that we could do something like:

<property name="temp" value="${['one','two','three']}" />

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant