[X3D-Public] X3D Validator - finding error locations in a scene

Don Brutzman brutzman at nps.edu
Thu May 30 18:39:28 PDT 2013


On 4/13/2012 3:46 PM, Dave A wrote:
> Don,
>
> Is there any way it can report the line number, or Nth element, or
> something like that, for any error? Would make hunting down some things
> in text editor a little easier.

Apologies for missing this earlier.

Yes that would be nice.
- I have not found a way to make line numbers reportable in the 
stylesheet tools.  An XML debugger can provide that but it requires 
special setup usually.
- Usually DTD and Schema validation tell you (but can also be confusing 
for parent-child content model errors).
- comparing different error reports (DTD, schema, etc.) helps
- comparing different console errors from different browsers helps (i 
rarely get the same diagnostics from different browsers even for the 
same scene)

Nevertheless, for schematron at least, the output does tell you where in 
the XML tree that a problem was found.

Decipher:
	/X3D/Scene/HAnimHumanoid/HAnimJoint[1]/HAnimJoint[3]/HAnimJoint[1]/HAnimSegment
means
	initial HAnimHumanoid (of one) in the scene
	child HAnimJoint number [1]
	child HAnimJoint number [3]
	child HAnimJoint number [1]
	child HAnimSegment (of one)

Note that schematron will also report value of DEF or USE or name 
attribute.  If those are in your scene, boom you found it.  Adding DEF 
names is thus a good troubleshooting technique for finding (and 
documenting) nodes.

Example follows, easier to read on a wide screen:

====================================================================================================================
https://savage.nps.edu/X3dValidator?url=http://www.web3d.org/x3d/content/examples/Basic/HumanoidAnimation/BoxMan.x3d

Performing X3D Schematron check...
<HAnimHumanoid DEF='HUMANOID' name='Humanoid'/> DEF value does not 
contain correctly modified version of name value (for example, 
DEF='myPrefix_Humanoid')[/X3D/Scene/HAnimHumanoid, error]
<HAnimJoint DEF='hanim_HumanoidRoot'/> has incoming <ROUTE 
toNode='hanim_HumanoidRoot' toField='translation'/> to modify the 
translation field, which ordinarily is not modified (instead the center 
field controls HAnimJoint position) 
[/X3D/Scene/HAnimHumanoid/HAnimJoint[1], warning]
<HAnimSegment DEF='hanim_l_thigh' name='l_thigh' USE=''/> has contained 
Transform/Shape, but child Transform/translation='0.0956 0.9346 0.0' 
does not match parent HAnimJoint/center='0.0956 0.9364 0.0' 
[/X3D/Scene/HAnimHumanoid/HAnimJoint[1]/HAnimJoint[1]/HAnimSegment, error]
<HAnimSegment DEF='hanim_r_thigh' name='r_thigh' USE=''/> has contained 
Transform/Shape, but child Transform/translation='-0.0956 0.9346 0.0' 
does not match parent HAnimJoint/center='-0.0956 0.9364 0.0' 
[/X3D/Scene/HAnimHumanoid/HAnimJoint[1]/HAnimJoint[2]/HAnimSegment, error]
<HAnimSegment DEF='hanim_skull' name='skull' USE=''/> has contained 
Transform/Shape, but child Transform/translation='0.0 1.6440 0.0036' 
does not match parent HAnimJoint/center='0.0 1.6440 0.036' 
[/X3D/Scene/HAnimHumanoid/HAnimJoint[1]/HAnimJoint[3]/HAnimJoint[1]/HAnimSegment, 
error]
<HAnimHumanoid DEF=''/> version='' might not validate correctly, X3D 
validation support is tuned for ISO 19774 HAnimHumanoid version='2.0' 
[/X3D/Scene/Script/field[2]/HAnimHumanoid, warning]
Error(s) detected during this validation test.
X3D Schematron check: fail.
====================================================================================================================

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



More information about the X3D-Public mailing list