[x3d-public] Agenda for X3D WG Open Meeting Wednesday 10th May 2017
Michalis Kamburelis
michalis.kambi at gmail.com
Wed May 10 08:26:42 PDT 2017
Suggested corrections with examples.
2017-05-10 17:17 GMT+02:00 Don Brutzman <brutzman at nps.edu>:
> Another reference: Mantis issue 0705. pdf attached, link follows.
>
> 0705: 5.15 SFString and MFString - Escaping backslashes
> http://www.web3d.org/member-only/mantis/view.php?id=705
>
> 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
>
> _______________________________________________
> x3d-public mailing list
> x3d-public at web3d.org
> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>
-------------- next part --------------
The proposed change to the specification (all to the section
http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/EncodingOfFields.html#SFString
) would be to change this part:
"""""""
The MFString specifies zero or more SFStrings enclosed in single
quotes (e.g., '"string1" "string2"').
NOTE The construct
"string3"
is not a valid instance of an MFString. Such an MFString would be
properly specified as
'"string3"'
"""""""
into this:
"""""""
The MFString specifies zero or more SFStrings, with each single
string enclosed in double quotes (e.g., "string1" "string2"). Note
that inside an XML attribute, you have to express a double quote using
the " character entity, unless you enclose a whole XML attribute
in single quotes.
NOTE The construct
"string3"
is not a valid instance of an MFString. Such an MFString would be
properly specified as
'"string3"'
or
'"string3"'
or
""string3""
"""""""
------------------------------------------------------------------------------
For additional clarity, I would also add more prose and examples to
explain when backslashes are needed. So I would change
"""""""
EXAMPLE 2 Two instances of the double quote are contained in the
following SFString field string:
<Text string='"He said, \"Immel did it!\""' />
"""""""
with this:
"""""""
If a string is part of an MFString, and you want this string to
contain a double-quote (for example, to actually show a double-quote
using the Text node field "string") then you have to place a backslash
before this double-quote. This rule applies regardless if you express
double-quote as " or as " . This is necessary, to avoid treating
the double-quote as a delimiter of strings on a MFString list.
Consequently, if you want a string inside MFString to contain a
backslash (for example, to actually show a backslash using the Text
node field "string") then you have to write two backslashes. This is
necessary, to avoid accidentally changing the meaning of a following
double-quote character.
EXAMPLE 2 All the following forms are correct and equivalent:
<Text string='"He said, \"Immel did it!\""' />
<Text string='"He said, \"Immel did it!\""' />
<Text string='"He said, \"Immel did it!\""' />
<Text string=""He said, \"Immel did it!\""" />
"""""""
------------------------------------------------------------------------------
""""
SFString specifies a single string encoded as a sequence of UTF-8
octets enclosed in double quotes (e.g., "string").
""""
could be changed to
""""
SFString specifies a single string encoded as a sequence of UTF-8
octets. It is simply the value of an XML attribute. As such, following
XML rules, it can be surrounded either in single-quotes (apostrophes)
or double quotes.
The following examples of an SFString are all valid:
"string"
'string'
"string "with some quotes inside""
'string "with some quotes inside"'
'string "with some quotes inside"'
""""
More information about the x3d-public
mailing list