C
Chris
I have a requirement to have an XML document
that consists of an arbitrarily large expression.
For simplicity's sake, assume I have the following grammar:
expr => term rest
term => ID relop ID
rest => (conjunction term) | e
conjunction => AND|OR
relop => EQ|NE|GT|GE|LT|LE
Is it possible to convert this grammar to a DTD or schema?
I've tried the following DTD without success:
<!ELEMENT expr (term,rest)>
<!ELEMENT term (id,relop,id)>
<!ELEMENT rest ((conjunction,term)|EMPTY)>
<!ELEMENT conjunction (EMPTY)>
<!ELEMENT id (#PCDATA)>
<!ELEMENT relop (EMPTY)>
<!ATTLIST conjunction type (AND|OR)>
<!ATTLIST relop type (EQ|NE|GT|GE|LT|LE)>
Any pointers appreciated.
Thanks in advance.
that consists of an arbitrarily large expression.
For simplicity's sake, assume I have the following grammar:
expr => term rest
term => ID relop ID
rest => (conjunction term) | e
conjunction => AND|OR
relop => EQ|NE|GT|GE|LT|LE
Is it possible to convert this grammar to a DTD or schema?
I've tried the following DTD without success:
<!ELEMENT expr (term,rest)>
<!ELEMENT term (id,relop,id)>
<!ELEMENT rest ((conjunction,term)|EMPTY)>
<!ELEMENT conjunction (EMPTY)>
<!ELEMENT id (#PCDATA)>
<!ELEMENT relop (EMPTY)>
<!ATTLIST conjunction type (AND|OR)>
<!ATTLIST relop type (EQ|NE|GT|GE|LT|LE)>
Any pointers appreciated.
Thanks in advance.