Re: Do XML Schema processors do backtracking?

Pete Cordell <[email protected]>
Newsgroups gmane.text.xml.devel
Message-ID <[email protected]>
Hi Roger,

For XSD 1.0, the path through the schema is pretty straight forward. 
Our XML data binder is able to turn it into C++ code without back 
tracking.  You can analyse a element, associate it with a particle in 
the schema and move on to the next element in an uncomplicated way.

XSD 1.1 has the xs:assert constraints.  These require a more global view 
of the XML.  While it's not back tracking specifically, it does in 
general require looking back at the data for the parsed elements.

HTH,

Pete.
-- 
---------------------------------------------------------------------
Pete Cordell
Codalogic Ltd
C++ tools for C++ programmers, http://codalogic.com
Read & write XML in C++, http://www.xml2cpp.com
---------------------------------------------------------------------
On 19/04/2022 12:33, Roger L Costello wrote:
> Hi Folks,
> 
> I am reading a compiler book [1] and it says this:
> 
> "An important practical criterion is that a parser should not backtrack. At all stages it should operate deterministically. A number of authors have described backtracking parsers, but those are rarely used in practice. It is difficult to undo semantic actions carried out by the parser as is necessary if it has to backtrack."
> 
> Do XML Schema processors do backtracking? For instance, if the XML document has this:
> 
> <name>John Doe</name>
> 
> and the XML Schema has this choice:
> 
> <xs:choice>
>      <xs:element name="id" type="xs:int" />
>      <xs:element name="name" type="xs:string" />
> </xs:choice>
> 
> Does the XML Schema processor try the first branch of the choice, backtrack, and then try the second branch?
> 
> /Roger
> 
> 
> [1] Introduction to Compiling Techniques by J.R. Bennett, see bottom of page 80.
> 
> _______________________________________________________________________
> 
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
> 
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: [email protected]
> subscribe: [email protected]
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
> 

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS
to support XML implementation and development. To minimize
spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: [email protected]
subscribe: [email protected]
List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.