[x3d-public] starting to run more tests.

Yves Piguet yves.piguet at gmail.com
Wed Jan 18 01:22:29 PST 2017

Are comments considered to be worthwhile to preserve during conversion? Each syntax has different capabilities for the location where comments can be stored: everywhere you can have blanks including in the middle of a value (classic), everywhere but in values stored in attributes (xml), more restricted (binary and x3d json as it's currently defined). So it's impossible to have an exact match between different formats; hence I guess the normalization to a compatible subset you seek with a series of multiple conversions.

Also the author is free to use comments any way she wants, including specific to a format; for example a long line of # in classic to separate sections, or spaces for vertical alignment. Chunks of a file can be commented out, which one doesn't want to preserve in a different format. X3D clauses are grouped differently in different formats (IS element in xml vs. "inline" IS in classic), so reordering will bring comments with them, or not, which can make comments meaningless.

One important usage of comments in many languages is to document author, copyright, version etc. and X3D has its own way to do it with metadata.

I'd suggest to discard comments during conversion.


> On 18 Jan 2017, at 06:29, <yottzumm at gmail.com> <yottzumm at gmail.com> wrote:
> XML -> JSON -> DOM -> Java -> JSON (diff JSON files).
> Seeing some differences.  Comments aren’t handled in my serializer yet.  Differences in trailing digits of numbers.
> John

More information about the x3d-public mailing list