Hi,
I'm new to JESS & I couldn't all the previous archives.
 
How to define a user-type (like class of Java, structure of C, etc)?
Does template (deftemplate) play the similar role or others does?
 
I wanna transform an XML document (actually, XML Schema) into JESS facts.
For example,
<xs:schema xmlns:xs="xml" xsmlns:oag="oag" ...>....
As you know, the number of namespaces included in an XML Schema varies, so we cannot define a template (slots) at off-line.
I think one solution is using 'multislot' or array type, but I must define as follows
--
(deftemplate xmlschema
    (multislot namespace_name)
    (multislot namespace_uri)
)
--
 
However, this can occur - the first slot of name is "xmlns:xs" but the first slot of uri is "oag" (this must be "xml").
 
So, I need to define a user-type (class of Java), if "deftemplate" does play the role
we can define as follows
--
(deftemplate namespace
    (slot namespace_name (type string))
    (slot namespace_uri (type string))
)
(deftemplate xmlschema
    (multislot namespaces (type namespace))
)
--
Is this right approach? Or, other ways to define complex types?
 
Thx, all.
 
--
Grace, mercy, peace and love from God our Father and from Jesus Christ our Savior be yours in abundance.

Reply via email to