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

RE: 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: Tue, 9 Apr 2013 20:11:42 +0000

RE:  RE: XML parsers use what computational power?
Bjoern wrote about entity resolution:

> Whatever you pop() here from the stack would 
> be lost afterwards. If you need 'ha1', then you 
> have to forget 'ha2' to retrieve it. And all other
> state you keep on the stack.

Wow!

As I understand it, you have just explained why entity resolution necessitates an XML parser be a Turing machine!

This is big news (at least for me):

    To implement a parser for the XML specification 
    requires the parser be Turing-complete.

The ramifications of this are huge, particularly with regard to security and XML's attack surface.

/Roger

-----Original Message-----
From: Bjoern Hoehrmann [mailto:derhoermi@gmx.net] 
Sent: Tuesday, April 09, 2013 1:53 PM
To: Costello, Roger L.
Cc: xml-dev@lists.xml.org
Subject: Re:  RE: XML parsers use what computational power?

* Costello, Roger L. wrote:
>Can XML parsers be implemented using exclusively these two tools:
>
>1. A finite state machine (FSM)
>2. A stack

You seem to be missing that in the computational model the stack is all
the memory you have. If you add a second stack, so you could e.g. pop()
items from one and push() them to the other, you have a turing machine.

Take your example:

>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.

Whatever you pop() here from the stack would be lost afterwards. If you
need 'ha1', then you have to forget 'ha2' to retrieve it. And all other
state you keep on the stack.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 


[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.