Beginner question: Is it possible to generate/declare variables dynamically?
I have a factbase representing the elements, attributes, etc. of a xml structure:
xml_fact(Kind, Property, Factid, Parentid, Value)
, e.g.
xml_fact(elem, name, 1, 0, root).
xml_fact(elem, name, 2, 1, child).
xml_fact(attr, name, 3, 2, id).
xml_fact(attr, value, 4, 3, 1111).
Now I need a variable, e.g. for each element:
Root = 1, Child = 2
The goal of this is to reason about additional semantics not expressed by XSD. The xml input is xsd-valided xml for a special use case. I’d like to represent the additional semantics in form of predicates using those variables. With regard to the above example, this can simply be written down. There is only one child node named ‘child’.
- How can corresponding variables be generated for any XML data (e.g. multiple child-nodes)?
- How to reference those variables?
- How could additional information be associated to the variable (e.g. the Factid as initial assignment for tracking changes later on)?
Thanks in advance.
Regards
J