<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Apr 25, 2017 8:37 PM, "Michalis Kamburelis" <<a href="mailto:michalis.kambi@gmail.com">michalis.kambi@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="quoted-text">2017-04-26 1:47 GMT+02:00 Andreas Plesch <<a href="mailto:andreasplesch@gmail.com">andreasplesch@gmail.com</a>>:<br>
>> To make it CORRECT, write<br>
>><br>
>> <Text string=' "blablah" ' /><br>
>><br>
>> or<br>
>><br>
>> <Text string='&quot;blablah&quot;' /><br>
>><br>
><br>
> Using single quotes as outer quotes is legal,<br>
><br>
>><br>
>> or<br>
>><br>
>> <Text string="&quot;blablah&quot;" /><br>
>><br>
><br>
> but using double quotes is not in X3D:<br>
> <a href="http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/EncodingOfFields.html#SFString" rel="noreferrer" target="_blank">http://www.web3d.org/<wbr>documents/specifications/<wbr>19776-1/V3.3/Part01/<wbr>EncodingOfFields.html#SFString</a><br>
><br>
> although it is legal in XML.<br>
><br>
> However, most browser probably allow double quotes as outer quotes since<br>
> they will just use a standard XML parser.<br>
> I am not pretending to understand the motivation for this X3D rule.<br>
><br>
<br>
</div>I don't think the X3D disallows using double quotes to surround XML<br>
attributes in X3D XML encoding. Indeed, the specification (<br>
<a href="http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/EncodingOfFields.html#SFString" rel="noreferrer" target="_blank">http://www.web3d.org/<wbr>documents/specifications/<wbr>19776-1/V3.3/Part01/<wbr>EncodingOfFields.html#SFString</a><br>
) does not show this as a valid example (it only shows using single<br>
quotes to surround the XML attribute). But it also doesn't say it's<br>
invalid.<br></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">(Unfortunately) it does say explicitly:</div><div dir="auto"><br></div><div dir="auto"><span style="font-family:sans-serif">The MFString specifies zero or more SFStrings enclosed in single quotes </span><span style="font-family:sans-serif">(</span><span style="font-family:sans-serif">e.g.</span><span style="font-family:sans-serif">, '"string1" "string2"').</span><br></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">There may be a little wiggle room since double quotes are not declared invalid, but in general the spec. does not deal with negatives. Otherwise, one could argue using $$ may be valid as well. Also, the words "single quotes" clearly refer to apostrophes rather than single counts of quote characters.</span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">If double quotes are used for outer quotes, it may become impossible to identify</span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">" ' MFString or SFString ? ' "</span></div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><font face="sans-serif">as MFString or SFString. But I do not think this would be a problem since it would be parsed according to what the field expects. Is there a situation where it is necessary to uniquely identify a field value type based on the value alone ?</font></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
I admit, I may be biased when reading this part of the specification,<br>
because I think (like you) that it would be weird if the X3D<br>
specification was limiting what is valid XML syntax. Probably everyone<br>
uses some standard library to read XML files, and we don't know:<br>
<br>
- What character in XML was used to surround XML attribute: single or<br>
double quote.<br>
- What characters in XML were used to express a visible double quote:<br>
" or &quot;.<br>
<br>
And we don't want to know it, after all it's the purpose of a standard<br>
XML parser to hide these details from the programmers working on a<br>
higher level.<br>
<br>
Indeed, it would be great if the X3D XML specification clarified this,<br>
both by more prose and by showing more examples what is correct and<br>
what is incorrect (like the examples in my previous mail). Reading the<br>
thread from <a href="http://web3d.org/pipermail/x3d-public_web3d.org/2017-March/006145.html" rel="noreferrer" target="_blank">http://web3d.org/pipermail/<wbr>x3d-public_web3d.org/2017-<wbr>March/006145.html</a><br>
, it seems that everyone agrees about what the specification *should*<br>
mean (regardless of what it currently means), and this expectation<br>
matches (all?) current implementations. So it would be great to<br>
improve/fix the specification:)<br><br></blockquote></div><br></div><div class="gmail_extra" dir="auto">Completely agreed.</div><div class="gmail_extra" dir="auto"><br></div><div class="gmail_extra" dir="auto">As an aside, I recently came across <a href="http://glitch.com">glitch.com</a> which has an online html editor with non-optional syntax checker. It insists on double quotes for attribute values which was irritating in the same way.</div><div class="gmail_extra" dir="auto"><br></div><div class="gmail_extra" dir="auto">Andreas</div><div class="gmail_extra" dir="auto"><br></div></div></div>