Menu
Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
XML
Converting Simple BNF grammar to DTD or schema
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Patrick TJ McPhee, post: 771262"] % I have a requirement to have an XML document % that consists of an arbitrarily large expression. You might want to sketch out what you want your XML to look like before you write the DTD. % expr => term rest % term => ID relop ID % rest => (conjunction term) | e You probably want to use Kleene closure for this kind of production what you've written will require <expr><term><id>i</id><relop type='EQ'/><id>7</id></term><rest/></expr> to represent i = 7 To represent i = 7 and j < 4 you'd need <expr><term><id>i</id><relop type='EQ'/><id>7</id></term> <rest><conjunction conjunction type='AND'/> <term><id>i</id><relop type='EQ'/><id>7</id></term></rest> </expr> While what you probably want is this, without a `rest' element. <expr><term><id>i</id><relop type='EQ'/><id>7</id></term> <conjunction conjunction type='AND'/> <term><id>i</id><relop type='EQ'/><id>7</id></term> </expr> You can get that by changing the definition of expr <!ELEMENT expr (term,(conjunction,term)*> and removing the definition of rest. [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
XML
Converting Simple BNF grammar to DTD or schema
Top