Re: XML Parsing

nugatory <>
23 Mar 2000 22:33:50 -0500

          From comp.compilers

Related articles
XML Parsing (Vassilis Kostakos) (2000-03-11)
Re: XML Parsing (2000-03-21)
Re: XML Parsing (nugatory) (2000-03-23)
Re: XML Parsing (Bogdan CRIVAT) (2000-04-01)
| List of all articles for this month |

From: nugatory <>
Newsgroups: comp.compilers,comp.compilers.lcc
Date: 23 Mar 2000 22:33:50 -0500
Organization: MindSpring Enterprises
References: 00-03-066
Keywords: parse

Vassilis Kostakos wrote:

> A few questions on XML:
> - Where can I find an XML parser that I can use in my PC (Win/Linux)
> - I'm supposed to be working on a parser for XML. I was wondering if I
> could have something such as:
> <num>3</num> <op>plus</op> <num>5</num> <op>equal</op>
> which would yield as output <num>8</num>

1) You can get a quite satisfactory open source XML parser from, in either C++ or Java. A Java XML parser is also
available directly from, and you can find pointers to
several more parsers by following links from or

2) Not exactly, because it is an XML rule that all valid XML documents
have a single top-level element, and you have four. But something
very similar would be quite easy:

<calculate op="plus">

with a DTD that looks something like:

<!ELEMENT calculate ((num|calculate),(num|calculate))>
<!ATTLIST calculate op (plus|minus|times|divide) #REQUIRED>

I'm writing that DTD from memory, so if I gribbled the syntax a bit
you'll have to fix it.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.