<div dir="ltr">I don't think this includes field specific min/max (enums yes) or number of items in an array, I think.<div><br></div><div>Here is the first cut at rules in play, embedded in the X3D JSON schema generator.</div><div><br></div><div>Let me know if you want something different, maybe we can work on writing out XSLT.</div><div><br></div><div>The gist is, I don't have field level info yet.  TBD.</div><div><br></div><div>The text below is the difference from the rules generator and the schema generator.  There should only be rules listed here.</div><div><br></div><div>Thanks!</div><div><br></div><div>< rules = ""<br><<br><<br><                 rules += "If "+k+" starts with X3D, put out reference\n"<br><                 rules += "put out  "+<a href="http://self.name">self.name</a>+" reference\n"<br><             rules += "put out @geoSystem reference\n"<br><         rules += "For class "+<a href="http://self.name">self.name</a>+"\n"<br><             rules += "If class "+<a href="http://self.name">self.name</a>+" startswith X3D but is not X3D, return empty string\n"<br><             rules += "If class "+<a href="http://self.name">self.name</a>+" has already be written out, issue empty string\n"<br><         rules += "For class "+<a href="http://self.name">self.name</a>+"\n"<br><             rules += "If class "+<a href="http://self.name">self.name</a>+" is meta, component, connect, unit, field or fieldValue, the type is array\n"<br><             rules += "Compute whether this node has a field declaration: "+str(foundFieldDeclaration)+"\n"<br><                     rules += "If name field is USE: foundUse = True\n"<br><                 else:<br><                     rules += "foundUse = False\n"<br><                     rules += "If name field is childrne: foundChildren = True\n"<br><                 else:<br><                     rules += "foundChildren = False\n"<br><             rules += "If foundUse, type = object, output @USE+@class schema\n"<br><         rules += "If foundUse, type = object, regular schema, start properties\n"<br><             rules += "If name "+<a href="http://self.name">self.name</a>+" is Script, ShaderProgram or ShaderPart, emit #sourceCode\n"<br><             rules += "If foundFieldDeclaration = "+foundFieldDeclaration+" emit field property reference pointing at #/$defs/field\n"<br><             rules += "If name "+<a href="http://self.name">self.name</a>+" is X3D, emit schema and encoding properties\n"<br><             rules += "If name "+<a href="http://self.name">self.name</a>+" is ProtoInstance, emit -children property\n"<br><             rules += "If not foundChildren ==  "+foundChildren+" emit -children property reference\n"<br><             rules += "If self node is not None, start processesing fields\n"<br><                 rules += "If self.hasIs ==  "+self.hasIS+" emit IS property reference\n"<br><                     rules += "If field name starts with X3D, field name is X3D, or field name is USE\n"<br><                             rules += "if field use is required, append @fieldname to required\n"<br><                             rules += "if field name is Scene, append fieldname and encoding to required\n"<br><                         rules += "If field name is address or not (field starts with add and not field starts with remove)\n"<br><                             rules += "If field type is MFNode or field type is SFNode, catch around the following\n"<br><                                     rules += "if field name is a class and field name is not X3D, emit def for reference for "+field.get("name")+"\n"<br><                                         rules += "if field synonym is not None, but "+field.get("synonym")+", emit reference\n"<br><                                 rules += "Except, emit def for reference for "+field.get("name")+", with acceptable node types "+ field.get("acceptableNodeTypes").replace("|", "-") + field.get("type") +'"\n'<br><                                     rules += "if field synonym is not None, but "+field.get("synonym")+", emit reference with acceptable node types "+ field.get("acceptableNodeTypes").replace("|", "-") + field.get("type") +'"\n'<br><                                 rules += "for containerField, declare acceptable node types "+ field.get("acceptableNodeTypes").replace("|", "-") + field.get("type") +'"\n'<br><                                     rules += "If field type is MFNode, put out $comment with type and accessType, set type to array wiht minItems 1\n"<br><                                 rules += "Fill in items in array with type = object and the followin properties\n"<br><                                     rules += "Create #comment type with string type\n"<br><                                 rules += "Get list of acceptable node types, and add ProtoInstance to the list\n"<br><                                 rules += "For each acceptable node type (or ProtoInstance), add to containerField string\n"<br><                                 rules += "No additional properties\n"<br><                                     rules += "If field type is MFNode, end\n"<br><                                 rules += "end\n"<br><                                 rules += "assign container field for "+field.get("acceptableNodeTypes").replace("|", "-") + field.get("type")+" to "+cf+"\n"<br><                             rules += "If field name, "+field.get("name")+" is not USE\n"<br><                             rules += "print out field\n"<br><                                 rules += "print out synonym\n"<br><             rules += "end\n"<br><             rules += "required fields: "+(", ").join(required)+"\n"<br><         rules += "no additional properties\n"<br><             rules += "if foundUse, end, end\n"<br><             rules += "If class "+<a href="http://self.name">self.name</a>+" is meta, component, connect, unit, field or fieldValue, end\n"<br><         rules += "end\n"<br></div></div>