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

ext:value property power are not same for json and xml #39

Open
zeldigas opened this issue Apr 16, 2014 · 4 comments
Open

ext:value property power are not same for json and xml #39

zeldigas opened this issue Apr 16, 2014 · 4 comments
Assignees

Comments

@zeldigas
Copy link
Contributor

Here is a description of value property in spec:

The value property is OPTIONAL. The content is undetermined; its meaning and use SHOULD be explained by the document found by de-referencing the href property.

The problem is that in xml it's a node attribute, but in json it's just a object's property. As spec does not apply any constraints, saying the value is undetermined, in JSON I can use an object of any complexity I wan't, when for xml I can use only string of text.
I think that representations should be equal, and either restrict json version to string value of undefined content or allow xml version to insert any content in ext node along with (or instead) the atribute in ext node itself

@mamund
Copy link
Member

mamund commented Apr 24, 2014

well, good point. i'd like to say that the content MUST be a string
(CDATA).

does that make sense?

@zeldigas
Copy link
Contributor Author

If we do not want "invest" in extensions, then yes, it should be as lean as possible.
for this i think spec should be smth like

The value property is OPTIONAL. The content should be a string; its meaning and use SHOULD be explained by the document found by de-referencing the href property.

In the opposite i think it would be a good idea for value to be a json/xml any content and the spec text:

The value property is OPTIONAL. The content is undetermined; its meaning and use SHOULD be explained by the document found by de-referencing the href property. For complex content xml version of document should insert content inside ext tag, instead of using "value" attribute.

@mamund
Copy link
Member

mamund commented Apr 28, 2014

I'd like to go w/ the second option if we can work it out safely. Mark and
I went around on this a few times and I just "gave up" and went for option
no. 1.

if we go w/ your no. 2, I think we need a way (within the tag/property)
to clearly identify what's coming in order to allow parsers to a) recognize
it or b) ignore it.

.....

or

{"ext" : {"name" : "reserved-words", "value" : object}}

@zeldigas
Copy link
Contributor Author

Json value is ok, any valid json parser should handle it.
As for xml I think we can introduce rule:

tag content as a value always takes precedence over attribute "value". If ext tag has some content, either text or inner tags, parser MUST use it instead of attribute "value" content.

with this rule we provide enough information do handle ext data

@mamund mamund self-assigned this Sep 19, 2020
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

2 participants