Re: [xml] Clone the reader?
- From: Daniel Veillard <veillard redhat com>
- To: Csaba Raduly <rcsaba gmail com>
- Cc: xml gnome org
- Subject: Re: [xml] Clone the reader?
- Date: Wed, 10 Feb 2010 17:15:47 +0100
On Wed, Feb 10, 2010 at 04:58:05PM +0100, Csaba Raduly wrote:
I'm using the xmlreader interface to parse a document defined by a
schema. When there is a node defined by a union
<xsd:union memberTypes="xsd:string xsd:boolean xsd:decimal xsd:time
processing is supposed to try all alternatives (try to decode it as a
string, then as a boolean, etc) until one is successful. However, this
would require the reader to back up each time, which doesn't appear to
be possible. Is there a way to implement this, perhaps by cloning the
parser at that point for each alternative ?
The reader is somehow a wrapper around a parser, and a parser can't be
"cloned". But in your case I really don't see why you would need to
roll back in parsing...that's not needed just check the value. Though I
really don't see how you're gonna be able to desambiguate between
options for example xsd:float and xsd:double ... That schemas makes no
sense to me...
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel veillard com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
] [Thread Prev