<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">The text between the XML and Classic
      VRML encoding differ with respect to commas.<br>
      <br>
      XML
(<a class="moz-txt-link-freetext" href="http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/EncodingOfFields.html#5.1.2">http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/EncodingOfFields.html#5.1.2</a>
      -- BTW, Search term doesn't work). Paragraph after Example 1:<br>
      <br>
      <blockquote><i>"Within MF arrays, commas may only be used as
          whitespace between values of individual base datatypes.
          Further, an integral number of tuple values must be provided
          for 2-tuple, 3-tuple and 4-tuple datatypes."</i><br>
      </blockquote>
      <br>
      However, in the XML document section 4.3.1
(<a class="moz-txt-link-freetext" href="http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/concepts.html#XMLEncoding">http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/concepts.html#XMLEncoding</a>)
      there is the following statement:<br>
      <br>
      <i>"Spaces, tabs, linefeeds, and carriage-returns are separator
        characters wherever they appear outside of XML attribute values.
        Commas are not ignorable whitespace when mixed between or among
        XML element and attribute values."</i><br>
      <br>
      I must presume that the restriction on white space characters in
      5.1.2 is more specific and overrides the general statement in
      4.3.1<br>
      <br>
      <br>
      <br>
      Classic VRML
(<a class="moz-txt-link-freetext" href="http://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/EncodingOfFields.html#Description">http://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/EncodingOfFields.html#Description</a>).
      Paragraph prior to Example 1:<br>
      <br>
      <blockquote><i>"Multiple-valued fields are written as an ordered
          list of values enclosed in square brackets and separated by
          whitespace. If the field has zero values, only the square
          brackets ("[ ]") are written. The last value may optionally be
          followed by whitespace. If the field has exactly one value,
          the brackets may be omitted."</i><br>
      </blockquote>
      <br>
      This spec defines whitespace in the same manner
(<a class="moz-txt-link-freetext" href="http://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/concepts.html">http://www.web3d.org/documents/specifications/19776-2/V3.3/Part02/concepts.html</a>)
      without additional restrictions in values that the XML encoding
      has.<br>
      <br>
      <blockquote><i>"Commas, spaces, tabs, linefeeds, and
          carriage-returns are separator characters wherever they appear
          outside of string fields. Separator characters and comments
          are collectively termed </i><i>whitespace</i><i>."</i><br>
      </blockquote>
      <br>
      <br>
      Leonard Daly<br>
      <br>
      <br>
      <br>
    </div>
    <blockquote type="cite"
cite="mid:CAKdk67sLv+X=S_vLABWQv9bKAywqEizK-QWoP1Ck1yg1Etz93Q@mail.gmail.com">
      <pre wrap="">Ok. Only outside of XML attributes, and therefore outside of X3D's
domain, comma's are white space.

<a class="moz-txt-link-freetext" href="http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/EncodingOfFields.html#5.1.2">http://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/EncodingOfFields.html#5.1.2</a>

clearly states that comma's can only separate between values of
MFFields, not within SFFields.

Thanks,
-Andreas

On Wed, Aug 1, 2018 at 7:51 PM Joseph D Williams <a class="moz-txt-link-rfc2396E" href="mailto:joedwil@earthlink.net"><joedwil@earthlink.net></a> wrote:
</pre>
      <blockquote type="cite">
        <pre wrap="">
I think there was  a comma discussion which concluded that comma is
white space from a spec. perspective.



Between SF Fields, not within SF Fields.

Thanks and Best,

Joe



From: Andreas Plesch
Sent: Monday, July 30, 2018 2:59 PM
To: Don Brutzman
Cc: X3D Graphics public mailing list
Subject: Re: [x3d-public] X3D regular expression (regex) improvements



I think there was  a comma discussion which concluded that comma is

white space from a spec. perspective. But I agree that comma's are

best used to separate vectors from each other.



I added a few decimal point tests for SFFloat here:



<a class="moz-txt-link-freetext" href="https://regex101.com/r/RMeNmE/3/tests">https://regex101.com/r/RMeNmE/3/tests</a>



Should .3 (meaning 0.3) be allowed ? It is in most contexts.



Cheers,



-Andreas



On Mon, Jul 30, 2018 at 2:56 AM Don Brutzman <a class="moz-txt-link-rfc2396E" href="mailto:brutzman@nps.edu"><brutzman@nps.edu></a> wrote:

</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">Am happy to report that improved regex updates are available for SF/MFBool, SF/MFInt32, SF/MFFloat, SF/MFDouble, SF/MFTime.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap=""><a class="moz-txt-link-freetext" href="http://www.web3d.org/specifications/X3dRegularExpressions.html#X3dPatterns">http://www.web3d.org/specifications/X3dRegularExpressions.html#X3dPatterns</a>
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">==========================================================================
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">  X3D Regular Expressions (regexes): X3D Pattern
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">In order to enable inclusion of commas as whitespace characters, native XML Schema datatypes typically cannot be used directly. In order to ensure strict validation, regex patterns must be used. Of further note is that regex patterns only apply to base type xs:string.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">General regex design considerations for X3D XML Schema include the following.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">     For numeric types, leading sign characters (+ or -) are optionally present.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">     For numeric types, leading zeroes are not allowed, except for an optional leading zero preceding the decimal point when the significand is only fractional.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">     Regex \s accepts a number of characters as whitespace, so ( \t\n\r)* is used to strictly honor whitespace characters defined in ClassicVRML grammar.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">     Intermediate commas are treated as whitespace, but only allowed between each singleton value. For example, SFVec3f 3-tuple values within an MFVec3f array do not contain comma characters (but may be separated by commas and whitespace). Experience has shown that misplaced commas are a crucial indicator of malformed tuple values in large float arrays.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">     Careful design allows use of regexes that can also be adapted to XML, ClassicVRML, JavaScript/JSON, Java and other language environments.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">     A required mantissa (integer or floating point) is represented as 0|[1-9][0-9]* (meaning either a single 0 or else no leading zeroes).
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">     The fractional part (to the right of the decimal point) can be represented as [0-9]*
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">     Scientific notation starts with upper or lower-case E, is optionally positive or negative: ((E|e)(\+|\-)?[0-9]+)? and can be added to integer or float values.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">     TODO. Originally these regexes assumed that leading/trailing whitespace has been removed. Now prepending/appending regex constructs such as (\s)* to consume outer whitespace.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">     TODO. allow multiple inner whitespace characters, optionally including comma between individual MF array values.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">     Regex anchors ^ (line start) and $ (line end) are implicit and not included in XML Schema and X3DUOM regexes. Note that strict consumption of all value characters gets performed by these regexes. The anchor characters are necessary for regex101 engine unit tests, otherwise illegal values (for MF types) are not rejected (for MF types).
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">============================================================
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">These regex improvements are published as part of X3Dv4 XML Schema for evaluation.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">Regex testing for SF/MFBool, SF/MFInt32, SF/MFFloat, SF/MFDouble, SF/MFTime passes using XMLSpy, regex101, X3DJSAIL/X3DUOM, XML Schema validation.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">See links (especially regex101 unit tests!) via
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">        <a class="moz-txt-link-freetext" href="http://www.web3d.org/specifications/X3dRegularExpressions.html#SFBool">http://www.web3d.org/specifications/X3dRegularExpressions.html#SFBool</a>
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">        <a class="moz-txt-link-freetext" href="http://www.web3d.org/specifications/X3dRegularExpressions.html#SFInt32">http://www.web3d.org/specifications/X3dRegularExpressions.html#SFInt32</a>
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">        <a class="moz-txt-link-freetext" href="http://www.web3d.org/specifications/X3dRegularExpressions.html#SFFloat">http://www.web3d.org/specifications/X3dRegularExpressions.html#SFFloat</a>
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">Even more detailed unit tests are now bundled as part of X3DJSAIL testing in
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap=""><a class="moz-txt-link-freetext" href="https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/src/org/web3d/x3d/tests/FieldObjectTests.java">https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/java/src/org/web3d/x3d/tests/FieldObjectTests.java</a>
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">Thanks for all of the dialog to date, it really helped in this tricky business (especially for anchors).  Will work on a few Color and SFVec/MFVec types next.
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">Feedback always welcome.  Have fun validating correct content with X3D Regex!
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">all the best, Don
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">--
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">Don Brutzman  Naval Postgraduate School, Code USW/Br       <a class="moz-txt-link-abbreviated" href="mailto:brutzman@nps.edu">brutzman@nps.edu</a>
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
</pre>
        </blockquote>
        <pre wrap="">
</pre>
        <blockquote type="cite">
          <pre wrap="">X3D graphics, virtual worlds, navy robotics <a class="moz-txt-link-freetext" href="http://faculty.nps.edu/brutzman">http://faculty.nps.edu/brutzman</a>
</pre>
        </blockquote>
        <pre wrap="">






--

Andreas Plesch

Waltham, MA 02453



_______________________________________________

x3d-public mailing list

<a class="moz-txt-link-abbreviated" href="mailto:x3d-public@web3d.org">x3d-public@web3d.org</a>

<a class="moz-txt-link-freetext" href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a>


</pre>
      </blockquote>
      <pre wrap="">


</pre>
    </blockquote>
    <p><br>
    </p>
    <div class="moz-signature">-- <br>
      <font class="tahoma,arial,helvetica san serif" color="#333366">
        <font size="+1"><b>Leonard Daly</b></font><br>
        3D Systems & Cloud Consultant<br>
        LA ACM SIGGRAPH Past Chair<br>
        President, Daly Realism - <i>Creating the Future</i>
      </font></div>
  </body>
</html>