[x3d-public] quotes in xml -> xhtml conversion

Don Brutzman brutzman at nps.edu
Sun Jan 24 18:12:56 PST 2016


On 1/24/2016 11:19 AM, Andreas Plesch wrote:
> Thanks Don,

sure

> escaping as ' avoids the parsing error. But now in the generated X3D Scene Metadata table below the scene, the escaped apostrophe is rendered as "'". because the html is generated as ' . This is more or less cosmetic.

OK good.  I added a trap for attribute values, if they contain an apostrophe ' in the content, but not a " quotation mark, then they are delimited with " to keep things simple.  This also helps if an author is simply copying the result somewhere else.

If both characters (apostrophe and quote mark) are found inside an attribute value, then further escaping is necessary and there are several ways to proceed. it can get pretty snaky fast. suggestion: don't do that!

same changes applied within X3dToXhtml.xslt pretty-print stylesheet and X3dToX3dom.xslt stylesheet. also got that cosmetic summary of metadata sorted out.  both attached.

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/20160124/09a29307/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Squaw.xhtml
Type: application/xhtml+xml
Size: 104914 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20160124/09a29307/attachment-0001.xhtml>


More information about the x3d-public mailing list