Re: [xml] Xpath question

2007-04-25 Thread Liam R E Quin
On Wed, 2007-04-25 at 16:32 -0700, Yong Chen (yongche) wrote: > Say I have an xml tree: > > >A > >B C > > D E > [..] > Now say I have xpath "/A/B", it selects node "B". When I return the > result, should I return B node only, or I should return B and also i

[xml] Xpath question

2007-04-25 Thread Yong Chen \(yongche\)
Hi, Say I have an xml tree: A B C D E Basically A being the root, containing B and C as its children, B contains D and E as its children. Now say I have xpath "/A/B", it selects node "B". When I return the result, should I return B node only, or I should ret

[xml] Returning error codes from start/endElement

2007-04-25 Thread Dan McRae
How do I pass return/error codes from startElement() and endElement() up to xmlSAXUserParseFile()? xmlSAXUserParserFile() returns an int but startElement() and endElement() both return void. Thanks, -Dan -- Dan McRae Sr. Software Engineer Comet Solutions, Inc. 505.323.2525 505.962.2350

Re: [xml] XML conditional section not closed error could need some more info

2007-04-25 Thread Daniel Leidert
Am Mittwoch, den 25.04.2007, 18:58 +0200 schrieb Daniel Leidert: > Am Mittwoch, den 18.04.2007, 18:52 +0200 schrieb Daniel Leidert: [..] > > xmllint --debug --debugent --noout --nonet --valid test-custom-1.1.xml > > > > I get an error: > > > > file:///usr/share/xml/docbook/custom/simple/1.1/sdoc

Re: [xml] XML conditional section not closed error could need some more info

2007-04-25 Thread Daniel Leidert
Am Mittwoch, den 18.04.2007, 18:52 +0200 schrieb Daniel Leidert: > I have some test cases to check DocBook DTDs. One for simplified DocBook > is: > > > "-//OASIS//DTD Simplified DocBook XML Customization V1.1//EN" > "http://www.oasis-open.org/docbook/xml/simple/1.1/sdocbook-custom.dtd";> > >

Re: [xml] patch: Functions to parse and create URI query strings

2007-04-25 Thread Richard W.M. Jones
The attached patch just adds query_raw, and uses it in preference to query if it is set. Rich. -- Emerging Technologies, Red Hat http://et.redhat.com/~rjones/ 64 Baker Street, London, W1U 7DF Mobile: +44 7866 314 421 Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Stre

Re: [xml] patch: Functions to parse and create URI query strings

2007-04-25 Thread Daniel Veillard
On Wed, Apr 25, 2007 at 03:40:04PM +0100, Richard W.M. Jones wrote: > Daniel Veillard wrote: > >On Wed, Apr 25, 2007 at 11:19:36AM +0100, Richard W.M. Jones wrote: > >>OK, so I'll rework to integrate this into the normal parsing and saving > >>of URIs and put the results in the URI structure. (Is

Re: [xml] patch: Functions to parse and create URI query strings

2007-04-25 Thread Richard W.M. Jones
Daniel Veillard wrote: On Wed, Apr 25, 2007 at 11:19:36AM +0100, Richard W.M. Jones wrote: OK, so I'll rework to integrate this into the normal parsing and saving of URIs and put the results in the URI structure. (Is that right?) yes. uri->query really must be deprecated though! There's

Re: [xml] patch: Run valgrind with -q (quiet) flag

2007-04-25 Thread Daniel Veillard
On Wed, Apr 25, 2007 at 02:24:07PM +0100, Richard W.M. Jones wrote: > Unless you have a ~/.valgrindrc file specifying that valgrind runs > quietly, it runs verbosely which makes seeing errors rather hard. The > attached patch fixes that. Cool, makes sense, in SVN revision 3606, thanks !

Re: [xml] Entity reference Problem

2007-04-25 Thread Daniel Veillard
On Wed, Apr 25, 2007 at 03:29:36PM +0200, Shirazi Babak wrote: > doc = xmlSAXParseFileWithData(&sax, stpI->szFilename, 0, (void > *)stpI); > > > > So > How could I turn on > "...entities substitution at the parser level." > In this situation? Do *NOT* use SAX if you're not able to d

[xml] Entity reference Problem

2007-04-25 Thread Shirazi Babak
More precisely: I use the SAX-Parser and I wrote this simple code: xmlDocPtr doc = (xmlDocPtr)0; xmlSAXHandler sax; xmlSAX2InitDefaultSAXHandler (&sax, 0); sax.startDocument = startDocumentSAXCallBackFunc; sax.endDocument = endDocumentSAXCallBackFunc; sax.st

[xml] patch: Run valgrind with -q (quiet) flag

2007-04-25 Thread Richard W.M. Jones
Unless you have a ~/.valgrindrc file specifying that valgrind runs quietly, it runs verbosely which makes seeing errors rather hard. The attached patch fixes that. Rich. -- Emerging Technologies, Red Hat http://et.redhat.com/~rjones/ 64 Baker Street, London, W1U 7DF Mobile: +44 7866 314

Re: [xml] Entity reference Problem

2007-04-25 Thread Daniel Veillard
On Wed, Apr 25, 2007 at 03:09:19PM +0200, Shirazi Babak wrote: > > How could I turn on > "...entities substitution at the parser level."? http://xmlsoft.org/html/libxml-parser.html#xmlParserOption XML_PARSE_NOENT used in xmlRead... entry points for example. Daniel -- Red Hat Virtuali

[xml] Entity reference Problem

2007-04-25 Thread Shirazi Babak
How could I turn on "...entities substitution at the parser level."? Babak * +43(1)60504-2029 * +43(1)60504- * [EMAIL PROTECTED] * www.datasystems.at ___ xml mailing list, project page h

Re: [xml] patch: Functions to parse and create URI query strings

2007-04-25 Thread Daniel Veillard
On Wed, Apr 25, 2007 at 11:19:36AM +0100, Richard W.M. Jones wrote: > Daniel Veillard wrote: > >>The current uri->query field is always unescaped during parsing. I have > >>changed so it always stored in its raw form. This because otherwise > >>it's impossible to parse query strings such as: >

Re: [xml] patch: support in HTML parser

2007-04-25 Thread Daniel Veillard
On Wed, Apr 25, 2007 at 09:20:51PM +1000, Michael Day wrote: > Hi Daniel, > > > where is the limit ? > > So far is the only element I've seen that triggers error > messages from the HTML parser. Then again, it doesn't seem to support > , but I'm not sure if any site uses it unironically these

Re: [xml] patch: support in HTML parser

2007-04-25 Thread Michael Day
Hi Daniel, > where is the limit ? So far is the only element I've seen that triggers error messages from the HTML parser. Then again, it doesn't seem to support , but I'm not sure if any site uses it unironically these days :) > In practice what were the problems except getting (rightful) e

Re: [xml] patch: Functions to parse and create URI query strings

2007-04-25 Thread Richard W.M. Jones
Daniel Veillard wrote: The current uri->query field is always unescaped during parsing. I have changed so it always stored in its raw form. This because otherwise it's impossible to parse query strings such as: file:///tmp/test.html?test=%26&second=%26 which can be generated by web browsers.

Re: [xml] patch: Functions to parse and create URI query strings

2007-04-25 Thread Daniel Veillard
Hi Rich, On Tue, Apr 24, 2007 at 07:03:59PM +0100, Richard W.M. Jones wrote: > Attached is a patch against libxml2 svn which provides functions for > parsing up and creating query strings, like: > > ?field1=value1&field2=value2 > > into [(field1, value1), (field2, value2)]. > > The semantic

Re: [xml] patch: Functions to parse and create URI query strings

2007-04-25 Thread Bjoern Hoehrmann
* Richard W.M. Jones wrote: >The semantics of query strings don't seem to be very well defined. http://ietfreport.isoc.org/idref/draft-hoehrmann-urlencoded/ will solve that eventually (there is a bug in the encoding algorithm which does not account for escaping '+', otherwise it should be fine).