[x3d-public] question on MFStrings; intermediatewhitespacebetween SFString values in MFString list?

John Carlson yottzumm at gmail.com
Sat May 20 19:58:28 PDT 2017


The thing about JavaScript is you can basically pass a DOM element (with commas between SFStrings in an MFString).  So it depends on usage, and I should probably handle the comma case if it is legal DOM!
And that means changing my serializers to accept a wider range of inputs than those from my JSON loader, or switch to serializing from JSON instead of DOM—toss the DOM element in the trash—or leave for DOM serializer.  Changes are made, ready to test.

John

Sent from Mail for Windows 10

From: Don Brutzman
Sent: Saturday, May 20, 2017 10:39 PM
To: John Carlson
Cc: Joe D Williams; X3D Graphics public mailing list
Subject: Re: [x3d-public] question on MFStrings; intermediatewhitespacebetween SFString values in MFString list?

On 5/20/2017 6:36 PM, John Carlson wrote:
> Luckily, I do JSON parsing before XML parsing, so I don’t think I am affected by the "," in XML.

X3dToJson.xslt doesn't perpetuate those.  I don't think that JSON has any flexibility in that regard.

> Thanks for the info.  If someone starts using my DOM code before using JSON, I could be in trouble a little bit though.  Probably best to go back and do modifications at some point.  This is for X3DJSONLD.  (It’s in the *Serializers folks!).  I should have been using JSON all along, instead of DOM!
> 
> John

correct, we should not allow whitespace commas in DOM representations.  that will be interesting in X3D encoding for DOM, we'll likely need loaders to deliberately normalize whitespace (including comma characters).

> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
> 
> *From: *Don Brutzman <mailto:brutzman at nps.edu>
> *Sent: *Saturday, May 20, 2017 7:48 PM
> *To: *Joe D Williams <mailto:joedwil at earthlink.net>; John Carlson <mailto:yottzumm at gmail.com>
> *Cc: *X3D Graphics public mailing list <mailto:x3d-public at web3d.org>
> *Subject: *Re: [x3d-public] question on MFStrings; intermediate whitespacebetween SFString values in MFString list?
> 
> On 5/20/2017 3:39 PM, Roy Walmsley wrote:
> 
>  > Hi,
> 
>  >
> 
>  > Actually, there is some more general overriding text in the standard which
> 
>  > does clarify this point.
> 
>  >
> 
>  > Look at 5.1.2 Description (see
> 
>  > http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/EncodingOfFields.html#5.1.2). This is what the  third paragraph says:
> 
>  >
> 
>  > "Multiple-valued fields are written as an ordered list of values enclosed in
> 
>  > quotations and separated by whitespace. If the field has zero values, only
> 
>  > the quotes are written. The last value may optionally be followed by
> 
>  > whitespace."
> 
>  >
> 
>  > So, clearly, between two values in any MFxxxx field, whitespace is required.
> 
>  > Therefore, no need to specify in individual field details, which none of
> 
>  > them do.
> 
>  >
> 
>  > In my view, therefore, the standard is quite clear.
> 
>  >
> 
>  > <Text string='"Line 1""Line 2" '/> is illegal, since there is no whitespace.
> 
>  > <Text string='"Line 1" "Line 2" '/> is legal, since there is a " ", which is
> 
>  > a whitespace character, as defined in 4.3.1 XML encoding.
> 
>  > <Text string='"Line 1","Line 2" '/> is legal, since there is a ",", which is
> 
>  > a whitespace character, as defined in 4.3.1 XML encoding.
> 
>  > <Text string='"Line 1"."Line 2" '/> is illegal, since "." is not a
> 
>  > whitespace character, as defined in 4.3.1 XML encoding.
> 
>  >
> 
>  > All the best,
> 
>  >
> 
>  > Roy
> 
> Thanks Roy.  Parsing was getting pretty gnarly without that helpful whitespace separator.
> 
> So John, won't be exploring that path further in X3dToJson.xslt stylesheet.
> 
> 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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170520/dd593c2e/attachment.html>


More information about the x3d-public mailing list