Skip to content

Comment on Jolt – JSON to JSON transformationparent

Comments

Increase the terror further by adding Jsonx to the mix: http://www.ibm.com/support/knowledgecenter/SS9H2Y_7.5.0/com....

Isn't one of their examples invalid XML?

http://www.ibm.com/support/knowledgecenter/SS9H2Y_7.5.0/com....

Shouldn't

    <json:string name="ficoScore"> > 640</json:string>
be
    <json:string name="ficoScore"> &gt; 640</json:string>

It's one of the many peculiarities of XML: the "less-than" bracket is not allowed in text (because it could indicate the opening of a new XML tag), but the "greater-than" bracket does not need encoding when it's in text, because it's not ambiguous.

I'm pretty sure most XML handling libraries would use &gt; - never seen a raw > used in XML (though possible I might not have noticed).

Edit: Forgot to say thanks for pointing that out!

Just check what the W3C says about writing a raw >:

For characters such as > where XML defines a built-in entity but does not require its use in all circumstances, it is implementation-dependent whether the character is escaped.

(https://www.w3.org/TR/xslt-xquery-serialization-31/#serphase...)

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.