[x3d-public] [X3D 0000705]: 5.15 SFString and MFString - Escaping backslashes

Brutzman, Donald (Don) (CIV) brutzman at nps.edu
Wed Nov 14 16:11:52 PST 2018


Very good.  If you think it preempts other priorities then we can work on it during this Friday's call.

On 11/14/2018 11:55 AM, Michalis Kamburelis wrote:
> Don,
> 
> We have indeed talked about this issue on teleconferences and mailing
> lists, a couple of times already :) I believe we have reached a
> consensus on how the specification should be fixed, and I collected it
> on my wiki page:
> 
>    https://github.com/michaliskambi/x3d-tests/wiki/Clarify-the-usage-of-quotes-and-backslashes-for-MFString-and-SFString-in-XML-encoding
> 
> When I catch a little breath from my work, I wanted to propose that we
> would talk it over (again :) ), and if everyone agreed, I could just
> submit a pull request to Web3D specification that adds the prose, as
> collected on my wiki page. The prose in my wiki reflects what the X3D
> browsers actually *do* right now.
> 
> P.S. Remember that SFString and MFString in XML encoding *should not*
> be consistent in their treatment of backslashes. We talked about this,
> and already agreed, in the past :) My wiki page contains the detailed
> discussion and tests.
> 
> Regards,
> Michalis
> 
> śr., 14 lis 2018 o 16:58 Brutzman, Donald (Don) (CIV)
> <brutzman at nps.edu> napisał(a):
>>
>> Hi Michalis.  Hope it is OK to put more attention on this Mantis issue, have copied x3d-public list.
>>
>> There appears to be different understandings of this issue.
>>
>> A lot of email has been sent over the years, much clarity has been achieved, many many working examples are available, yet thoroughness can indeed be difficult.  You may recall that John Carlson and I similarly chased this around when implementing validation of JSON encoding.
>>
>> It has never been forgotten or ignored.  We work at best speed possible on many many tasks + priorities.
>>
>> Some points to remember are that
>>
>> (a) XML rules control a lot of this, which we must honor,
>> (b) Mappings to other file encodings and language bindings must work interoperably,
>> (c) Round tripping is a great way to test, and
>> (d)Different approaches between SFString and MFString (itself a list of SFString values) can lead to even greater confusion and difficulty.
>>
>> I further think that this is exacerbated when a perfectly normal-looking MFString value lacks outer quotes - we should allow consistency with SFString for singleton values.  Example MFString:
>>
>>          <Text string='Hello singleton MFString value'/>
>> and
>>          <Text string='"Hello singleton MFString value"'/>
>> and
>>          <Text string=""Hello singleton MFString value""/>
>> etc.
>>
>> Am not saying everything is perfect (but we are at least very close based on example suite).  Just saying that handling all special cases is complex and changes deserve strict attention + repeatable examples.
>>
>> I suggest we keep our 2018 end-of-year focus and schedule a weekly meeting on this topic during February or March, following the next big meeting of Korea Chapter in mid January 2019.
>>
>> Looking forward to sustained Web progress together.  8)
>>
>>
>> On 11/14/2018 4:47 AM, Mantis Bug Tracker wrote:
>>>
>>> A NOTE has been added to this issue.
>>> ======================================================================
>>> http://www.web3d.org/member-only/mantis/view.php?id=705
>>> ======================================================================
>>> Reported By:                walroy
>>> Assigned To:                brutzman
>>> ======================================================================
>>> Project:                    X3D
>>> Issue ID:                   705
>>> Category:                   19776-1 (XML)
>>> Reproducibility:            N/A
>>> Severity:                   minor
>>> Priority:                   normal
>>> Status:                     acknowledged
>>> ======================================================================
>>> Date Submitted:             2015-06-30 07:22 PDT
>>> Last Modified:              2018-11-14 04:47 PST
>>> ======================================================================
>>> Summary:                    5.15 SFString and MFString - Escaping backslashes
>>> Description:
>>> 5.15 SFString and MFString
>>> http://www.web3d.org/files/specifications/19776-1/V3.3/Part01/EncodingOfFields.html#SFString
>>>
>>> The X3D XML encoding specification doesn't make it clear that in XML encoding
>>> inside MFString (but *not* inside SFString) escaping backslashes is
>>> mandatory. Just like in classic encoding (where it's for both MFString and
>>> SFString).
>>>
>>> Section "5.15 SFString and MFString" of XML encoding specification doesn't
>>> say anything about backslashes. It only shows an example:
>>>
>>>        EXAMPLE 2  Two instances of the double quote are contained in the
>>> following SFString field string:
>>>        <Text string='"He said, \"Immel did it!\""' />
>>>
>>> but
>>>
>>> 1. The example description is wrong, it should apply to MFString *only*, not
>>> to SFString. In XML encoding, backslashes should *not* be escaped for
>>> SFString, but they *have to* be escaped for MFString.
>>>
>>> 2. The specification prose doesn't say anything about backslashes. Contrary
>>> to a nice X3D classic encoding specification, that clearly describes the
>>> backslashes situation.
>>>
>>> This was discussed on x3d-public in 2011, see
>>> http://www.web3d.org/pipermail/x3d-public_web3d.org/2011-July/001697.html ,
>>> confirmed with other browsers, and submitted as spec comment. Without any
>>> response or action on the part of Web3d consortium. Sorry for being harsh,
>>> but people *are* affected by the unclear specification (see e.g.
>>> https://sourceforge.net/p/castle-engine/tickets/14/ ). It's sad to see that
>>> an issue that was reported 2 years ago is still not fixed in the spec.
>>>
>>> I propose to fix this, by adding to spec text clarifying backslashes
>>> situation, and also fixing "Example 2" description. Like this:
>>>
>>> *********
>>> Double quotes (") inside strings in MFString fields should be preceded by a
>>> backslash. Moreover, normal backslashes should be doubled. This is necessary
>>> to distinguish between double quotes delimiting items of the MFString, and
>>> double quotes inside string content.
>>>
>>> EXAMPLE 2  Two instances of the double quote are contained in the following
>>> MFString field string:
>>> <Text string='"He said, \"Immel did it!\""' />
>>>
>>> The above rule does not apply to SFString, or other attributes (for example
>>> META content). That is, inside SFString and such content, backslashes don't
>>> have any special meaning.
>>> *********
>>>
>>>
>>>
>>> Additional Information:
>>> Submitted on Wednesday, June 5, 2013 - 15:54
>>> by  (Michalis Kamburelis <michalis.kambi at gmail.com>)
>>> IP: 83.5.246.47
>>>
>>> See: http://www.web3d.org/realtime-3d/node/174/submission/153
>>>
>>>
>>> ======================================================================
>>> Relationships       ID      Summary
>>> ----------------------------------------------------------------------
>>> related to          0000488 5.15 SFString and MFString - Handling o...
>>> related to          0001091 5.15 SFString and MFString - Confusion ...
>>> ======================================================================
>>>
>>> ----------------------------------------------------------------------
>>>    (0002380) vmarchetti (developer) - 2018-11-14 04:47
>>>    http://www.web3d.org/member-only/mantis/view.php?id=705#c2380
>>> ----------------------------------------------------------------------
>>> Results on additional tests are described in
>>> https://github.com/michaliskambi/x3d-tests/wiki/Clarify-the-usage-of-quotes-and-backslashes-for-MFString-and-SFString-in-XML-encoding
>>>
>>>
>>> Issue History
>>> Date Modified    Username       Field                    Change
>>> ======================================================================
>>> 2015-06-30 07:22 walroy         New Issue
>>> 2016-12-08 02:51 walroy         Relationship added       related to 0001091
>>> 2016-12-30 13:12 brutzman       Assigned To               => brutzman
>>> 2016-12-30 13:12 brutzman       Status                   new => acknowledged
>>> 2017-04-26 07:28 brutzman       Relationship added       related to 0000488
>>> 2018-11-14 04:47 vmarchetti     Note Added: 0002380
>>> ======================================================================
>>>
>>
>>
>> all the best, Don
>> --
>> Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
>> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
>> X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman


all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman


More information about the x3d-public mailing list