1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2024-10-26 20:25:14 +03:00
Commit Graph

51 Commits

Author SHA1 Message Date
Nick Wellnhofer
20c60886e4 Fix typos
Resolves #133.
2020-03-08 17:41:53 +01:00
Ron Angeles
b3e488b0d9 Add methods for python3 iterator
xmlCoreDepthFirstItertor and xmlCoreBreadthFirstItertr only
implement a python2-compatible iterator interface. The next()
method has been changed to __next__(). An alias has been
defined to keep python2 compatibility.
2014-10-03 17:01:24 +08:00
Daniel Veillard
bf4a8f0ea8 Fix python bindings with versions older than 2.7
Need fixing on the Capsule usage, the lack of PyBytes,
lack of io module and the way to access exception details.
2013-04-02 10:27:57 +08:00
Daniel Veillard
87f3287d9b Fix tree iterators broken by 2to3 script 2013-04-01 13:33:42 +08:00
Daniel Veillard
6f18465189 A few more fixes for python 3 affecting libxml2.py
need a few changes to the generator and the libxml.py stub
2013-03-30 22:33:06 +08:00
Daniel Veillard
3cb1ae26ec First pass at starting porting to python3 2013-03-30 22:33:06 +08:00
Alexey Neyman
48da90bc4a Python binding for xmlRegisterInputCallback
It is possible to make xmlIO handle any protocol by means of
xmlRegisterInputCallback(). However, that function is currently only
available in C API. So, the natural solution seems to be implementing Python
bindings for the xmlRegisterInputCallback.

* python/generator.py: skip xmlPopInputCallbacks
* python/libxml.c python/libxml.py python/libxml_wrap.h: implement the
  wrappers
* python/tests/input_callback.py python/tests/Makefile.am: also add a test case
2013-02-25 15:54:25 +08:00
Alexey Neyman
e32ceb93f4 Python bindings: DOM casts everything to xmlNode
I noticed another issue with Python bindings of libxml: the access methods do
not cast the pointers to specific classes such as xmlDtd, xmlEntityDecl, etc.
For example, with the following document:

<?xml version="1.0"?>
<!DOCTYPE root [<!ELEMENT root EMPTY>]>
<root/>

the following script:

import libxml2
doc = libxml2.readFile("c.xml", None, libxml2.XML_PARSE_DTDLOAD)
print repr(doc.children)

prints:

<xmlNode (root) object at 0xb74963ec>

With properly cast nodes, it outputs the following:

<xmlDtd (root) object at 0xb746352c>

The latter object (xmlDtd) enables one to use DTD-specific methods such as
debugDumpDTD(), copyDTD(), and so on.
2013-02-21 16:00:03 +08:00
Leonid Evdokimov
147687f108 544910 typo: "renciliateNs"
* python/libxml.py: typo on a comment
2009-08-24 14:08:43 +02:00
William M. Brack
7a12e57b7f fixed tab problem with patch from Andreas Hanke (bug #408626)
* python/libxml.py: fixed tab problem with patch from Andreas Hanke (bug #408626)

svn path=/trunk/; revision=3586
2007-02-16 17:11:09 +00:00
Daniel Veillard
3b6acc93bf apparently id() sometimes generate negative values and %X outputs -XXXX
* python/generator.py python/libxml.py: apparently id() sometimes
  generate negative values and %X outputs -XXXX :-(
Daniel
2006-12-14 15:49:41 +00:00
Daniel Veillard
46459066c5 applied patch from Ross Reedstrom, Brian West and Stefan Anca to add
* python/libxml.py python/types.c: applied patch from Ross Reedstrom,
  Brian West and Stefan Anca to add XPointer suport to the Python bindings
Daniel
2006-10-10 08:40:04 +00:00
William M. Brack
40cca61fc1 Added code submitted by Andreas Pakulat to provide node equality,
* python/libxml.c, python/libxml.py, python/tests/compareNodes.py,
  python/tests/Makefile.am:
  Added code submitted by Andreas Pakulat to provide node
  equality, inequality and hash functions, plus a single
  test program to check the functions (bugs 345779 + 345961).
2006-06-26 18:25:40 +00:00
Daniel Veillard
745648bca8 remove a tab, as pointed out on IRC Daniel
* python/libxml2.py: remove a tab, as pointed out on IRC
Daniel
2006-02-27 09:59:30 +00:00
Daniel Veillard
eaccdc6554 remove warnings to stdout patch from Nic Ferrier Daniel
* python/libxml.py: remove warnings to stdout patch from Nic Ferrier
Daniel
2005-10-27 14:10:52 +00:00
Daniel Veillard
f9cf6f5a01 applied patch from Brent Hendricks adding namespace removal at the python
* python/libxml.c python/libxml.py: applied patch from Brent Hendricks
  adding namespace removal at the python level #300209
* python/tests/Makefile.am python/tests/nsdel.py: added the regression
  test
Daniel
2005-04-12 01:02:29 +00:00
Daniel Veillard
0e460da346 another patch from Brent Hendricks to add new handlers with the various
* python/generator.py python/libxml.py: another patch from Brent
  Hendricks to add new handlers with the various validity contexts
* python/tests/Makefile.am python/tests/validDTD.py
  python/tests/validRNG.py python/tests/validSchemas.py: also
  added the regression tests he provided
Daniel
2005-03-30 22:47:10 +00:00
Daniel Veillard
1cd4dae166 make __str__ call serialize() on nodes, c.f. bug #157872 Daniel
* python/libxml.py: make __str__ call serialize() on nodes, c.f.
  bug #157872
Daniel
2005-01-15 17:45:28 +00:00
Daniel Veillard
a81355ef66 applied patch from Malcolm Tredinnick fixing python exception hierarchy
* python/libxml.py: applied patch from Malcolm Tredinnick fixing
  python exception hierarchy #139824
Daniel
2004-09-28 11:08:27 +00:00
Daniel Veillard
1f8658a76f Dodji pointed out a bug in xmlGetNodePath() applied patch from Albert Chin
* tree.c: Dodji pointed out a bug in xmlGetNodePath()
* xmlcatalog.c: applied patch from Albert Chin to add a
  --no-super-update option to xmlcatalog see #145461
  and another patch also from Albert Chin to not crash
  on -sgml --del without args see #145462
* Makefile.am: applied another patch from Albert Chin to
  fix a problem with diff on Solaris #145511
* xmlstring.c: fix xmlCheckUTF8() according to the suggestion
  in bug #148115
* python/libxml.py: apply fix from Marc-Antoine Parent about
  the errors in libxml(2).py on the node wrapper #135547
Daniel
2004-08-14 21:46:31 +00:00
William M. Brack
37e63946dc ran 'expand' on the file to get rid of mixture of tabs and spaces (bug
* python/libxml.py: ran 'expand' on the file to get rid of mixture
  of tabs and spaces (bug 147424)
2004-07-12 16:27:37 +00:00
Daniel Veillard
f93a866079 applied patch from Stphane Bidoul to fix some Python bindings
* python/libxml.c python/generator.py python/libxml.py
  python/libxml2-python-api.xml python/libxml2class.txt:
  applied patch from Stphane Bidoul to fix some Python bindings
  initialization, then had to change the parserCleanup()
  to handle memory released there.
* xmlmemory.c: added more debugging comments.
Daniel
2004-07-01 12:56:30 +00:00
Daniel Veillard
d5e198ad45 applied patch from Anthony Carrico providing Python bindings for the
* python/libxml.c python/libxml.py: applied patch from Anthony Carrico
  providing Python bindings for the Canonicalization C14N support.
Daniel
2004-03-09 09:03:28 +00:00
Daniel Veillard
87ab1c1298 fixed bug #129489, propagation of parsing flags in entities. improved the
* parser.c: fixed bug #129489, propagation of parsing flags
  in entities.
* parser.c xmlreader.c: improved the comments of parsing options
Daniel
2003-12-21 13:01:56 +00:00
Daniel Veillard
f88d8cf9f1 tried to fix the problems reported in bug #126735 fixed again some problem
* python/libxml.py: tried to fix the problems reported in
  bug #126735
* xpath.c SAX2.c error.c parser.c valid.c include/libxml/xmlerror.h:
  fixed again some problem trying to use the structured error
  handlers, c.f. bug #126735
* result/VC/ElementValid: tiny change due to the fix
Daniel
2003-12-08 10:25:02 +00:00
Daniel Veillard
85bb5b08df oops forgot to modify/commit the new code. Daniel
* python/libxml.py: oops forgot to modify/commit the new code.
Daniel
2003-12-04 14:12:05 +00:00
William M. Brack
1d75c8a822 fixed warning message from IRIX (bug 125182) removed tabs, replaced with
* xmllint.c: fixed warning message from IRIX (bug 125182)
* python/libxml.py: removed tabs, replaced with spaces
  (bug 125572)
2003-10-27 13:48:16 +00:00
Daniel Veillard
5439624bd9 applied patch from Brent M Hendricks adding binding for xmlCatalogAddLocal
* python/libxml.c python/libxml.py: applied patch from
  Brent M Hendricks adding binding for xmlCatalogAddLocal
Daniel
2003-04-23 07:36:50 +00:00
Daniel Veillard
417be3ae08 patch from Stphane Bidoul for better per context error message APIs
* xmlreader.c python/drv_libxml2.py python/generator.py
  python/libxml.c python/libxml.py python/libxml_wrap.h
  python/types.c: patch from Stphane Bidoul for better per
  context error message APIs
* python/tests/ctxterror.py python/tests/readererr.py:
  update of the tests
Daniel
2003-01-20 21:26:34 +00:00
Daniel Veillard
26f70269c8 applied a patch from Stphane Bidoul to allow per XMLtextReader error and
* xmlreader.c include/libxml/xmlreader.h python/generator.py
  python/libxml.c python/libxml.py win32/libxml2.def.src: applied
  a patch from Stphane Bidoul to allow per XMLtextReader error
  and warning handling
* python/tests/Makefile.am python/tests/readererr.py: adding the
  specific regression test
Daniel
2003-01-16 22:45:08 +00:00
Daniel Veillard
e6227e0549 applied and fixed a patch from Stephane Bibould to provide per parser
* python/generator.py python/libxml.c python/libxml.py
  python/libxml_wrap.h python/types.c: applied and fixed a patch
  from Stephane Bibould to provide per parser error handlers at the
  Python level.
* python/tests/Makefile.am python/tests/ctxterror.py: added a
  regression test for it.
Daniel
2003-01-14 11:42:39 +00:00
Daniel Veillard
3e20a29213 fixed bug #102181 by applying the suggested change and fixing the
* python/libxml.py python/libxml.c python/libxml2-python-api.xml:
  fixed bug #102181 by applying the suggested change and fixing
  the generation/registration problem.
Daniel
2003-01-10 13:14:40 +00:00
Daniel Veillard
51a447a578 integrated the Python 2.2 optimizations from Hannu Krosing, while
* python/libxml.py: integrated the Python 2.2 optimizations
  from Hannu Krosing, while maintaining compatibility with
  1.5 and 2.1
Daniel
2003-01-04 19:42:46 +00:00
Daniel Veillard
e59494fa54 a bit of cleanup small fix more work on the XmlTextReader tutorial a few
* xmllint.c: a bit of cleanup
* xmlreader.c: small fix
* doc/xmlreader.html: more work on the XmlTextReader tutorial
* python/libxml.py: a few fixes pointed out by Hannu Krosing
Daniel
2003-01-04 16:35:29 +00:00
Daniel Veillard
e18fc185fa extended the XmlTextReader API a bit, addding accessors for the current
* xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml:
  extended the XmlTextReader API a bit, addding accessors for
  the current doc and node, and an entity substitution mode for
  the parser.
* python/libxml.py python/libxml2class.txt: related updates
* python/tests/Makefile.am python/tests/reader.py
  python/tests/reader2.py python/tests/reader3.py: updated a bit
  the old tests and added a new one to test the entities handling
Daniel
2002-12-28 22:56:33 +00:00
Daniel Veillard
f25b4cab44 added a few predefined xmlTextReader parser configuration values. Daniel
* python/libxml.py: added a few predefined xmlTextReader parser
  configuration values.
Daniel
2002-12-27 15:18:35 +00:00
Daniel Veillard
c6d4a933f0 updated the python bindings, added code for easier File I/O, and the
* python/generator.py python/libxml.c python/libxml.py
  python/libxml2-python-api.xml python/libxml2class.txt
  python/libxml_wrap.h python/types.c: updated the python
  bindings, added code for easier File I/O, and the ability to
  define a resolver from Python fixing bug #91635
* python/tests/Makefile.am python/tests/inbuf.py
  python/tests/outbuf.py python/tests/pushSAXhtml.py
  python/tests/resolver.py python/tests/serialize.py: updated
  and augmented the set of Python tests.
Daniel
2002-09-12 15:00:57 +00:00
Daniel Veillard
12171c4db1 Fixed serialize and saveTo comment, Daniel 2002-05-29 14:43:10 +00:00
Daniel Veillard
f742d34179 fixed xmlReconciliateNs(), added a Python test/example for inter-document
* tree.c python/tests/Makefile.am python/tests/cutnpaste.py:
  fixed xmlReconciliateNs(), added a Python test/example for
  inter-document cut'n paste
* python/libxml.py: fixed node.doc on document nodes and added
  xpathEval() onto node objects
Daniel
2002-03-07 00:05:35 +00:00
Daniel Veillard
1e77438da7 fix bug #72490 added methods serialize() and saveTo() to all node
* tree.c: fix bug #72490
* python/libxml.c python/libxml.py: added methods serialize()
  and saveTo() to all node elements.
Daniel
2002-03-06 17:35:40 +00:00
Daniel Veillard
8d24cc1898 make sure SAX endDocument is always called as this could result in a
* parser.c: make sure SAX endDocument is always called as
  this could result in a Python memory leak otherwise (it's
  used to decrement ref-counting)
* python/generator.py python/libxml.c python/libxml.py
  python/libxml2-python-api.xml python/libxml2class.txt
  python/tests/error.py python/tests/xpath.py: implemented
  the suggestions made by Gary Benson and extended the tests
  to match it.
Daniel
2002-03-05 15:41:29 +00:00
Daniel Veillard
797a565a2f couple of bug fixes Daniel
* python/libxml.c: couple of bug fixes
Daniel
2002-02-12 13:46:21 +00:00
Daniel Veillard
01a6d4170c removed tabs and used spaces. Daniel
* python/*.py: removed tabs and used spaces.
Daniel
2002-02-11 18:42:20 +00:00
Daniel Veillard
5e5c2d0a93 Justin Fletcher found some parts of the code needing cleanup Fixed the
* parserInternals.c valid.c: Justin Fletcher found some parts
  of the code needing cleanup
* libxml.spec.in python/Makefile.am python/generator.py
  python/libxml.c python/libxml.py: Fixed the python Makefiles
  corrected a bug showing up on ia64, changed the name of the
  python internal module too
Daniel
2002-02-09 18:03:01 +00:00
Daniel Veillard
3ce5257b29 cleanup added class for parser context, added first cut for push mode
* python/Makefile.am python/types.c: cleanup
* python/libxml.c python/libxml.py python/libxml_wrap.h
  python/generator.py python/libxml2-python-api.xml
  python/libxml2class.txt: added class for parser context, added
  first cut for push mode support. Added a framework to generate
  accessors functions.
* python/tests/Makefile.am python/tests/push.py: added a push
  test
Daniel
2002-02-03 15:08:05 +00:00
Daniel Veillard
cfb0546244 fixed a small bug a bit of cleanup. Daniel
* python/Makefile.am python/TODO python/libxml.py: fixed a small
  bug a bit of cleanup.
Daniel
2002-02-02 23:18:22 +00:00
Daniel Veillard
7fd7a94aa8 fixed a stupid bug when renaming a function Daniel
* python/libxml.c python/libxml.py: fixed a stupid bug when renaming
  a function
Daniel
2002-02-02 12:19:46 +00:00
Daniel Veillard
a7340c830e more work, now able to extend the XPath interpreter with functions written
* python/Makefile.am python/generator.py python/libxml.c
  python/libxml.py: more work, now able to extend the
  XPath interpreter with functions written in python.
Daniel
2002-02-01 17:56:45 +00:00
Daniel Veillard
1971ee2698 minor optimization more work on the python bindings, they now support
* xpath.c: minor optimization
* python/generator.py python/libxml.c python/libxml.py
  python/libxml_wrap.h: more work on the python bindings,
  they now support XPath and there is no evident leak
Daniel
2002-01-31 20:29:19 +00:00
Daniel Veillard
36ed5290a2 more work on the python bindings generator. Daniel
* python/generator.py python/libxml.c python/libxml.py:
  more work on the python bindings generator.
Daniel
2002-01-30 23:49:06 +00:00