xml3d / xml3d.js

The WebGL/JS implementation of XML3D
Other
75 stars 25 forks source link

Add error messages for incorrectly nested XML3D elements #59

Closed lachsen closed 9 years ago

lachsen commented 10 years ago

Especially when converting XML3D tag code from XHTML to HTML it often happens, that tags are not "correctly" closed in the HTML version.

For example, this HTML code:

<float3 name="position" param="true" />
<float3 name="normal" param="true" />
<int4 name="boneIdx" param="true" />
<float4 name="boneWeight" param="true" />

will be parsed to this DOM representation:

<float3 name="position" param="true" >
    <float3 name="normal" param="true" >
        <int4 name="boneIdx" param="true" >
            <float4 name="boneWeight" param="true" ></float4>
        </int4>
    </float3>
</float3>

Those mistakes are difficult to detect because there is no error message about this.

Thus, I suggest to add a couple of additional checks for the node hierarchy that makes it easier to detect those mistakes.

An example: when nesting value element within each other (e.g. an <int> within a <float3>) an error or warning should appear.