Re: [xml] Do patterns support namespaces ?

2011-10-24 Thread Joachim Zobel
On Sun, 2011-10-23 at 23:49 +0200, Michael Ludwig wrote: There is a namespace prefix in your pattern that cannot be bound to a namespace because you didn't declare any. Seems thats it. My code did not pass the namespace (and works since it does) and most likely my xmllint example has a similiar

Re: [xml] Do patterns support namespaces ?

2011-10-24 Thread Joachim Zobel
On Mon, 2011-10-24 at 18:14 +0200, Michael Ludwig wrote: In your example, you're declaring (but not using) it on the doc; but that doesn't automagically provide the pattern to the bit of code that is instructed to compile the pattern. You are correct. My code (the original problem) works now,

Re: [xml] Do patterns support namespaces ?

2011-10-23 Thread Joachim Zobel
On Sun, 2011-10-23 at 23:49 +0200, Michael Ludwig wrote: There is a namespace prefix in your pattern that cannot be bound to a namespace because you didn't declare any. Yeah, missed that. jo@vostro:~$ echo '?xml version=1.0?dummy xmlns:a=test/' | xmllint --pattern //a:b - Pattern //a:b failed

[xml] XPath attribute namespace pattern

2011-10-05 Thread Joachim Zobel
Hi The expression pattern = //*[@*[namespace-uri()='http://xml.zope.org/namespaces/i18n']]; fails to compile with patternc = xmlPatterncompile(pattern, NULL, XML_PATTERN_XPATH , NULL); Any hints on why? Thanks, Joachim ___ xml mailing list,

Re: [xml] XPath attribute namespace pattern

2011-10-05 Thread Joachim Zobel
Hi. This must be some problem in my source code. My test with : xmllint --xpath //*[@*[namespace-uri()='http://xml.zope.org/namespaces/i18n']] test.html outputs p i18n:translate=This is the i18n test page./p I'll check the sources of xmllint to see what I am doing wrong. Sincerely, Joachim

[xml] How does xmlReader prevent tree building

2011-06-15 Thread Joachim Zobel
Hi. I have been reading xmlreader.c to find out how the reader does parsing without tree building. However I did not find out, how tree building is prevented. I would do a ctxt-node = NULL; after a StartElement event and something similar for other events. Thats not what the reader does. Any

[xml] xmlReader and HTML

2011-06-10 Thread Joachim Zobel
Hi. It looks like the xmlReader parser is able to parse HTML. At least it accepts doctype at document start. It does however behave differently than the SAX/DOM HTML parser. For example it wants closing tags for META and LI. To what extend does xmlReader support HTML? I think a lot of things

[xml] Problem parsing MSWord HTML

2010-02-19 Thread Joachim Zobel
Hi. I am trying to parse HTML generated by MS Word. Although this starts with a html ... xmlns:o=urn:schemas-microsoft-com:office:office The parser complains about Tag o:p invalid when I encounters such a tag? Why is this? Thanks, Joachim ___

[xml] HTML fragments

2010-01-29 Thread Joachim Zobel
Hi. I am using libXML2 (Perl module) to parse HTML fragments, which it kindly does. Unfortunally it adds enclosing html and body tags. This is annoying for me since the fragment later is included in the middle of another document. How can I turn this off? Thx, Joachim

[xml] . vs self::node()

2009-01-13 Thread Joachim Zobel
Hi. I am using Libxml (2.6.32.dfsg-5 from debian) from the perl module. If I am running a find in the context of a previously matched node 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

Re: [xml] Per parser xmlGcMemSetup

2007-05-06 Thread Joachim Zobel
Am Sonntag, den 06.05.2007, 03:34 -0400 schrieb Daniel Veillard: But mod_i18n should know it is operating on top of libxml2 parser, so why doesn't it use the libxml2 allocation routines ? The SAX interfaces at the C level are really parser specific, and libxml2 SAX2 have been heavilly modified

[xml] Per parser xmlGcMemSetup

2007-05-05 Thread Joachim Zobel
Hi. I have an apache module that uses libxml2. I have found a (potential, no reports yet) problem with its usage of xmlGcMemSetup. I need to call this for my module to work correctly. If there are other modules using libxml2 (mod_php does) and they call xmlGcMemSetup, one of the modules will stop

Re: [xml] Per parser xmlGcMemSetup

2007-05-05 Thread Joachim Zobel
Am Samstag, den 05.05.2007, 07:06 -0400 schrieb Rob Richards: - Try not to use globals. Many functions have been added over the years that allow settings/options to be passed directly eliminating the need to use globals. I would prefer not to use globals. The problem I have to deal with is

Re: [xml] Per parser xmlGcMemSetup

2007-05-05 Thread Joachim Zobel
Am Samstag, den 05.05.2007, 15:28 -0400 schrieb Daniel Veillard: if you're calling the callbacks from libxml2 just to build a tree it's bad, either use one of the parsers or build the tree with the tree API. Other uses are not suported, in the sense that I may break randomly how the

[xml] mod_xml2 has been realeased

2007-04-21 Thread Joachim Zobel
Hi. I have realeased an early beta of mod_xml2 (http://www.heute-morgen.de/modules/mod_xml2/). This integrates libxml2 with the apache filtering eingine (see http://www.cs.virginia.edu/~jcw5q/talks/apache/bucketbrigades.ac2002.pdf for an overview). A special SAX bucket type is implemented that

[xml] Problem with partial documents

2007-03-19 Thread Joachim Zobel
Hi. I am filtering a stream of sax events. If I encounter certain start tags I start passing the events to the libxml2 through the SAX2 functions. To start a valid document I add an XML decl. event and I add all namespaces that are currently in use to the root node sax event. When the end event

Re: [xml] Reinjecting SAX events

2007-01-12 Thread Joachim Zobel
Am Donnerstag, den 11.01.2007, 20:18 +0100 schrieb Joachim Zobel: // Since we will not do any SAX parsing, we give neither // handler nor context. fctx-parser = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, NULL); Just found that the problem is a bug on my side, xmlCreatePushParserCtxt

[xml] Reinjecting SAX events

2007-01-11 Thread Joachim Zobel
Hi. I want to use libxml2 to build a tree from existing SAX2 events. I create a parser context with // Since we will not do any SAX parsing, we give neither // handler nor context. fctx-parser = xmlCreatePushParserCtxt(NULL, NULL, NULL, 0, NULL); but get a segfault when calling

[xml] Do I need to pop xmlStreamPushAttr

2006-10-19 Thread Joachim Zobel
Hi. Subject almost says it. Do I need to pop the xmlStreamPushAttr or do I only need to pop the xmlStreamPush'es? Thx, Joachim ___ xml mailing list, project page http://xmlsoft.org/ xml@gnome.org http://mail.gnome.org/mailman/listinfo/xml

Re: [xml] Interfacing with libxml2

2006-10-01 Thread Joachim Zobel
Am Freitag, den 29.09.2006, 09:13 -0400 schrieb Daniel Veillard: On Thu, Sep 28, 2006 at 10:07:30PM +0200, Joachim Zobel wrote: look at the entry points in SAX2.c http://xmlsoft.org/html/libxml-SAX2.html but I don't think anyone ever tried to plug libxml2 on top of expat and it may

[xml] Interfacing with libxml2

2006-09-29 Thread Joachim Zobel
Hi. I am currently working on an apache module (mod_expat, http://www.heute-morgen.de/modules/mod_expat/), that turns xml into a stream of sax buckets (a double linked list of SAX events more or less) that can be processed by apache filter modules. libxml2 does however have lots of nice stuff