[x3d-public] TextSpecialCharactersIndex.html bug

Andreas Plesch andreasplesch at gmail.com
Mon May 8 09:41:34 PDT 2017


On Mon, May 8, 2017 at 11:10 AM, Don Brutzman <brutzman at nps.edu> wrote:

> Appreciate the continuing follow-through Andreas.
>
> Beyond the fallibility of visual inspection and occasional ambiguity of
> email, found an additional approach to help us test.
>
> Copying and pasting the rendered pretty-print source from a browser into a
> source file, then validating and browsing that scene, quickly brings subtle
> errors into the "light of day."
>

Exactly. Copying and pasting from the (pretty print) example web pages is
probably fairly common. Actually, you should be able to copy and paste into
this:

http://andreasplesch.github.io/Library/Viewer/x3dweb.html


>
> Then debugging the diverse escapability of .x3d/xml -> xslt/xpath ->
> html/css workflow can be readjusted even more objectively, hopefully
> "dialing in" the right answers.
>
> Test-case examples, screen shots and round tripping all assist in reaching
> clarity.  Will pursue this worthwhile endeavor further when time again
> permits.
>
>
I just think currently the pretty print
http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter02GeometryPrimitives/TextSpecialCharacters.html
example may be more confusing than helpful.

-Andreas

v/r Don
>
>
> On 5/6/2017 4:00 PM, Andreas Plesch wrote:
>
>> Hi Don,
>>
>> On Sat, May 6, 2017 at 4:23 PM, Don Brutzman <brutzman at nps.edu <mailto:
>> brutzman at nps.edu>> wrote:
>>
>>     Again thanks for this valuable report.
>>
>>     As it turns out, I think that really careful inspection shows that
>> the pretty-print is OK, even if it is slightly different.
>>
>> Sorry, I do not think it is ok and only slightly different. Not sure how
>> it could be considered adequate.
>>
>>     This is because the XML encoding cannot always be converted
>> literally.  Multiple equivalent character-entity representations for the
>> same character exist.
>>
>>     Emblematic of this issue is difference between & (character) and
>> & (XML character entity) and &amp; (HTML source to represent the
>> XML character entity).
>>
>>
>> Ok. This is a good example. Here is what I think should exist:
>>
>> [character]: &
>> [XML character entity]: &
>> [X3D code fragment]: <Text string=' " ampersand & : use &&" '>
>> [HTML fragment to display X3D code fragment]: <span class="value"> "
>> ampersand &amp; : use &amp;amp;" </span>
>> [rendered HTML on web page, pretty print]: " ampersand & : use
>> &&"
>>
>> The current web page is misleading since it ends up displaying (pretty
>> printed) X3D code which is inconsistent with the original X3D and what
>> cobweb and x3dom use for the scene.
>>
>>     Since plain text can be confusing (and inadvertently converted) I've
>> tried to illustrate the equivalence with the two attached figures.
>> Attached and online at
>>
>>     http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter02Ge
>> ometryPrimitives/TextSpecialCharactersScreenshotPrettyPrintHtml.png <
>> http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter02G
>> eometryPrimitives/TextSpecialCharactersScreenshotPrettyPrintHtml.png>
>>
>>
>> Misleading. I do not think the shown X3D could be used as the actual X3D.
>> For example, "ampersand & is &" would be rendered as |ampersand & is
>> &| . It should be replaced by HTML which results in:
>>
>>     http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter02Ge
>> ometryPrimitives/TextSpecialCharactersScreenshotXmlSource.png <
>> http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter02G
>> eometryPrimitives/TextSpecialCharactersScreenshotXmlSource.png>
>>
>>
>> which is the correct XML source.
>>
>>     Also added further explanation to scene description:
>>
>>              "See figures and conversions to note that multiple
>> equivalences in XML character representations lead to consistent results
>> despite slight differences in source."
>>
>>
>>
>>     Please do ask if you think that this can be improved or corrected
>> further.
>>
>>
>> I am not sure why the existing web page may be considered adequate but I
>> do not think I am missing anything.
>>
>>
>>     On 4/28/2017 8:43 AM, Andreas Plesch wrote:
>>
>>         http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter02Ge
>> ometryPrimitives/TextSpecialCharacters.html <
>> http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter02G
>> eometryPrimitives/TextSpecialCharacters.html> does not display the
>> correct x3d xml on the web page.
>>
>>         The .x3d itself is correct.
>>
>>         Here is a fixed version:
>>
>>         https://insidious-twister.glitch.me/ <
>> https://insidious-twister.glitch.me/>
>>
>>         CTRL-u for source or here:
>>
>>         https://glitch.com/edit/#!/insidious-twister <
>> https://glitch.com/edit/#%21/insidious-twister>
>>
>>         or here:
>>
>>         <span class="value">
>>               "Character entity substitutions:"
>>               "empty string \"\" skips a line:"
>>               ""
>>               "apostrophe &apos; is &amp;apos;"
>>               "ampersand &amp; is &amp;amp;"
>>               "quote mark  \"  is &amp;quot;"
>>               "backslash \\ is X3D escape character"
>>               "double backslash \\\\ is X3D backslash \\ character"
>>               "Pi &#928 is &amp;#928; XML character entity"
>>            </span>
>>
>>         BTW, glitch.com <http://glitch.com> <http://glitch.com> came up
>> with the subdomain name by itself ...
>>
>>         Not sure, if or how to teach this x3d to html-display translation
>> to a style sheet (or something else).
>>
>>         -Andreas
>>
>>
>>     all the best, Don
>>     --     Don Brutzman  Naval Postgraduate School, Code USW/Br
>> brutzman at nps.edu <mailto:brutzman at nps.edu>
>>     Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA
>> +1.831.656.2149 <tel:%2B1.831.656.2149>
>>     X3D graphics, virtual worlds, navy robotics
>> http://faculty.nps.edu/brutzman <http://faculty.nps.edu/brutzman>
>>
>>
>>
>>
>> --
>> Andreas Plesch
>> 39 Barbara Rd.
>> Waltham, MA 02453
>>
>
>
> 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/brutzma
> n
>



-- 
Andreas Plesch
39 Barbara Rd.
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170508/f3d6c19b/attachment-0001.html>


More information about the x3d-public mailing list