Okay. I have a "schema" which is JSON, but I've not confirmed that it
passes JSON meta-schema:
https://github.com/coderextreme/X3DJSONLD/blob/master/src/specifications/X3dUnifiedObjectModel-4.1.json
(sorry, bad name, please rename if you download it. I will need to make
modifications to my Java code in order to change the base name).
I have also not confirmed if it validates any "X3D" JSON. That is next.
The modified XSLT which generates the schema from X3DUOM (imperfectly) is
here:
https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/xslt/generateJSONschema2020-12.xslt
I have gone into the schema and made edits, because I can't figure out the
logic to or not to put a comma after the default value in JSON Schema. The
logic involved is here:
https://github.com/coderextreme/X3DJSONLD/blob/23a53eb9f8835632fcad0a55087c86f284271fbb/src/main/xslt/generateJSONschema2020-12.xslt#L328
Copied below:
<xsl:if test="
not($fieldName = 'language' and local-name() =
'PackagedShader' and not(@default)) and
not($fieldName = 'language' and local-name() = 'ProgramShader'
and not(@default)) and
not($fieldName = 'language' and local-name() = 'X3DShaderNode'
and not(@default)) and
not($fieldName = 'name' and local-name() = 'meta'
and not(@default)) and
not($fieldName = 'name' and local-name() =
'HAnimDisplacer' and not(@default)) and
not($fieldName = 'name' and local-name() = 'HAnimJoint'
and not(@default)) and
not($fieldName = 'name' and local-name() = 'HAnimSegment'
and not(@default)) and
not($fieldName = 'name' and local-name() = 'HAnimSite'
and not(@default)) and
(
$fieldType = 'SFColor' or
$fieldType = 'SFColorRGBA' or
$fieldType = 'SFDouble' or
$fieldType = 'SFFloat' or
$fieldType = 'SFImage' or
$fieldType = 'SFInt32' or
$fieldType = 'SFMatrix3f' or
$fieldType = 'SFMatrix4f' or
$fieldType = 'SFRotation' or
$fieldType = 'SFTime' or
$fieldType = 'SFVec2f' or
$fieldType = 'SFVec3d' or
$fieldType = 'SFVec3f' or
$fieldType = 'SFVec4f' or
@default = 'NULL' or
@default = '-1' or
@default = '0' or
@default = '1' or
@default = '2.0' or
@default = '3' or
@default = '4.0' or
@default = 'false' or
@default = 'true' or
@default = 'AUTO' or
@default = 'BASIC' or
@default = 'CONSTANT' or
@default = 'FASTEST' or
@default = 'Full' or
@default = 'INVERSE' or
@default = 'LINEAR' or
@default = 'LOWPASS' or
@default = 'MATCH_ANY' or
@default = 'MAX' or
@default = 'NONE' or
@default = 'PIE' or
@default = 'PLAIN' or
@default = 'REPEAT' or
@default = 'SPEAKERS' or
@default = 'SPHERE' or
@default = 'SQUARE' or
@default = 'localhost' or
@default = 'standAlone' or
(@default != 'BOUNDS' and @default != 'CLOSEST' and not(@default)))">
<xsl:text>,
</xsl:text>
Frankly, I am puzzled. The problem involves absent default values for meta
name, shader language and HAnim name fields.
If someone wants to help with my logic, great.
I created a shell script to run the stylesheet, here:
https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/shell/schema.sh
The stylesheet should work with any XSLT 2.0 processor.
Note that this schema varies wildly from the one generated by python. I'm
not quite sure why Claude.ai borked. It was a one shot deal. What I can
do is try with X3DUOM, the Python XSLT generator, and a real JSON schema
next (lots of tokens).
John
On Sun, Jan 25, 2026 at 1:27 AM John Carlson <yottzumm at gmail.com> wrote:
> First cut at an XSLT stylesheet for converting X3DUOM to JSON schema.
>
> It’s got a web3d license.
>
> I’ve not tried it at all, that takes more work! It’s 3/7th’s the size of
> the python, so that’s impressive!
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20260125/e8f79401/attachment.html>