[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: XML parsers use what computational power?

  • From: "Costello, Roger L." <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Mon, 8 Apr 2013 21:29:35 +0000

RE: XML parsers use what computational power?
Hi Folks,

Can XML parsers be implemented using exclusively these two tools:

1. A finite state machine (FSM)
2. A stack

Let's see:

Case 1: parsing a start-tag, content, end-tag

Yes, I can imagine implementing that by pushing the start-tag onto the stack, scanning through the content, and then popping the stack when an end-tag is encountered and comparing it against the start-tag.

Case 2: parsing user-defined entity declarations

Consider these two ENTITY declarations in the XML document's internal DTD subset:

<!ENTITY ha1 "ha">
<!ENTITY ha2 "&ha1;&ha1;">

Each entity name and replacement value could be stored in the stack.

When the entity name is encountered within the XML document:

    &ha2;

the parser could pop the stack until it encounters the name ha2 and get its replacement text, which involves getting ha1 and its replacement text. So I could imagine that entity resolution could be implemented using a FSM plus stack.

Case 3: parsing an IDREF reference

Each ID value is pushed onto the stack. When an IDREF reference is encountered, the stack is popped until it finds a matching ID value. It seems plausible that ID/IDREF matching could be accomplished using a FSM plus stack.

Is there any feature of XML that could not be implemented exclusively using the two tools, FSM and stack?

/Roger



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.