jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Buchmann <david.buchm...@liip.ch>
Subject jsop and property / node with same name
Date Wed, 07 Mar 2012 19:35:14 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi,

while implementing the jackalope php jsop client for the jackrabbit
backend, i stumbled over a problem with the json returned when a
property and a child node have the same name:

the repository is something like this:
<test toast="bar">
    <toast/>
</test>

to create it, i do

Session s = repository.login(credentials,workspace);
Node n = s.getRootNode().addNode("test");
n.setProperty("toast", "bar");
n.addNode("toast");
s.save();

now the json returned for /test looks like this:

{"toast":"bar",":jcr:primaryType":"Name","jcr:primaryType":"nt:unstructured","toast":{}}


note: there is twice the key "toast". as far as i understand json, this
is not valid. the php function json_decode just overwrites the property
"toast" => "bar" with the node array "toast" => array(). javascript json
parsers tend to do the same.

is jackrabbit using a custom json parser that can handle same-name keys?
are there any plans to make this valid json?

or would the jcr spec forbid it? found nothing about it. when looking at
the xml representation, it sounds totally normal. when outputting i.e.
the path of the property and the node it looks strange.

thanks for input,
david
- -- 
Liip AG // Agile Web Development // T +41 26 422 25 11
CH-1700 Fribourg // PGP 0xA581808B // www.liip.ch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk9XuHIACgkQqBnXnqWBgIss8QCgvUFwzFLURDtdRSXHrdrboCuu
AwIAoMNJSL0VwGfjxfDJy6c87k/5gbj5
=fe9h
-----END PGP SIGNATURE-----

Mime
View raw message