[xml] xpathEval namespace axis corruption/segfault

2008-03-10 Thread Martin (gzlist)
I attach a simple python script (libxml2_crash.py) that seems to reference uninitialised memory, or crash the interpreter. Run on various setups, the results were (using � for random junk char): * debian stable (2.6.27 plus security patches and py 2.4): segfault * win32 (2.6.30 and py 2.4):

Re: [xml] xpathEval namespace axis corruption/segfault

2008-03-21 Thread Martin (gzlist)
On 12/03/2008, Daniel Veillard <[EMAIL PROTECTED]> wrote: > On Mon, Mar 10, 2008 at 06:43:02PM -0700, William M. Brack wrote: > > > > I traced through quite a bit, and was able to isolate where and what > > the problem is. Unfortunately, I can't spend much time on libxml2 > > for the next coup

Re: [xml] Namespace Query Issue

2008-04-18 Thread Martin (gzlist)
On 18/04/2008, Alistair Leslie-Hughes <[EMAIL PROTECTED]> wrote: > Hi, > > When use xmlXPathEval with the query "/root/WEB:Site" on the following xml > > > > > > > I get the following error > XPath error : Undefined namespace prefix > xmlXPathEval: evaluation failed > > Using the s

Re: [xml] xmllint DTD question

2008-04-29 Thread Martin (gzlist)
On 29/04/2008, Alistair Leslie-Hughes <[EMAIL PROTECTED]> wrote: > Hi, > > Load this attached file with libxml gives the following our > I/O warning : failed to load external entity > > using xmllint > xmllint --valid --noout room1.xml > room1.xml:2: validity error : Validation failed: no DTD

[xml] Python bindings default error handling

2008-04-30 Thread Martin (gzlist)
Currently libxml2 ignores the value of sys.stderr and prints straight to c stderr. This caught me out a couple of times in the past, when using from within apache (ended up raw in the error log) and when trying to pass on the problems reported to another process. Setting your own callback can get t

Re: [xml] Python bindings default error handling

2008-05-09 Thread Martin (gzlist)
On 07/05/2008, Daniel Veillard <[EMAIL PROTECTED]> wrote: > On Wed, Apr 30, 2008 at 05:13:11PM +0100, Martin (gzlist) wrote: > > > > Anyway, while I was looking at something more complicated on the error > > handling front (fixing it so the exceptions actually include

[xml] [PATCH] Python xpathEval method can leak

2008-05-21 Thread Martin (gzlist)
The python xpathEval convenience method on xmlCore leaks an xmlXPathContext if the expression is invalid or otherwise fails. Fix attached, with test that can probably be adapted to go in the tests dir. I'd like to do a real fix for the xpathEval2 thing just below, but it'd mean bindings changes, s

Re: [xml] XHTML DTD changes behaviour for empty tags

2008-05-29 Thread Martin (gzlist)
On 29/05/2008, Matthias Pigulla <[EMAIL PROTECTED]> wrote: > Dear all, > > could anybody please give me a hint why xmllint'ing the following two > files makes a difference regarding the handling of the empty tag? > It's printed as "" if the DTD is present. This is the XHTML1 specific compatibi

Re: [xml] root node with namespace

2008-06-21 Thread Martin (gzlist)
On 21/06/2008, dhk <[EMAIL PROTECTED]> wrote: > How is a root node created with a namespace? It seem that to make the root > node I'd need to have a namespace to use with xmlNewNode() and to make a > namespace I would need to call xmlNewNs() which requires a node as indicated > in the following tw

Re: [xml] Transfer-Encoding: chunked

2008-06-21 Thread Martin (gzlist)
On 21/06/2008, Daniel Veillard <[EMAIL PROTECTED]> wrote: > On Fri, Jun 20, 2008 at 07:13:55PM +1000, Vish Swami wrote: > > Does LibXML handle chunked data straight from the HTTP ? > > > No, and since libxml2 never try to use pipelining and > process all requests in a purely sequential way, the

Re: [xml] Set Default Namespace

2008-08-24 Thread Martin (gzlist)
On 22/08/2008, Niels Van Hoef <[EMAIL PROTECTED]> wrote: > > When generating an XML document I want to set a default namespace as > recommended on the namespaces page of the xmlsoft website. The > function "xmlNewNs" only allows me to set a namespace with a prefix > but not change/insert a defa

Re: [xml] Set Default Namespace

2008-08-25 Thread Martin (gzlist)
On 25/08/2008, Niels Van Hoef <[EMAIL PROTECTED]> wrote: > > I tried you suggestion even before posting this question but a small > test program yields the following results: > > > > element > This looks like you've passed a pointer to an empty string, rather than a null pointer. > Whe

Re: [xml] how to not save

2008-08-25 Thread Martin (gzlist)
On 25/08/2008, Boz <[EMAIL PROTECTED]> wrote: > 2008/8/25 Steven 黄 <[EMAIL PROTECTED]>: > > > I am a xml beginnner, and I am using libxml2 to edit some data for a system > > configuration file which doesn't contain (all elements > > in this xml are quite standard). Even Though adding this tag to

Re: [xml] how to not save

2008-08-26 Thread Martin (gzlist)
On 26/08/2008, Daniel Veillard <[EMAIL PROTECTED]> wrote: > On Mon, Aug 25, 2008 at 08:12:49PM +0100, Martin (gzlist) wrote: > > On 25/08/2008, Boz <[EMAIL PROTECTED]> wrote: > > > 2008/8/25 Steven 黄 <[EMAIL PROTECTED]>: > > > > > > >

[xml] [PATCH] XPath parsing QName conformance and memory leak fixes

2008-08-30 Thread Martin (gzlist)
The XPath parsing code, as exposed through xmlXPathCtxtCompile etc, has a couple of issues related to QName validity. Firstly, xmlXPathParseQName accepts ":name" as a synonym for "name" rather than treating it as an error. Secondly, xmlXPathCompFunctionCall has two early-return-on-error points that

Re: [xml] Processing information in a buffer to XML-document conversion

2008-09-07 Thread Martin (gzlist)
On 01/09/2008, Goran Hasse <[EMAIL PROTECTED]> wrote: > Hello all, > > Sorry if I missed a section in the FAQ where this should be explained... > > When a xmlParseMemory( ... ) i called a xml processing tag > is inserted > in the document. This is most anoying. Is it possible to disable this

Re: [xml] self-defined namespace nodes

2008-09-07 Thread Martin (gzlist)
On 05/09/2008, Roopesh Chander <[EMAIL PROTECTED]> wrote: > I need a bit of help with use of namespaces in the xml tree creation > interface (xmlNewDoc et al.). Specifically, I need to be able to create a an > xml root element in a self-defined namespace, like this: > > http://www.w3.org/HTML/1998

Re: [xml] API Documentation

2008-09-09 Thread Martin (gzlist)
On 04/09/2008, Beau Moore <[EMAIL PROTECTED]> wrote: > Hello, > > I am just wondering how to use the web site API reference at > www.xmlsoft.org. It seems rather hard to find the documentation for > particular API calls. For example, try to find the API reference for > xmlInitParser. In the alp

Re: [xml] libxml2 2.7.1 breaks XML serialisation of HTML trees

2008-09-09 Thread Martin (gzlist)
On 08/09/2008, Stefan Behnel <[EMAIL PROTECTED]> wrote: > Hi, > > there was a change in 2.7.1 (xmlsave.c, ~760) that prevents HTML documents > from being serialised in XML style... > > ... > > If the current behaviour is wanted, what's the future way of achieving > this *without* temporarily m

Re: [xml] libxml2 2.7.1 breaks XML serialisation of HTML trees

2008-09-26 Thread Martin (gzlist)
On 25/09/2008, Daniel Veillard <[EMAIL PROTECTED]> wrote: > > Stephan, Martin, > > could you check the enclosed patch ? I'm commiting it to SVN head too > but it's probably easier to review that way. I built trunk and had a play around, this handles my use case, thanks! A couple of concerns,

Re: [xml] xmlMemUsed() always returns 0 even when mem debug is activated

2008-12-20 Thread Martin (gzlist)
On 18/12/2008, apaxe...@gmail.com wrote: > Hello, > > I've been trying to evaluate the amount of memory allocated using > xmlMemUsed. A similar question was asked in 2004: > http://mail.gnome.org/archives/xml/2004-March/msg00232.html, > and Daniel replied that mem debug had to be activated. That's

Re: [xml] Possible to get XHTML output from HTMLparser?

2008-12-20 Thread Martin (gzlist)
On 19/12/2008, R. Steven Rainwater wrote: > I'm using libxml2 for an application that generates XHTML output. I've > recently needed to parse some nasty HTML tag soup input and incorporate > it into some of my pages. Libxml2's HTMLparser does a great job of > fixing up the bad HTML but it outpu

Re: [xml] Libxml2 disable-output-escaping ="yes" produces extra new-line ?

2009-01-10 Thread Martin (gzlist)
On 10/01/2009, Peter Schlaifer wrote: > xmlns:xsl="http://www.w3.org/1999/XSL/Transform";> > > > > goodbye > disable-output-escaping="yes"> > goodbye > > > > Produces this output: > > > goodbye > > goodbye Well, you are doing something wrong ou

Re: [xml] Libxml2 disable-output-escaping ="yes" produces extra new-line ?

2009-01-12 Thread Martin (gzlist)
Sorry, perhaps my message wasn't clear enough on how to resolve your issue. On 11/01/2009, Peter Schlaifer wrote: > > (By the way, the output is the same when the output method = > "xml") This is your problem, trying to work around it with d-o-e will not help. > C:\myTk\dd>xr apply xslbug x

Re: [xml] Both XML:LibXSLT output method = "text" and d-o-e broken

2009-01-12 Thread Martin (gzlist)
On 12/01/2009, peter_schlai...@ibi.com wrote: > I have just entered a bug report, #42332, on CPAN for this problem: > Martin, thanks for your help. Try the attached patch to your apply.pl to fix the problem with method="text" not working. Summary is the libxslt way to serialise a transform resu

Re: [xml] . vs self::node()

2009-01-13 Thread Martin (gzlist)
On 13/01/2009, Joachim Zobel wrote: > > self::node()[...@table:formula]//text:p > > is accepted, while > > @table:formula]//text:p > > gives me an "Invalid expression". Is this a bug or am I missing > something? It is an invalid expression, a predicate may not follow an abbreviated step.

Re: [xml] Newline at the end of output

2009-06-09 Thread Martin (gzlist)
On 09/06/2009, James Hart wrote: > I have a use case where I need to treat an xml document as a document > fragment, I won't get into the details of why exactly, but lets make the > assumption it is a valid use case for now. For your case, rather than doing: > xmlSaveDoc(saveCtxt, doc_); Inst

Re: [xml] Building libxml2 with static iconv.lib on windows

2009-06-20 Thread Martin (gzlist)
On 20/06/2009, john blair wrote: > > The __imp__ prefix means that it is still looking for iconv.dll > Can someone tell me how to build libxml2.lib with static iconv.lib? I'm not a build expert, but I'd need more details about the exact steps you're taking to have any chance of helping. What vers

Re: [xml] Building libxml2 with static iconv.lib on windows

2009-06-20 Thread Martin (gzlist)
2009/6/20 john blair : > > Thanks for the reply Martin. > I was able to build libxml2. The problem is I think it gets linked with > iconv.dll instead of the static iconv.lib. The sample program > (http://xmlsoft.org/examples/index.html#testWriter.c) when built gives the > __imp__ errors related

Re: [xml] storing/printing subtree

2009-09-30 Thread Martin (gzlist)
On 30/09/2009, Marius Pacha wrote: > > Here's what I was trying: > > xmlBuffer *buf = xmlBufferCreate(); > xmlSaveCtxt *subtree = xmlSaveToBuffer(buf,NULL,XML_SAVE_FORMAT); > int opResult = xmlSaveTree(subtree, cur); Forgetting to call xmlSaveClose?

[xml] [PATCH] Memory leak in xmlXPathEvalExpression()

2009-10-11 Thread Martin (gzlist)
A patch and some tests for this issue are attached. On 10/10/2009, Ralf Junker wrote: > The following psydo-code (is actually Pascal code; I do not have a C memory > checker available) produces a 5-12 byte memory leak (unable to tell the > exact number of bytes): Okay, I got a few of these a whi

Re: [xml] html parsing incomplete - bug?

2009-10-13 Thread Martin (gzlist)
On 13/10/2009, Stefan Behnel wrote: > > Lydia Patrovic wrote: >> Note the "main&20090924_2" attribute value, which can be interpreted >> as an >> unterminated entity. > > :) Nice little Freudian copy&paste quoting error. Here's the line from the > real 'HTML' file: > > > > Note the unescaped '&'

Re: [xml] [PATCH] Memory leak in xmlXPathEvalExpression()

2009-10-13 Thread Martin (gzlist)
On 12/10/2009, Daniel Veillard wrote: > > Thanks for the patch applied, I just had to fix the expected error mesages > set in the python test Gah, thanks for catching that. I have now finally got the libxml2 python bindings built (not the libxslt ones though) after fiddling with Igor's scripts a

Re: [xml] html parsing incomplete - bug?

2009-10-13 Thread Martin (gzlist)
On 13/10/2009, Stefan Behnel wrote: > > I wonder why the parser stops parsing here, though. Is '\0' explicitly > considered an invalid character in (broken) HTML, or is it really just the > usual C EOS slip? It's certainly invalid, though could be recoverable. In the various html versions: HTML

Re: [xml] multiple XPath evaluations on the same document

2009-10-15 Thread Martin (gzlist)
On 15/10/2009, IRENE SIPIKA wrote: > > Or is there a way for me to use the current 'element' node as the root > for the next xpath query? Set the 'node' member of the xmlXpathContext to the new context node: Or with the python bindings,

Re: [xml] xmlReadFile(...) crashing on 2nd time around

2009-12-10 Thread Martin (gzlist)
On 10/12/2009, Andrew Hartley wrote: > > This is my code to read an XML file, which works fine the 1st time around, > but crashes the 2nd time around. I must be not calling a required library > function to tidy up and would appreciate if someone could advise on what I > should do. ... > x

Re: [xml] [xslt] HTML vs. XHTML: different output when including a file with \r\n [WAS: xmllint vs. xsltproc: different output when including a file with \r\n]

2010-02-01 Thread Martin (gzlist)
On 01/02/2010, Daniel Veillard wrote: > > Not a bug. I don't know the XInclude spec, but reading the bug report: When a text file is included with http://www.w3.org/2001/XInclude"/> and the text file uses \r\n end line markers

Re: [xml] Using Xpath with default namespace and null prefix

2010-02-08 Thread Martin (gzlist)
On 08/02/2010, François Delyon wrote: > > By the way (prefix and namespace), I have a request about exslt. > Some useful functions like exsltStrXpathCtxtRegister have been added. > But they require a non-null prefix, which is not convenient in my case. Can you explain exaclty how you'd use this f

Re: [xml] Using Xpath with default namespace and null prefix

2010-02-10 Thread Martin (gzlist)
On 09/02/2010, François Delyon wrote: > > exsltStrXpathCtxtRegister(ctxt, NULL) must occur once when I create > the context. > But the NSregistrations and the Xpath evaluations are up to the users > of my application. Okay, that version makes some sense. I'm not sure whether it's a win for users

Re: [xml] Add new pretty-printing and sorting options for saving XML

2010-10-06 Thread Martin (gzlist)
On 05/10/2010, Adam Spragg wrote: > > The idea of these options is to be able to combine them to produce a > "canonical", nearly line-oriented format for XML files. Are you familiar with the "Canonical XML" W3C Recommendation and its implementation in libxml2?

Re: [xml] How to process errors from xmlReadMemory in multi-threaded context?

2010-11-23 Thread Martin (gzlist)
On 22/11/2010, Yuri wrote: > I have many threads that call this function, they are all unaware of > each other. > There is no context object that is passed to it, so no error handler can > be attached to local context. Use xmlCtxtReadMemory instead? Then you can have an xmlParserCtxt per thread.

Re: [xml] Are there any chance to keep single quotes as attribute text boundary?

2010-12-12 Thread Martin (gzlist)
On 11/12/2010, Nikolay Shaplov wrote: > > This is not diff safely :-/ > > Are there any chance to keep formatting as it were, at least for > elements that were not changed during tree elements manipulation? May > be there is some parsing options I do not know of? This kind of formatting is not in

Re: [xml] xpath evaluation issue on 2.9.0

2013-03-13 Thread Martin (gzlist)
On 12/03/2013, Mike Dalessio wrote: > I've opened a bug report here: > > https://bugzilla.gnome.org/show_bug.cgi?id=695699 > > The summary is that behavior of `position()` under 2.9.0 is different than > under 2.8.0 and other major XML libraries (e.g., javax.xml.xpath). The 2.9 behaviour look

Re: [xml] Stepping down

2021-07-22 Thread Martin (gzlist)
Thank you Nick for being a good steward and being responsive to the community. There's no interest from Redhat or such around providing ongoing support for libxml2? Martin On Thu, 22 Jul 2021 at 12:23, Nick Wellnhofer via xml wrote: > > I never really asked for it but in the last years I became

Re: [xml] libxml2 and libxslt Python3.5 Windows installation

2018-05-09 Thread Martin (gzlist) via xml
On 08/05/2018, Nikolay Lazarov wrote: > Hi, > > I have Python3.5 and have to use lxml. Their page > http://lxml.de/installation.html#requirements says that it requires libxml2 > and libxslt. Correction, it states: """ Unless you are using a static binary distribution (e.g. from a Windows binary