[x3d-public] x3d case correction tool

Andreas Plesch andreasplesch at gmail.com
Tue Nov 3 09:34:30 PST 2015


Since the idea of having a x3d document which is conforming as much as
possible is attractive, I am thinking of a tool which corrects element
names and attribute names to their correct case sensitive spelling. Is
there such a tool ?

In principle I think it could work by:
1) extract all element and attribute names from the .dtd and/or schema
2) go through all elements (recursively) in (nonconforming) x3d document
2a)  normalize element name to lower-case and see if there is a
corresponding normalized node name in dtd
2b) if there is replace with correct, case sensitive element name
  if not flag as unknown (or ignore, optionally eliminate)
2c) do the same for all used attribute names

This would work for most if not all names since they can all (most?) be
distinguished in a case insensitive manner.

The tool of choice would be a xsl style sheet which may have to be
generated by another stylesheet which processes the .dtd/schema. What would
be other strategies (going through json) ? How would one go about this in
more detail ? Perhaps the x3d-tidy.xsl style sheet is a starting point ? It
looks daunting.

However, I would probably start much more straightforwardly by looking at
http://www.web3d.org/specifications/X3dDoctypeDocumentation3.3.html and
http://www.web3d.org/specifications/X3dSchemaDocumentation3.3/x3d-3.3.html
to assemble a list and then use unix tools such as sed/awk and such
to transform the x3d. What is used to generate the above documentation from
the .dtd/xsd ?

Any input much appreciated,

Andreas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20151103/e04e9763/attachment.html>


More information about the x3d-public mailing list