The fact that we escape forward slash in the JSON output method has proved unpopular with quite a few users.
The rationale for doing it is discussed at https://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped
The short summary is that it's only needed when JSON is inserted into an HTML script element, and then only when immediately followed by >.
There's a workaround using character maps but it's really clumsy.
I don't want to escape forward slashes by default in the xdm-to-json() function because they appear so often in namespaces and it adds an awful lot of visual clutter. That means that our JSON formatter needs an option to suppress this escaping, which means we might as well provide user control over it as an output property...
Adding a new output property just for this purpose is rather heavyweight both in the specs and in our implementation, but I can't think of a better solution. So I propose adding escape-solidus, values yes/no, default (for compatibility) yes.
Yes, someone will ask about the name. Surely no-one calls it a solidus? Well, Unicode does, and I think we should use the official name. And it avoids arguing about whether it should be slash or forwards-slash or forward-slash. At least I'm not proposing virgule.
The fact that we escape forward slash in the JSON output method has proved unpopular with quite a few users.
The rationale for doing it is discussed at https://stackoverflow.com/questions/1580647/json-why-are-forward-slashes-escaped
The short summary is that it's only needed when JSON is inserted into an HTML
scriptelement, and then only when immediately followed by>.There's a workaround using character maps but it's really clumsy.
I don't want to escape forward slashes by default in the xdm-to-json() function because they appear so often in namespaces and it adds an awful lot of visual clutter. That means that our JSON formatter needs an option to suppress this escaping, which means we might as well provide user control over it as an output property...
Adding a new output property just for this purpose is rather heavyweight both in the specs and in our implementation, but I can't think of a better solution. So I propose adding
escape-solidus, values yes/no, default (for compatibility) yes.Yes, someone will ask about the name. Surely no-one calls it a solidus? Well, Unicode does, and I think we should use the official name. And it avoids arguing about whether it should be slash or forwards-slash or forward-slash. At least I'm not proposing virgule.