[x3d-public] X3dToJSON.xslt stylesheet. ProtoInstances with USE don't get a name attribute

John Carlson yottzumm at gmail.com
Mon Mar 14 17:21:08 PDT 2016


  arc.json
<https://drive.google.com/file/d/0B7SWdIIE8ueKYkhZNTlramd1bWxyYTZVUmYyZnhFU2pTMUdF/view?usp=drivesdk>
roy can you test this file against X3D JSON Schema.  I believe if it
complains about a missing @name attribute in the ProtoInstance, there's a
problem with the X3dToJson.xslt stylesheet removing the name attribute on a
ProtoInstance with a USE attribute (unless someone fixed it in the
meantime...I think my original message wasn't clear.)    I can provide a
source .x3d file.  The source file is somewhat questionable, but it passed
QA tests last time I checked.  You may want to construct your own example.
I'll post my source file in a follow up message.  I am operating on my
phone right now, so it's hard to view json and x3d text files.  I am
attaching from Google drive from a previous message.
On Mar 14, 2016 6:57 PM, "Roy Walmsley" <roy.walmsley at ntlworld.com> wrote:

Don,

I checked the JSON schema - it already required the @name field for
ProtoDeclare and ExternProtoDeclare. However, it was optional for
ProtoInstance. I  have now made it required, and committed the change to
SourceForge.

Roy

-----Original Message-----
From: Don Brutzman [mailto:brutzman at nps.edu]
Sent: 14 March 2016 22:34
To: John Carlson; Roy Walmsley
Cc: X3D Graphics public mailing list
Subject: Re: X3D JSON style sheet. ProtoInstances with USE don't get a name
attribute

Thanks for asking.  Yes there is some partial redundancy of information
here.  However...

Some time ago we decided to make the @name attribute required, even for
USE.  This allows a player to perform strong checking of node type, just as
is possible with any other USE node.

This approach also avoids single point of failure, where a mistaken
spelling of DEF or USE might inadvertently insert a scene graph with the
wrong node type somewhere into the scene graph.  Such a mistake has a high
likelihood of creating a serious run-time error.  From that perspective, I
suppose requiring @name for strong type checking also is helpful in
maintaining scene security from attack.

Glad to hear that X3D Schematron confirmed the omission was erroneous!  8)

So please include @name field in your ProtoInstance, ProtoDeclare and
ExternProtoDeclare output.  Also (Roy) please require it in the JSON
Schema.  It is good that we are building consistent set of requirements and
quality assurance (QA) into each of the encodings.


On 3/13/2016 7:24 AM, John Carlson wrote:
> See  that name attributes for ProtoInstances got removed when there’s USE
in result file arc2.x3d in arc.son.  I can probably put them back in my
PrototypeExpander, I am not sure. This causes Schematron to complain. You
can fix Schematron too, if it’s an error.  Source is arc.x3d and
intermediate is arc.json


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/20160314/013b8717/attachment.html>


More information about the x3d-public mailing list