[x3d-public] xhtml example not escaping "<"
Brutzman, Donald (Don) (CIV)
brutzman at nps.edu
Fri Aug 25 08:39:03 PDT 2023
Thanks for helpful report Andreas.
I almost went ahead and changed it, but am having some second thoughts. The
actual text characters in the description meta tag found in points2500.x3d
are
* <meta content='This test attempts to draw an Extrusion using the
minimum required number of points. The number of points in crossSection *
number of points in spine <= 2500 (100 * 25 = 2500). The test should
generate a "U" shaped like extrusion.' name='description'/>
When authoring an .x3d file, using an escape character like < is an
appropriate form in XML encoding to include a less-than sign in SFString
text.
So we could rephrase this troublesome text in the above description, but
instead probably should look at addressing the root cause. Other examples
of legally escaped characters will certainly occur in other X3D fields and
files; we also strive for consistently correct convertibility across
different formats.
Depending on how you are parsing, one fix might be to keep SFString/MFString
values unescaped. No doubt you are already doing something like that in
Script CDATA blocks or url inline code, since less-than sign is quite common
in ECMAscript source. This also has the merit of not modifying author
inputs when not necessary.
So, following that approach, your transcribed result in the HTML would look
similar to what is above in .x3d, namely:
* <span class="webfont">This test attempts to draw an Extrusion using
the minimum required number of points. The number of points in crossSection
* number of points in spine <= 2500 (100 * 25 = 2500). The test should
generate a "U" shaped like extrusion.</span>
Confirmation check: this indeed looks like what the X3dToXhtml.xslt
stylesheet did. There was a lot of other character escaping going on for
satisfactory HTML presentation too. (Fingers crossed that the following
excerpts are not mangled by mailers.)
*
view-source:https://www.web3d.org/x3d/content/examples/ConformanceNist/Geome
try/Extrusion/points2500.html
* <span title="meta 'description' provides summary overview describing
this resource"><<span class="element">meta</span> <span
class="attribute">name</span>='<span
class="value">description</span>' <span
class="attribute">content</span>='<span class="plain">This test attempts to
draw an Extrusion using the minimum required number of points. The number of
points in crossSection * number of points in spine <= 2500 (100 * 25 =
2500). The test should generate a "U" shaped like
extrusion.</span>'/>
*
https://www.web3d.org/x3d/content/examples/ConformanceNist/Geometry/Extrusio
n/points2500.html
* <meta name='description' content='This test attempts to draw an
Extrusion using the minimum required number of points. The number of points
in crossSection * number of points in spine <= 2500 (100 * 25 = 2500). The
test should generate a "U" shaped like extrusion.'/>
Hmm, am finally finding a different culprit, probably what you were trying
to get me to understand in the first place:
*
https://www.web3d.org/x3d/content/examples/ConformanceNist/Geometry/Extrusio
n/points2500X3dom.xhtml
* <p>
* <span class="webfont">This test attempts to draw an Extrusion
using the minimum required number of points. The number of points in
crossSection * number of points in spine <= 2500 (100 * 25 = 2500). The test
should generate a "U" shaped like extrusion.</span>
* </p>
I found and modified the output from X3dToX3domX_ITE.xslt stylesheet to
handle this. Now seems to work, leaving < unchanged in description text.
Applying this conversion change to all examples, will upload all revised
copies once full build completes.
Hope this helps, further scrutiny and improvements are always welcome.
p.s. for anyone watching, and recently reaffirmed by Mike McCann at SIGGRAPH
2023 Cartographic BOF: "View Source" capabilities are a critical feature for
how the Web keeps getting better.
Have fun with X3D! 8)
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 https://faculty.nps.edu/brutzman
-----Original Message-----
From: x3d-public <x3d-public-bounces at web3d.org> On Behalf Of Andreas Plesch
Sent: Friday, August 25, 2023 6:47 AM
To: X3D Graphics public mailing list <x3d-public at web3d.org>
Subject: [x3d-public] xhtml example not escaping "<"
<https://www.web3d.org/x3d/content/examples/ConformanceNist/Geometry/Extrusi
on/points2500X3dom.xhtml>
https://www.web3d.org/x3d/content/examples/ConformanceNist/Geometry/Extrusio
n/points2500X3dom.xhtml
is the x3dom version linked from
<https://www.web3d.org/x3d/content/examples/ConformanceNist/Geometry/Extrusi
on/points2500Index.html>
https://www.web3d.org/x3d/content/examples/ConformanceNist/Geometry/Extrusio
n/points2500Index.html
There is a parsing error because the description contains a "<" character:
<span class="webfont">This test attempts to draw an
Extrusion using the minimum required number of points. The number of points
in crossSection * number of points in spine <= 2500 (100 * 25 = 2500). The
test should generate a "U" shaped like extrusion.</span>
This "<" character would need to be replaced with an XML character entity
<
The documentation html for the iframe does use the character entity for the
description:
<https://www.web3d.org/x3d/content/examples/ConformanceNist/Geometry/Extrusi
on/points2500.html>
https://www.web3d.org/x3d/content/examples/ConformanceNist/Geometry/Extrusio
n/points2500.html
There may be other example descriptions with "<" or ">" characters.
-Andreas
--
Andreas Plesch
Waltham, MA 02453
_______________________________________________
x3d-public mailing list
<mailto:x3d-public at web3d.org> x3d-public at web3d.org
<http://web3d.org/mailman/listinfo/x3d-public_web3d.org>
http://web3d.org/mailman/listinfo/x3d-public_web3d.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230825/819421ef/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5464 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230825/819421ef/attachment-0001.p7s>
More information about the x3d-public
mailing list