[x3d-public] X3dToJson.xslt problem with -metadata field treated as an MFNode, not SFNode. Maybe use -value or -children instead of -metadata

John Carlson yottzumm at gmail.com
Thu Oct 14 15:45:15 PDT 2021


Probably this is a MetadataSet metadata/value/children discussion note, 
but JSON is not passing.

Note: 
x3d-code/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter15Metadata/XmpMetadataEmbedded.json 
does not pass jsonlint.

jsonlint 
/c/x3d-code/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter15Metadata/XmpMetadataEmbedded.json
Error: Parse error on line 208:
... },                { "MetadataSet":
----------------------^
Expecting 'STRING', got '{'
     at Object.parseError 
(/usr/local/lib/node_modules/jsonlint/lib/jsonlint.js:55:11)
     at Object.parse 
(/usr/local/lib/node_modules/jsonlint/lib/jsonlint.js:132:22)
     at parse (/usr/local/lib/node_modules/jsonlint/lib/cli.js:82:14)
     at main (/usr/local/lib/node_modules/jsonlint/lib/cli.js:135:14)
     at Object.<anonymous> 
(/usr/local/lib/node_modules/jsonlint/lib/cli.js:179:1)
     at Module._compile (internal/modules/cjs/loader.js:1072:14)
     at Object.Module._extensions..js 
(internal/modules/cjs/loader.js:1101:10)
     at Module.load (internal/modules/cjs/loader.js:937:32)
     at Function.Module._load (internal/modules/cjs/loader.js:778:12)
     at Function.executeUserEntryPoint [as runMain] 
(internal/modules/run_main.js:76:12)


JSON snippet:

               "-metadata":
                 { "MetadataString":
                   {
                     "@name":"xml:lang",
                     "@value":["en"]
                   }
                 },
                 { "MetadataSet":
                   {
                     "@name":"namespaces",


XML snippet:

     <MetadataSet name='rdf:RDF' reference='TODO refer to XMP ISO 
specification document'>
       <MetadataString name='xml:lang' value='en'/>
       <MetadataSet name='namespaces'>
         <MetadataString name='xmlns:rdf' 
value='http://www.w3.org/1999/02/22-rdf-syntax-ns#'/>
         <MetadataString name='xmlns:dc' 
value='http://purl.org/dc/elements/1.1/'/>
         <MetadataString name='xmlns:xmp' 
value='http://ns.adobe.com/xap/1.0/'/>
       </MetadataSet>
       <MetadataSet name='rdf:Description'>
         <MetadataString name='rdf:about' 
value='https://kshell.com/sgs/example_uri_0001/'/>
         <MetadataSet name='dc:description'>
           <MetadataSet name='rdf:Alt'>
             <MetadataString name='rdf:li' value='VRML visualization'/>
           </MetadataSet>
         </MetadataSet>
         <MetadataString name='dc:format' value='model/x3d-vrml'/>
         <MetadataString name='dc:rights' value='""'/>
         <MetadataSet name='dc:title'>
           <MetadataSet name='rdf:Alt'>
             <MetadataString name='rdf:li' 
value='l-bracket_20120725.134815'/>
           </MetadataSet>
         </MetadataSet>
         <MetadataSet name='dc:creator'>
           <MetadataSet name='rdf:Seq'>
             <MetadataString name='rdf:li' value='vmarchetti at kshell.com'/>
           </MetadataSet>
         </MetadataSet>
         <MetadataString name='xmp:CreateDate' value='2021-2-10'/>
       </MetadataSet>
     </MetadataSet>


X3DUOM:

      <ConcreteNode name="MetadataSet">
          <InterfaceDefinition 
specificationUrl="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-CD1/Part01/components/core.html#MetadataSet"
                               appinfo="The metadata provided by this 
node is contained in the metadata nodes of the value field.">
             <componentInfo name="Core" level="1"/>
             <Inheritance baseType="X3DNode"/>
             <AdditionalInheritance baseType="X3DMetadataObject"/>
             <field name="IS"
                    type="SFNode"
                    accessType="inputOutput"
                    default="NULL"
                    acceptableNodeTypes="IS"/>
             <field name="metadata"
                    type="SFNode"
                    accessType="inputOutput"
                    default="NULL"
                    acceptableNodeTypes="X3DMetadataObject"
                    description="Information about this node can be 
contained in a MetadataBoolean, MetadataDouble, MetadataFloat, 
MetadataInteger, MetadataString or MetadataSet node."/>

IDK, just me would tend towards calling the metadata field type in 
MetadataSet node an MFNode? But no, it's an SFNode in X3D3.3 (and V4):

7.4.5 MetadataSet

MetadataSet : X3DNode, X3DMetadataObject {
   SFNode   [in,out] metadata  NULL [X3DMetadataObject]
   SFString [in,out] name      ""
   SFString [in,out] reference ""
   MFNode   [in,out] value     [] [X3DMetadataObject]
}

So it seems like we should use -value (an MFNode above) [ or -children? 
]instead of -metadata, thus X3dToJson.xslt needs to be modified.




More information about the x3d-public mailing list