Re: [xml] How to determine document encoding

2005-01-24 Thread Daniel Veillard
On Mon, Jan 24, 2005 at 02:17:17PM +0100, Erik F. Andersen wrote:
> I have a SOAP document that contains another SOAP document
> as a node value. When I extract the embedded SOAP document
> (xmlnode->children->contents) this will always be in UTF-8 because that's
> how xmllib encodes contents internally.

  All strings returned from the API will be in UTF-8, yes definitely.

> My problem is now how to decode the contents so that I can load it
> via xmlParseDoc?

  Use xmlReadxxx APIs and provide the encoding. In general use the new
APIs based on xmlReadxxx instead of the xmlParsexxx ones.

> In other words, how can I read the encoding attribute in 
> prior to actually loading the document?

  You should not do this, this is a very flawed design.

> I tried loading the UTF-8 encoded document and this can lead to some
> strange results because the document is actually ISO-8859-1 encoded
> in the first place. Of course I can just decode the document by calling
> UTF8Toisolat1 directly but this is not a very generic solution to my
> problem...

  Drop the encoding in the first line it will be UTF-8 in the string you 
read from the libxml2 API.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] How to determine document encoding

2005-01-24 Thread Daniel Veillard
On Tue, Jan 25, 2005 at 10:02:47PM +1300, BJ Chippindale wrote:
[-- Attachment #1 --]
[-- Type: text/html, Encoding: 7bit, Size: 1.9K --]

[-- text/html is unsupported (use 'v' to view this part) --]

[-- Attachment #2 --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.2K --]

I don't read HTML only mail...

Daniel


-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] How to determine document encoding

2005-01-25 Thread Daniel Veillard
On Wed, Jan 26, 2005 at 03:29:48AM +1300, BJ Chippindale wrote:
> Doesn't this limit the efficacy and universality of XML?   You can't 
> count on
> the sender actually putting the encoding where it belongs, or even 
> including one
> at all.

  I don't understand what you're talking about.
The part of the spec covering encoding detection is 
  http://www.w3.org/TR/REC-xml/#sec-guessing
have you read it ? 

The topic was embedding an XML instance with its own encoding into
another instance. An XML entity can be of only one encoding flagged
at the beginning, which is a very sound principle. Embedding an
XML instance within another as character data is just refusing to
use the extensibility of XML and a fairly broken design. This is
my point of view on the subject of the initial post.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] XSD validation example needed

2005-01-25 Thread Daniel Veillard
On Tue, Jan 25, 2005 at 12:31:28PM +0100, Samuel Díaz García wrote:
> I had looking for an example in documents and excample sources without any 
> success. 
> 
> This are the problems:
>  1) I have a downloaded XML with an external reference to a XSD schema and 
> I need to know if the XML is valid or not.
>  2) Another case could be to have the XSD file in local to perform the 
> validation against it. 
> 
> I need to know what API functions and in what order use them in the two 
> exposed cases. 
> 
> Thanks for your help & sorry for my english. 

  API Doc
  http://xmlsoft.org/html/libxml-xmlschemas.html
  C Code example
  testSchemas.c in the source distribution

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] XSD validation example needed

2005-01-25 Thread Daniel Veillard
On Tue, Jan 25, 2005 at 04:08:42PM +0100, Samuel Díaz García wrote:
> Well, I found the testschema.c file, thanks, but ...
> ... if my ROOT element has an schema asigned using this directive into 
> the XML file?
> http://www.w3.org/2001/XMLSchema-instance"; 
> xsi:noNamespaceSchemaLocation="">
> How can I validate it?

  If you trust the XML File content, why do you validate it ?
  If you don't trust the XML File content, how can you trust that
specific attribute value ?
  A Schemas/DTD is a contract between a provider and consumer,
I would never blindly trust a contract coming with the product, that's
why I don't believe in the whole xsi (instance schemas informations).

 Kasimier added support for it in September last year. I think you
create a schemas validation context with a NULL argument to
xmlSchemaNewValidCtxt() and try to validate the xmlDocPtr with that.

> Taking the attrib value first, downloading and validate?

 That's one way too, yes.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] What does xmlCtxtReadFile() validate?

2005-01-25 Thread Daniel Veillard
On Tue, Jan 25, 2005 at 06:26:56PM +0100, Ronny Seemann wrote:
> Hello
> 
> I work with the libxml2 version 2.6.11 and my plattform is embedded linux.
> I want to validate a xml with his dtd. The example parse2.c use the function 
> xmlCtxtReadFile() to validate the xml. Does this function really validates 
> the 
> File? 

   xmlCtxtReadFile
http://xmlsoft.org/html/libxml-parser.html#xmlCtxtReadFile
options:a combination of xmlParserOption
http://xmlsoft.org/html/libxml-parser.html#xmlParserOption
XML_PARSE_DTDVALID = 16 : validate with the DTD

 With that option xmlCtxtReadFile() will attempt DTD validation of the
instance.

> Are there changes ( for xmlCtxtReadFile() )between the version 2.6.11 and the 
> latest one?

  If there was no changes I would not have released a new version. Sorry
I never dig out ancien versions to check. You can check new versions,
it's your side of the job to check it c.f.:
   http://xmlsoft.org/bugs.html

> Can i actual use xmlCtxtReadFile() for dtd-validation or should i better use 

  yes

> another function (e.g. xmlValidateDtd () of the modul valid)?

  no. xmlValidateDtd is not the validation as defined by the XML REC it
does not handle the internal subset. On the other hand you have control
over what DTD is used.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] setting URL for xmlRelaxNGParserCtxt?

2005-01-25 Thread Daniel Veillard
On Tue, Jan 25, 2005 at 08:14:22PM +0100, Martijn Faassen wrote:
> Hi there,
> 
> In my lxml Python binding for libxml2, I was using the following 
> approach to construct a Relax NG schemas:
> 
> xmlDocPtr* doc = ...
> parser_ctxt = xmlRelaxNGNewDocParserCtxt(doc)
> 
> unfortunately, this got me into trouble with Relax NG schemas that use 
> the 'include' statement. They try to load the files to be included, but 
> have no idea where to look, as this information is lost.
> 
> Glancing through the source, it seems like the only way to make the 
> 'include' statement work is to use xmlRelaxNGNewParserCtxt, which takes 
> a URL.

   Wrong. How did you built "doc" ?  If it's from a memory string you can
still define the base for that document by providing the URL argument
of xmlReadMemory().

> Would it be useful to have a way to supply this URL to an existing 
> xmlRelaxNGParserCtxtPtr? Something like:

  no the base has to be set in the document. Since that part is just
described by '...' in your mail there is little more indications I can
provide.

> void xmlRelaxNGSetURL(xmlRelaxNGNParserCtxtPtr* ctxt, const char* URL)

  The base is a property of the document, not of the relax-NG transformation
compilation, this is really the wrong approach.

> I imagine the same issues come up when using XSLT that tries to include 
> or import external stylesheets.

  yes the base is *in* the document.
  xmlNodeSetBase(xmlNodePtr cur, const xmlChar* uri)
to be called on your document. But it should really be there as the result
of parsing.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] setting URL for xmlRelaxNGParserCtxt?

2005-01-25 Thread Daniel Veillard
On Wed, Jan 26, 2005 at 12:07:50AM +0100, Martijn Faassen wrote:
> Daniel Veillard wrote:
> >  no the base has to be set in the document. Since that part is just
> >described by '...' in your mail there is little more indications I can
> >provide.
> 
> Interesting. This is how a doc typically get parsed now:
> 
> pctxt = xmlNewParserCtxt()
> .. (share dictionaries)
> result = xmlCtxtReadFile(pctxt, filename,
>NULL, _getParseOptions())

   Okay, looks good.
One note though, I'm using dictionnaries more and more intensively those
days, so keeping a single dictionnary for everything, while it clearly
speed-up processing may grow quite a bit for example as you process random
documents. It might be a good idea to "sometimes" reset the dictionnary
to avoid explosion, for example for all the ID strings ever processed 
by the program.

> the other approach is to create a doc with xmlNewDoc().

  Okay then use xmlNodeSetBase() there if you need to make URI-References
from them.

> Thinking it through, it's quite possible that I often have a node being 
> passed from a doc that's parsed into a doc that's created with 
> xmlNewDoc(). I will investigate whether that happens here, and whether I 
> can pass along the URL somehow when it happens.

  Doesn't sound trivial...

> Good, good. I have an idea of what to do to fix the issue. Thanks for 
> the hints and my apologies for the misunderstanding.

  No problem :-)

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] newbie: Python: attribute value from XPath

2005-01-26 Thread Daniel Veillard
On Tue, Jan 25, 2005 at 10:12:19PM -0500, Jason Jesso wrote:
> How do you get an attribute value from an xmlNode that you get from a 
> resulting XPath result set?
> 
> e.g. xpath =  //form/input
> 
> 
>  
> 
> 
> 
> 
> This gives me several "input" nodes as a result set, but I want to get the 
> value of the name attribute.
> 
> I can't seem to find anything in the Python libxml2.py to give me this value.

  node.prop("name")

libxml2.py: line 3235
def prop(self, name):
"""Search and get the value of an attribute associated to a
   node This does the entity substitution. This function
   looks in DTD attribute declaration for #FIXED or default
   declaration values unless DTD use has been turned off.
   NOTE: this function acts independently of namespaces
   associated to the attribute. Use xmlGetNsProp() or
   xmlGetNoNsProp() for namespace aware processing. """
ret = libxml2mod.xmlGetProp(self._o, name)
return ret


Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Using wchar_t string with libxml2.

2005-01-26 Thread Daniel Veillard
On Wed, Jan 26, 2005 at 10:05:10AM +, [EMAIL PROTECTED] wrote:
> How should I be passing my wide strings into these functions? I could just 
> convert them to char strings, but I could loose data. Are the any other 
> issues I should be concerned about to ensure my xml is valid? e.g.  what 
> encoding standard should I use? UTF-16?

  You must convert your wide strings into UTF-8 strings before passing them
to the libxml2 API. I think 
http://xmlsoft.org/encoding.html#internal
is clear about that. If not I take patches to make this clearer.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] win32 build system

2005-01-26 Thread Daniel Veillard
On Wed, Jan 26, 2005 at 11:49:50AM +0100, Francesco Montorsi wrote:
> >Like I said, I have no strongly manifested opinion about it. How the 
> >build system works is secondary to me as long as it works and stays out 
> >of the way. If the bakefile concept gains acceptance and develops into 
> >something like Apache Ant, well, I'll use it along with the rest of the 
> >gang.
> 
> well, that bakefile can be easily used _together_ with the current
> configure.js script it would also add support for watcom and other
> compilers; it also would remove any need to update IDE project files
> since they are generated by the same source.
> 
> However I know that, as you said, build system is secondary 
> as long as it works...

  I won't be taking side on how best build on Windows as I have no clue
about it.

> In any case, I'll keep the bakefile updated and in the same location
> (http://www.geocities.com/f18m_cpp217828/prog/libxml2_win32.zip);

paphio:~ -> unzip -l libxml2_win32.zip
Archive:  libxml2_win32.zip
  Length Date   TimeName
    
  399  01-19-05 10:01   build/Bakefiles.bkgen
27571  01-19-05 10:38   build/libxml2.bkl
20085  01-19-05 10:27   build/libxml2.dsp
 3420  01-19-05 10:28   build/libxml2.dsw
20115  01-19-05 10:39   build/libxml2_libxml2.dsp
15412  01-19-05 10:28   build/libxml2_testAutomata.dsp
15100  01-19-05 10:28   build/libxml2_testC14N.dsp
15100  01-19-05 10:28   build/libxml2_testHTML.dsp
15256  01-19-05 10:28   build/libxml2_testReader.dsp
15256  01-19-05 10:28   build/libxml2_testRegexp.dsp
15178  01-19-05 10:28   build/libxml2_testRelax.dsp
15022  01-19-05 10:28   build/libxml2_testSax.dsp
15334  01-19-05 10:28   build/libxml2_testSchemas.dsp
15022  01-19-05 10:28   build/libxml2_testURI.dsp
15178  01-19-05 10:28   build/libxml2_testXPath.dsp
15022  01-19-05 10:28   build/libxml2_xmllint.dsp
21700  01-19-05 10:20   build/makefile.bcc
15586  01-19-05 10:20   build/makefile.gcc
19710  01-19-05 10:20   build/makefile.vc
22089  01-19-05 10:20   build/makefile.wat
0  01-19-05 10:50   build/
    ---
   317555   21 files
paphio:~ ->

  How much of it is the source, how much of it is generated. It seems
reasonable to me to add a maintain the bakefile source to the archive,
associated with a README explaining how to use this alternate mechanism,
and then anybody willing to use that instead of whatever the default 
build is should be able to follow the guideline and use the bakefile.
However:
  - adding the .zip file to the distribution does not make sense to me
  - nor adding all the generated makefiles 
so if you indicate clearly what the source is, provide a README and
indicate willingness to provide updates, I will add them in a bakefile
subdirectory of the sources.

Daniel
-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] setting URL for xmlRelaxNGParserCtxt?

2005-01-26 Thread Daniel Veillard
On Wed, Jan 26, 2005 at 11:35:52AM +0100, Martijn Faassen wrote:
> >One note though, I'm using dictionnaries more and more intensively those
> >days, so keeping a single dictionnary for everything, while it clearly
> >speed-up processing may grow quite a bit for example as you process random
> >documents. It might be a good idea to "sometimes" reset the dictionnary
> >to avoid explosion, for example for all the ID strings ever processed 
> >by the program.
> 
> I don't use a single dictionary to speed up processing. I am using a 
> single dictionary as I have absolutely no way to know which nodes from 
> which nodes are going to be combined. I actually don't know what these 
> dictionaries are used for (are elements stored in them? text node 
> strings? both? and why? :), but having separate ones is just an 
> impediment to moving nodes around freely. Moving nodes around freely is 
> absolutely essential in my library's case, as the API I'm implementing 
> allows this always.

  okay then just keep the same dictionnary, but it may grow indefinitely
and may slow things down after a while.

> What do you mean by resetting for every ID string? You mean as soon as 
> an ID is encountered in an XML document? This may never happen for many 
> classes of XML document, right?

  IDs values are stored in the dictionnary, they are potentially random
strings, and hence may grow your dictionnary indefinitely even if the
documents you manipulate have a fixed vocabulary.

  If it doesn't make sense for you, just forget about it.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] htmlReadMemory

2005-01-26 Thread Daniel Veillard
On Wed, Jan 26, 2005 at 10:50:39AM -, [EMAIL PROTECTED] wrote:
> 
> Hi all,
> I have two questions regards to htmlReadMemory.
> This function is 
> 
> htmlDocPtrhtmlReadMemory (const char * buffer, int size, const char * 
> URL, const char * encoding, int options)
> 
> I don't understand the meaning of:
> 
> URL: the base URL to use for the document
> 
> For example if the url is http://arianna.libero.it/ricerca_avanzata.html, 
> what's the base URL?

  http://arianna.libero.it/ricerca_avanzata.html

> The second question is about encoding. I have a buffer with my html code: can 
> I pass it to htmlReadMemory with encoding=NULL and hope that it automatically 
> discovers the rigth encoding of the page?

  yes

> If I use HTML_PARSE_NOERROR | HTML_PARSE_NOWARNING as options, the non well 
> formed errors are suppresed?

  depends how you built your errror layer. Some errors like memory allocation
errors will always be reported anyway.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] setting URL for xmlRelaxNGParserCtxt?

2005-01-26 Thread Daniel Veillard
On Wed, Jan 26, 2005 at 12:42:57PM +0100, Martijn Faassen wrote:
> Hey Daniel,
> 
> I hope you'll still answer the other part of my mail (the Relax NG 
> include processing errors).. that's a bit more urgent right now. :)

  Well that mean going in a debug session (gdb etc...) and 1/ it takes
more time 2/ I don't have a reproductible test case 

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Using wchar_t string with libxml2.

2005-01-26 Thread Daniel Veillard
On Wed, Jan 26, 2005 at 12:26:09PM +, [EMAIL PROTECTED] wrote:
> >   You must convert your wide strings into UTF-8 strings before passing 
> them
> > to the libxml2 API. I think 
> > http://xmlsoft.org/encoding.html#internal
> > is clear about that. If not I take patches to make this clearer.
> > 
> 
> Ok, does that mean there could possibly be a loss of data, for characters 
> that need two bytes? Or have I got the wrong end of the stick when it 
> comes to storing Unicode strings?
> 
> I've just tried using 'wcstombs()' to convert my wide string to a 
> multi-byte string, which I can then BAD_CAST to xmlChar. Is this the 
> correct way of doing this? I just tried passing a random arabic string 
> through wcstombs() and it fails, because it cannot a wide character. 

  You need to find the way to convert your input. UTF-8 can handlle the
full Unicode range.

> How should I convert my random arabic string to utf-8? Is it possible? 

  Any Unicode code point has a representation in UTF-8, the answer should
be yes.

> **
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> [EMAIL PROTECTED]

  This is not compatible with the mailing-list policy. Please get rid of
this footer because we will make any communication made to this list publicly
available and searchable even by non-subscribers to the list. Tell your
management and IT hierarchy that this is incompatible with working with
Open Source projects ! You may get private support for libxml2 code but
I exect this to be only made as part of commercial support contacts (with
whoever may want to sell such support).

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Using wchar_t string with libxml2.

2005-01-26 Thread Daniel Veillard
On Wed, Jan 26, 2005 at 02:05:31PM +, Arthur Yarwood wrote:
> [EMAIL PROTECTED] wrote on 26/01/2005 12:48:07:
> 
> Am I just mis-using it somehow?

  Looks okay. But this is not a mailing list about characters encoding
or the iconv API, really...

> I'm guessing I've got the wrong code for 
> the input. Any ideas?

  http://www.opengroup.org/onlinepubs/007908799/xsh/stddef.h.html
  the definition of wchar_t doesn't define an encoding. Seems to be
a sequence of code point. Doesn't even define the *size* of the C objects,
maybe your encoding is UCS4 but you really ought to know better what
you are using. It's likely to even be system dependant ! Anyway if you
use embedded systems that sounds a sure way to waste globs of memory,
I would not do that...
  UTF-8 representation is defined in rfc2044 . 
  libxml2 has a function to take an Unicode code point and write it
in an xmlChar buffer:
  http://xmlsoft.org/html/libxml-parserInternals.html#xmlCopyCharMultiByte

> Ahh, yeah I forgot that they append that. I do apologise, I'll use my 
> own personal email account from now on.

  okay.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] setting URL for xmlRelaxNGParserCtxt?

2005-01-26 Thread Daniel Veillard
On Wed, Jan 26, 2005 at 03:12:52PM +0100, Martijn Faassen wrote:
> So what *is* stored in these dictionaries? I still don't know. Tagnames? 
> Namespace strings? Text node content? IDs? All of them? I guess I'll 
> have to study the source to get the answer. :)

  markup tag name, very small text node values, ID/REFs, DTD attribute
defaults values, namespace names. With libxslt you also get stylesheets
names.
  general text node content is not added, this would explode and be unusable.

> If one blows away a dictionary once every while, what happens to the 
> things referencing things inside it?

  they will point to freed memory. So don't free the dictionnary until
it it not in use anymore. Use another one, but you will loose unicity
of strings.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] setting URL for xmlRelaxNGParserCtxt?

2005-01-26 Thread Daniel Veillard
On Wed, Jan 26, 2005 at 05:39:56PM +0100, Martijn Faassen wrote:
> Daniel Veillard wrote:
> >On Wed, Jan 26, 2005 at 03:12:52PM +0100, Martijn Faassen wrote:
> >
> >>So what *is* stored in these dictionaries? I still don't know. Tagnames? 
> >>Namespace strings? Text node content? IDs? All of them? I guess I'll 
> >>have to study the source to get the answer. :)
> >
> >
> >  markup tag name, very small text node values, ID/REFs, DTD attribute
> >defaults values, namespace names. With libxslt you also get stylesheets
> >names.
> >  general text node content is not added, this would explode and be 
> >  unusable.
> 
> Okay, thanks. Even if that memory is not freed ever it isn't too bad. I 
> think I understand also now why you mention IDs, as they may be globally 
> unique strings and there might be many of them. Does namespace names 
> mean their prefixes or the href, or both?

  both,

> It might be interesting for me to try building something on top of the 
> dictionary that that caches Python unicode strings so that they don't 
> need to be regenerated all the time. Basically, if I understand it 
> correctly, dictionaries guarantee that there is only a single char* 
> pointer to a piece of textual data, so I could use that pointer as a 

  yes unicity of the pointer returned by the API is the main garantee.
(note that ptr+1 may not be unique as "boo" and "foo" will be stored on
different locations).

> >  they will point to freed memory. So don't free the dictionnary until
> >it it not in use anymore. Use another one, but you will loose unicity
> >of strings.
> 
> Hm, that sounds tricky. If I have a bunch of documents that share the 
> same dictionary, how would I go ahead and clean a dictionary up? One way 
> would be to hunt all references to dictionaries and replace the 
> dictionary with another one. The other way would be to clean or shrink 
> the dictionary itself.

  You can remove the dictionnary only when no more document reference it.
trying tou change dynamically the dictionnary of a document would be expensive
and very tricky,

> Both approaches have a problem I can't seem to figure my way out of:

  So don't do it.

> The strings in the original dictionary (or the strings not known to the 
> dictionary anymore if the dictionary has been 'shrunk') will still be 

  You can't 'shrunk' a dictionnary, there is no way you can tell whether
a given string need to be kept or discarded.
  But you can ask a dictionnary if it owns a string pointer really fast.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] win32 build system

2005-01-26 Thread Daniel Veillard
On Wed, Jan 26, 2005 at 07:55:16PM +0100, Francesco Montorsi wrote:
> Hi,
> 
> > How much of it is the source, how much of it is generated.
> Only two files are templates:
> - libxml2.bkl
> - bakefiles.bkgen
> all the other ones are generated using them.

  okay

> >It seems
> >reasonable to me to add a maintain the bakefile source to the archive,
> >associated with a README explaining how to use this alternate mechanism,
> >and then anybody willing to use that instead of whatever the default
> >build is should be able to follow the guideline and use the bakefile.
> Ok; I created a simple Readme.txt and I have updated the zip
> (always at http://www.geocities.com/f18m_cpp217828/prog/libxml2_win32.zip)
> 
> 
> >However:
> > - adding the .zip file to the distribution does not make sense to me
> I agree; I meant to say that the contents of the zip could be added... :-)
> 
> > - nor adding all the generated makefiles
> why ? This would make much easier to everyone to use the build system.

  Because the official Windows build is Igor's one. Igor takes most of the
Windows issues and problems. If we clearly put a different build out then
people will start push request on him while they use a different build
system. And as I could see, on Windows new build way == new bugs, c.f.
for example the bug the Joel and William have been chasing so far unsuccess-
fully just because they changed a /MD onto /MT on Microsoft compiler.
I want the people who use bakefile to at least have gone though the
readme, the bakefile install, before hitting any potential bug, i.e.
those people can work and debug at least minimally on their own.

> If only the templates are given, then before compiling the user should 
> download
> bakefile, install it and run it.

  Precisely.

> The size of the BUILD folder is about 317 Kb and I think it wouldn't be a 
> great problem adding it entirely...

  It's less a question of size, and more a question of making sure
people building this way know what they are doing. Bakefile is far from 
ubiquitous, I'm fine suggestion it as a solution, but we are not ready
to cope with problems resulting from its use :-)

> >so if you indicate clearly what the source is, provide a README and
> >indicate willingness to provide updates, I will add them in a bakefile
> >subdirectory of the sources.
> My project depends on libxml2 and thus I will continue to use it, through 
> bakefile
> makefiles; so I will continue to keep the bakefile updated and bug-free :-)
> To work, the bakefile & all generated makefiles should be put into
> a subfolder (the name is not important; I usually use a folder called 
> "build")

  If I add those 3 files (libxml2.bkl, bakefiles.bkgen, Readme.txt) I will
put them under "bakefile", build is far too generic.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Error after upgrade to libxslt 1.1.12

2005-01-27 Thread Daniel Veillard
On Wed, Jan 26, 2005 at 08:17:33PM -0500, James Orr wrote:
> On Wed, 2005-01-26 at 19:25 -0500, James Orr wrote:
> > Hi,
> > 
> > I've been using libxslt 1.1.9 with Perl's XML::LibXSLT module.  Ran into
> > a bit of trouble when upgrading to 1.1.12 ...
> > 
> > I have a registered function which returns an XML::LibXML::NodeList.  It
> > runs through an array, creates an element for each item and then pushs
> > it onto the returned nodelist.
> > 
> > In my XSL file I have some things like ...
> > select="item[ns:myfunction($include)[EMAIL PROTECTED]"
> > 
> > and what that would do is select all the item elements with a value
> > which matches entries in the perl array.  This works fine in 1.1.9.  In
> > 1.1.12 it gives a segmentation fault.
> > 
> > Is this a bug with libxslt or is there something I need to clear up in
> > my code?
> 
> Some further information.
> 
> It's not libxslt, it's libxml2.  It works with version 2.6.11, it
> doesn't with 2.6.16 or higher (not sure about in between those
> versions).
> 
> I get the segmentation fault whenever myfunction returns more than one
> item in the NodeList.

  No idea. Without a reproductible test case I can't even try to make a guess.
And I don't know XML::LibXSLT module code, can you try to first get the
authors of the Perl modules to look at it,

  thanks,

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] What does xmlCtxtReadFile() validate?

2005-01-27 Thread Daniel Veillard
On Tue, Jan 25, 2005 at 12:33:52PM -0500, Daniel Veillard wrote:
> On Tue, Jan 25, 2005 at 06:26:56PM +0100, Ronny Seemann wrote:
> > Can i actual use xmlCtxtReadFile() for dtd-validation or should i better 
> > use 
>   yes

  xmllint --valid uses xmlCtxtReadFile(). I ran it under gdb as

xmllint --valid --noout ACK.R01.xml ACK.R02.xml

when xmlCtxtReadFile() returned in both cases ctxt->valid was 0
I cannot reproduce your problem, with the existing test code and
the current code base.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] libxml2 Relax NG include bug?

2005-01-27 Thread Daniel Veillard
On Thu, Jan 27, 2005 at 06:18:13PM +0100, Martijn Faassen wrote:
> Hey,
> 
> Following up again:
> 
> I think I tracked down the bug. The relaxng.c checks for the URL on the 
> doc object to determine the base. This URL exists on the original 
> xmlDoc* I pass in, but xmlRelaxNGNewDocParserCtxt makes a *copy* of this 
> document using xmlCopyDoc(). This doesn't copy the URL, so the URL will 
> be NULL.

  haha :-)

> I don't know whether the bug is in xmlCopyDoc not copying the URL, or 

  yes, I commited the fix to tree.c in CVS,

thanks a lot !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] When will be xmlTextReaderReadString implemented

2005-01-27 Thread Daniel Veillard
On Thu, Jan 27, 2005 at 08:12:07PM +0100, Bjorn Reese wrote:
> Jirka Kosek wrote:
> 
> >are there any estimate when xmlTextReaderReadString could be 
> >implemented? Pull-mode parser without this function is not very usable 
> 
> Here you go...

  Hum shouldn't you expand first the given node before collecting the
children ? The fact that you're on a given node in the reader doesn't
mean all its children are available. Seems an xmlTextReaderDoExpand()
call is needed in case of an ELEMENT, wrong or right ? 
  I will defer commiting the patch based on your answer :-)

Daniel


-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] [patches] static linking on win32 with static cruntimes

2005-01-27 Thread Daniel Veillard
On Thu, Jan 27, 2005 at 12:26:04PM -0500, jreed wrote:
> the two patches below force static linking on win32 in libxml2 and libxslt
> for .exe's when the libraries are built using a static version of the
> cruntime (/MT, /MTd, /ML, and /MLd).
> 
> these patches fix the breakage discussed previously on the xslt list,
> and found also to occur in xmllint.exe.
> 
> http://mail.gnome.org/archives/xslt/2005-January/msg00069.html
> 
> quoting http://support.microsoft.com/kb/q140584/
> 
> "You cannot pass a FILE* or file handle across a CRT-boundary and expect
> the "stdio low-level IO" to work."

  hehe ... commited :-)

I think defaulting to file descriptor based low level access and avoiding
FILE pointer as much as possible would be a general nice enhancement where
needed, I remember something with some verions of UNIX having ridiculously
low number of simultaneous FILE opened for a given process.

  Thanks a lot !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] win32 build system

2005-01-27 Thread Daniel Veillard
On Thu, Jan 27, 2005 at 07:47:56PM +0100, Francesco Montorsi wrote:
> > If I add those 3 files (libxml2.bkl, bakefiles.bkgen, Readme.txt) I will
> >put them under "bakefile", build is far too generic.
> Ok; I hope they will be useful to the libxml2 project.

  Okay, commited in CVS, now you can work on the bakefile for libxslt
and xmlsec (not presuming Aleksey acceptance on that last one though :-)
Maybe bakefile will succeed in being the modern makefile generator tools
that we needed in the 20th century and still hope to get for the 21th
and fix the auto*/libtool/... [censored] mess 

  thanks,

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Probs with xmlCtxtReadFile() !!

2005-01-28 Thread Daniel Veillard
On Fri, Jan 28, 2005 at 11:21:28AM +0100, Ronny Seemann wrote:
> I also tried 
>   xmllint --valid --noout ACK.R01.xml
> from the command line.
> 
> With XML_1 I get: no error
> With XML_2 I get: ACK.R01.xml:1: element HDR: validity error : Element 
> HDR
[...]
> Does anyone have an idea what is wrong?

  I already stated on this list that for me xmllint *was* reporting an error
with XML_1, and asking you to upgrade *first* before making further report.
   
   http://mail.gnome.org/archives/xml/2005-January/msg00223.html
   http://mail.gnome.org/archives/xml/2005-January/msg00184.html

You did not reply (publicly) to my mail, and instead repost basically the same
informations as in your first mail. What's the point of me replying to you
if you ignore what I say ? Or did I missed something ?

And to confirm *once again* that no I cannot reproduce this behaviour with
the current version:


paphio:~/tmp -> cat ACK.R01.dtd






paphio:~/tmp -> vi ACK.R01.xml
paphio:~/tmp -> cat ACK.R01.dtd






paphio:~/tmp -> cat ACK.R01.xml











paphio:~/tmp -> xmllint --valid --noout ACK.R01.xml
ACK.R01.xml:4: element HDR.control: validity error : No declaration for element 
HDR.control

  ^
ACK.R01.xml:5: element HDR.version: validity error : No declaration for element 
HDR.version

  ^
ACK.R01.xml:6: element HDR.creation: validity error : No declaration for 
element HDR.creation

   ^
ACK.R01.xml:9: element ACK: validity error : Element ACK content does not 
follow the DTD, expecting (ACK.type , ACK.ack_control , ACK.note? , 
ACK.error_detail?), got ()

  ^
paphio:~/tmp -> echo $?
4
paphio:~/tmp -> xmllint --version
xmllint: using libxml version 20617
   compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer XInclude 
Iconv Unicode Regexps Automata Schemas Modules
paphio:~/tmp ->


  Now would you be so kind to simply, read my replies and follow the advices
you got back !!!

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Probs with xmlCtxtReadFile() !!

2005-01-28 Thread Daniel Veillard
On Fri, Jan 28, 2005 at 05:55:43PM +0100, Ronny Seemann wrote:
> Libxm2 is included to our linux kernel from a partner company.

  In the linux *kernel* 

> When they have to upgrade libxml2, the hole software of the device
> must be validate. This is not only expensive but also claimed a lot of time.

  Assuming I manage to take one hour of my free time to work on libxml2,
what is the best for the project: 
   1/ chase your specific problem an make a backporting patch to whatever
  version you are using
   2/ spend that time improving current state for the main trunk
 
 Obviously 2/ takes over. Work like 1/ is a service around the open-source
project and possibly an opportunity to grow some business for people who
know the library well. Backporting fixes are one of the most onerous
tasks of software maintainance.

> I believe you that xmlCtxtReadFile works correct in the current version. 
> I tested it successful locally by myself. I just wanted to know if someone 
> can 
> remember a bug in version 2.6.11, because i couldt find any hints on 
> xmlsoft.org. 

  Okay, I can't remember anything specific. It's a general validation bug
apparently. Fix may drill down up to the regexp engine or something more simple
I have no idea where this can be, getting there is quite a bit of work.

> Thanks for the assistance, even if it is arduous with me.
> I wish a beautiful weekend.

  heh, thanks !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] When will be xmlTextReaderReadString implemented

2005-01-28 Thread Daniel Veillard
On Fri, Jan 28, 2005 at 06:34:25PM +0100, Bjorn Reese wrote:
> Daniel Veillard wrote:
> 
> >  Hum shouldn't you expand first the given node before collecting the
> >children ? The fact that you're on a given node in the reader doesn't
> >mean all its children are available. Seems an xmlTextReaderDoExpand()
> >call is needed in case of an ELEMENT, wrong or right ? 
> 
> Good catch. I didn't even know about xmlTextReaderDoExpand().
> 
> Here's a patch for my previous patch.

  Okidoc, applied both and commited :-)

thanks !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


[xml] Re: [xslt] Performance issue when matching text()|*

2005-01-28 Thread Daniel Veillard
On Fri, Jan 28, 2005 at 06:31:30PM +0100, Kasimier Buchcik wrote:
> Oops, if this is true then XSLT it's really not intuitive here, since
> I would expect the expression to be evaluated from inner to outer; i.e.
> "count(text())" to return a number first and _then_ this number to be
> converted to a string, which is added to the output.
> Strange it seems to me.

   Okay, I misunderstood the stylesheet  it was named templates
and not matching templates ... Scratch what I wrote about this, I though
it was again that annoying text node coalescing haunting me.

   Looking again I think it's not linear because growing the node set in
some way check for duplicate nodes in the set while this is not needed.
That may be avoidable, or not I would need to go deeper to assert what
is really going wrong, Jerome can you bugzilla this please ?

  thanks :-)

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] [patches] static linking on win32 with static cruntimes

2005-01-28 Thread Daniel Veillard
On Fri, Jan 28, 2005 at 03:58:50PM -0500, Joel Reed wrote:
> On Thu, Jan 27, 2005 at 07:04:41PM -0500, Daniel Veillard wrote:
> 
> snip
> 
> > I think defaulting to file descriptor based low level access and avoiding
> > FILE pointer as much as possible would be a general nice enhancement where
> > needed, I remember something with some verions of UNIX having ridiculously
> > low number of simultaneous FILE opened for a given process.
> 
> i agree but am wondering how this would fit with no-(api/api) changes
> policy... all new APIs using file descriptors?

  no but making sure when we provide a path to a file that all I/O are done
through fds not FILEs.

> also, while on topic of APIs, the fact that extension registeration
> functions don't take the hash to register the extension in as an 
> argument, but instead register to global xmlHashes means folks wanting
> to using plugins MUST dynamically link libxslt into the plugin.
> would we ever want to fix that? not sure...

  I'm not sure I understand :-)

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Error report with RelaxNG

2005-01-28 Thread Daniel Veillard
On Fri, Jan 28, 2005 at 01:24:07PM +0100, Marc Poinot wrote:
> 
> Hi, I'm using RelaxNG python binding with 2.6.17,
> many errors are quite understandable (I mean for
> human being), but now I've got an empty result
> on the following error:
> 
> I've got an enumerate, the actual value in the XML
> file has a typo on one of the enumerates. However, the
> lastError function returns None, as if there was no
> information about this enumerate error (again, many other
> errors are correctly reported).
[...]
> The returned error code is None for a level of "severe".
> 
> The Python code of the error function (set with reagisterErrorHandler):
[...]
> Any idea ?

  Not really. Can you provide the smallest XML files for the
RNG and the XML showing the problem, then we can debug what's actually
happening.

  thanks,

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] [patches] static linking on win32 with static cruntimes

2005-01-29 Thread Daniel Veillard
On Fri, Jan 28, 2005 at 11:16:07PM -0500, Joel Reed wrote:
> snip
> 
> > > also, while on topic of APIs, the fact that extension registeration
> > > functions don't take the hash to register the extension in as an 
> > > argument, but instead register to global xmlHashes means folks wanting
> > > to using plugins MUST dynamically link libxslt into the plugin.
> > > would we ever want to fix that? not sure...
> > 
> >   I'm not sure I understand :-)
> 
> sorry, let me try again. so a plugin init function looks like this:
> 
> void EXSLTPUBFUN exslt_org_regular_expressions_init (void)
> {
> xsltRegisterExtModuleFunction ((const xmlChar *) "match",
>(const xmlChar *)
>EXSLT_REGEXP_NAMESPACE,
>exsltRegexpMatchFunction);
> }
> 
> xsltRegisterExtModuleFunction in libxslt/extensions.c adds
> exsltRegexpMatchFunction to xsltFunctionsHash which is a global
> variable.
> 
> now imagine xsltproc and exslt_org_regular_expressions.so, each
> statically linking to libxslt. each has a xsltFunctionsHash now.
> if they were both dynamically linked to libxslt, there'd be only
> one xsltFunctionsHash.
> 
> so given the current API, exslt_org_regular_expressions.so ends
> up adding a new entry into its xsltFunctionsHash, and not
> the right one -> which is xsltproc's xsltFunctionsHash.

  Okay.

> it seems that one way to fix this would be to pass some context
> ptr to plugin init funcs, that would then just be passed along
> in some new xsltRegisterExtModuleFunction that besides the params
> above, also took a context pointer, and that in the implementation
> of this new func, exsltRegexpMatchFunction would be added not to 
> some global xsltFunctionsHash, but to context->xsltFunctionsHash.
> thereby fixing the issue with statically linked xsltproc's and plugins.

  okay, seems to make sense.

> whether this has other benefits, or is just too much change for
> a small set of users/configs i'm not sure. just describing how
> i think we could make it work.

  agreed there might be more benefits to passing the context down,
for example the access to the dictionnary.
  Send patch I will apply it before the next release (which got delayed,
sorry !)

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Better fix for bug #155468?

2005-01-29 Thread Daniel Veillard
On Sat, Jan 29, 2005 at 03:27:50PM +0100, [EMAIL PROTECTED] wrote:
> Hi,
> 
> The patch to generator.py (v 1.59) to fix bug #155468 breaks setup.py.
> 
> Indeed, setup.py runs generator.py by importing it instead of lauching 
> it as a script; since setup.py itself has arguments (such as 'build' or 
> 'install'), generator.py computes a wrong srcPref.
> 
> The attached patch computes srcPref based on the location of 
> generator.py itself, without requiring an argument.
> 
> Does that make sense?

  Seems so :-) Applied to my tree. I will commit later today,

thanks !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Initial identity-constraint implementation for XML Schemata

2005-01-30 Thread Daniel Veillard
On Thu, Jan 27, 2005 at 04:28:09PM +0100, Kasimier Buchcik wrote:
> Preparatory work for (2):
>   - A streamable XPath engine would be perfect for IDCs, but since there
> is none yet available the XPath module is used to compile the IDC
> XPath expressions.

  Bzzz, checkout CVS :-)

You have 4 new APIs in pattern.h:

XMLPUBFUN xmlStreamCtxtPtr XMLCALL
xmlPatternGetStreamCtxt (xmlPatternPtr comp);
XMLPUBFUN void XMLCALL
xmlFreeStreamCtxt   (xmlStreamCtxtPtr stream);
XMLPUBFUN int XMLCALL
xmlStreamPush   (xmlStreamCtxtPtr stream,
 const xmlChar *name,
 const xmlChar *ns);
XMLPUBFUN int XMLCALL
xmlStreamPop(xmlStreamCtxtPtr stream);

 Basically the operation is that you call
push(name, ns) on all element start
pop() on all element end
and push() returns 1 if the element matches the pattern.

 I't not yet fully completed, but works for simple cases, I added code
to test it in xmllint --stream --pattern .
 Things needing work:
   - compilation flags to check for specific syntaxes
 using flags of xmlPatterncompile() 
   - making clear how pattern starting with / or . need to be handled,
 currently push(NULL, NULL) means a reset of the streaming context
 and indicating we are on / (the document node), probably need 
 something similar for .
   - xmlPatterncompile support of namespaces arguments, I'm not sure
 it's implemented and definitely not tested
   - handling of disjunction "pattern1 | pattern2" mean needed to build
 and check a list internally
   - better testing, I'm pretty sure there is some bugs left in the
 engine :-)

So there is still a bit of work needed :-), APIs should be okay though.
For the last node() or attribute @foo needed specifically for schemas
patterns I suggest to handle them on top of the engine, I'm not sure
we want to add attributes to xmlStreamPush() for example.

The good part is that the XPath subset is so restricted that if can be done
in a very lightweight way, and I hope to be able to reuse that to speed
up significantly XPath implementaton for that subset by reusing it.

So quite a bit of work, but a lot of fun ahead,

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Initial identity-constraint implementation for XML Schemata

2005-02-02 Thread Daniel Veillard
On Mon, Jan 31, 2005 at 05:48:08PM +0100, Kasimier Buchcik wrote:
> Coool!
> I integrated it into the schema module. Works nice for the test schema
> I'm using, didn't test special cases yet. Fixed some bugs in the IDC
> code. I'll try to commit soon.

  Okay I commited some fixes already,

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xml diff and patch support -- new node type

2005-02-02 Thread Daniel Veillard
On Mon, Jan 31, 2005 at 04:55:25PM -0800, Mark Vakoc wrote:
> Daniel,
> 
> I'm midway through implementing what I hope to be a rather flexible diff (and
> eventually patch) implementation for libxml2.  Flexible in the sense that it
> should be able to output different output formats though I will likely only be
> implementing one (probably the microsoft XmlDiffPatch diffgram format).

  Cool, I sent a mail a couple of years ago asking for someone
to implement a diff :-)

> Couple of general things about it:
> * the diff API will only take URIs rather than xmlDocPtr's because it is
> destructive to the documents and also requires access to all fields to store
> hashes, relative positions, misc items (including _private) for the source and
> target document

  Well you make the code so you handle the restrictions, but what about 
an API doing an xmlCopyDoc ? And do you need to modify both documents ?

> * I'm adding a xmlHashMultiTable that is a hash multimap where the sort key
> need not be unique.  It is also implemented to allow front and back access to
> entries when duplicate entries exist (making easy FIFO or FILO access).  In
> addition the user is responsible for computing the hash key (it accepts an
> unsigned long to add/lookup functions)

  Not sure I understand :-) Let see the API !

> * I really need to add another node type to XML_ELEMENT_TYPE for a condensed
> node, that is a representation of subtrees and/or sequences (adjacent 
> siblings)
> that are identical between the source and target diff documents.  It can 
> follow
> the same rules as XML_ELEMENT_NODE for deallocation.

  Hum, that is annoying. It's gonna break lot of stuff. If such node are
never exposed afterward, I suggest to not add it to ElementType.

> Just a heads up and want to make sure adding a new value to the xmlElementType
> enum is ok before I commit to that.  Should have a patch ready in a week or
> two.

  I would rather make a #define for the new element type and avoiding 
it from escaping the scope of the xmldiff C module.

  thanks !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xml diff and patch support -- new node type

2005-02-03 Thread Daniel Veillard
On Wed, Feb 02, 2005 at 07:27:51AM -0800, Mark Vakoc wrote:
> Basically I needed a queue that can quickly look up nodes in it by a hash 
> value
> that guarantees I can pull out matching entries in the order they were added 
> to
> the queue.  The table may contain multiple matches for the same hash value. 
> Here's the API for it so far:
> 
> /*
>  * Hash Multimap
>  */
> XMLPUBFUN xmlHashMultiTablePtr XMLCALL
>   xmlHashMultiCreate(int size);
> XMLPUBFUN void XMLCALL
>   xmlHashMultiFree(xmlHashMultiTablePtr table, 
>   xmlHashDeallocator f);
> XMLPUBFUN int XMLCALL
>   xmlHashMultiAddEntry(xmlHashMultiTablePtr table, 
>   unsigned long hash, 
>   void* userdata);
> XMLPUBFUN xmlHashMultiEntryPtr XMLCALL
>   xmlHashMultiLookup(xmlHashMultiTablePtr table, 
>   unsigned long hash);
> XMLPUBFUN void* XMLCALL
>   xmlHashMultiGetData(xmlHashMultiEntryPtr entry);
> XMLPUBFUN xmlHashMultiEntryPtr XMLCALL
>   xmlHashMultiNext(xmlHashMultiEntryPtr entry);
> XMLPUBFUN int XMLCALL
>   xmlHashMultiSize(xmlHashMultiTablePtr table);
> XMLPUBFUN int XMLCALL
>   xmlHashMultiRemove(xmlHashMultiTablePtr table, 
>   xmlHashMultiEntryPtr entry, 
>   xmlHashDeallocator f);

  looks generic enough ! Fine by me, I will double check but first glance it
looks good :-)

> >   Hum, that is annoying. It's gonna break lot of stuff. If such node are
> > never exposed afterward, I suggest to not add it to ElementType.
> > 
> > > Just a heads up and want to make sure adding a new value to the
> > xmlElementType
> > > enum is ok before I commit to that.  Should have a patch ready in a week 
> > > or
> > > two.
> > 
> >   I would rather make a #define for the new element type and avoiding 
> > it from escaping the scope of the xmldiff C module.
> > 
> 
> Ok, I can keep it entirely within the xmldiff module.  I'll just have to 
> remove
> those nodes manually before calling any xmlFreeDoc, no problem.  When I'm done
> I may be able to get away with just storing info into an existing element
> already, though those are filling up.  So far node->_private stores a hash
> value of the subtree rooted at that node, node->extra is used for bitwise
> flags, and node->line is used for relative position of a child.

  Okay, maybe use ->psvi to avoid using _private at all but it's a detail...

  sounds good :-)

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] can't compile non-debug build

2005-02-03 Thread Daniel Veillard
On Mon, Jan 31, 2005 at 10:54:20PM -0800, [EMAIL PROTECTED] wrote:
> Good day,
> 
> I'm attempting to build a release version of 2.6.17 on FC3 and I am
> failing.  No matter what switch I provide configure, I end up with -g on
> the gcc command line.
> 
> I've tried --without-debug, --disable-debug, etc., but none seem to work.

  export CFLAGS=-O2 ; ./configure ; make ; make install should do it.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] reduce padding in xpath.h

2005-02-03 Thread Daniel Veillard
On Wed, Feb 02, 2005 at 04:08:02PM +0100, [EMAIL PROTECTED] wrote:
> 
> struct _xmlXPathObject in xpath.h
> 
> If you move the "floatval" below the stringval you save 8 bytes per
> structure when the memory alignment is set to the default 8 bytes. It's
> not an often used structure, but I still think the change might be OK.

  Should be added in the code as a comment for future releases, but right
now it's impossible to do, it would break ABI unfortunately !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xpointer range in attribute node

2005-02-03 Thread Daniel Veillard
On Wed, Feb 02, 2005 at 05:48:44PM -, Couch, PA (Philip) wrote:
> Hi,
> 
> Is it possible to use libxml's xpointer implementation to locate ranges that 
> are completely enclosed in attribute nodes?

  From my recollection, no it's not possible. Attributes aren't represented
on screen and I thing strings in attribute values were not part of the
requirement of rendering selection in XPointer.

> Using libxml, I get empty location sets from xpointer expressions of the form:
> 
> xpointer(string-range(//node/@attribute,"string",start,length))
> 
> Thanks for any help that you may be able to give,
> 
> Phil.
> 

Daniel


-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Delphi bindings for libxml2

2005-02-03 Thread Daniel Veillard
On Thu, Feb 03, 2005 at 10:05:14AM +1100, [EMAIL PROTECTED] wrote:
> I have tried several times to contact Petr to see whether he would like
> to incorporate my binding into his libxml2-pas project on sourceforge,
> but I have received no response from him. I am writing now to see whether
> anyone else is interested this code, or in providing a "home" for it so
> that it can be distributed (preferably under the terms of the MIT license)
> to any who wish to use it.

  I can host this on xmlsoft.org FTP if you provide me a way to mirror 
them easilly. Potentially I could host web pages too, assuming people
agree that they are the right Pascal/Delphi current bindings.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xinclude and dtd with default attributes values

2005-02-03 Thread Daniel Veillard
On Thu, Feb 03, 2005 at 01:22:34AM +0100, Panard wrote:
> Hi,
> 
>   I've got the following problem :
> 
> === x1.xml ===
> 
> 
> 
> x1
> 
> 
> 
> === x2.xml ===
> 
> 
> 
> x2
> 
> 
> === foo.dtd ===
> 
>  xmlns:xi   CDATA   #FIXED"http://www.w3.org/2001/XInclude";
> href   CDATA   #REQUIRED
> parse  (xml|text)  "xml"
> encoding   CDATA   #IMPLIED >
> 
> 
>  xmlns:xi   CDATA   #FIXED   "http://www.w3.org/2001/XInclude"; >
> 
> 
> 
> 
>  attrCDATA   "default"
> >
> 
> =
> 
> When running :
> $ xmllint --dtdattr --postvalid --xinclude x1.xml
> 
> 
> 
> x1
> 
> x2
> 
> 
> 
> 
> The x2.xml is correctly included, but why its element 'element' doesn't have 
> the default value for attribute 'attr' ? Is there a way to do that ?

  bugzilla this, it looks like flags not passed down to the XInclude processor.

thanks,

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xpointer range in attribute node

2005-02-03 Thread Daniel Veillard
On Thu, Feb 03, 2005 at 09:52:43AM -, Couch, PA (Philip) wrote:
> Hi,
> 
> I found that the XPointer scheme spec. is not too clear about this, except 
> that the last part relating to the string-range function reads:
> 
> "...string-range is useful for locating ranges that are wholly enclosed in 
> other node types as well, such as attributes, processing instructions, and 
> comments"
> 
> This lead me to hope that I could do this. I am working on the specification 
> of mappings from ontologies to XML schema, and the ability to point to 
> sub-strings in attribute values would be more than useful. I was confused 
> when I could not find a single example of this, since if it is useful to 
> point to sub-strings in an elements content, then it is likely to be useful 
> to be able to do the same for attribute values.

  Please remember that XPointer was defined in tandem with XLink to 
improve document hypertext on an XML based Web. And since attributes
are not displayed I don't think pointing within attrubutes was really
a requirement from our charter point of view. But that's true for 
comments content too ... So I'm not 100% sure about XPointer and
attribute content selection, sorry.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] wide characters & xmlDocDumpFormatMemory

2005-02-04 Thread Daniel Veillard
On Fri, Feb 04, 2005 at 10:47:24AM +, David Harris wrote:
>   res = xsltApplyStylesheet(cur, doc, params);
> xmlDocDumpFormatMemory(res, &xmlbuff, &buffersize, 1);

   B wrong approach. You need an XSLt specific serialization funtion
 like indicated in the tutorial, plus define in your stylesheet 
http://www.w3.org/TR/xslt#output
encoding = string 

 If you had just looked at the doc for the functions you used
   http://xmlsoft.org/html/libxml-tree.html#xmlDocDumpFormatMemory
you would have seen just below 
   http://xmlsoft.org/html/libxml-tree.html#xmlDocDumpFormatMemoryEnc

basically Read the Docs !


> xmlDocDumpFormatMemory works fine in xmlbuff is coerced to char but not 
> wchar_t. How can I use wide characters? are there wide character versions of 
> these functions? I certainly couldnt find them or any clue about using utf8 
> input for this library.

  You need to read more about the subject
http://www.w3.org/TR/REC-xml/#sec-guessing
if you use XML, you'd better read the associated spec. It does *not* have to
show up at the API level. There is also specific doc about encoding in
libxml2
http://xmlsoft.org/xmlmem.html
  it' 2 clicks away from the main page http://xmlsoft.org/

  Maybe you "certainly" could not find informations, but the informations
are "certainly" available and indexed by both google and xmlmsoft own
search engines.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] wide characters & xmlDocDumpFormatMemory

2005-02-04 Thread Daniel Veillard
On Fri, Feb 04, 2005 at 06:04:00AM -0500, Daniel Veillard wrote:
> On Fri, Feb 04, 2005 at 10:47:24AM +, David Harris wrote:
> > xmlDocDumpFormatMemory works fine in xmlbuff is coerced to char but not 
> > wchar_t. How can I use wide characters? are there wide character versions 
> > of 
> > these functions? I certainly couldnt find them or any clue about using utf8 
> > input for this library.
> 
>   You need to read more about the subject
> http://www.w3.org/TR/REC-xml/#sec-guessing
> if you use XML, you'd better read the associated spec. It does *not* have to
> show up at the API level. There is also specific doc about encoding in
> libxml2
> http://xmlsoft.org/xmlmem.html
>   it' 2 clicks away from the main page http://xmlsoft.org/

  Wrong link, the encoding explanations are actually
http://xmlsoft.org/encoding.html
which is directly listed as "Encodings support" on the main page.
Also "wide character" does not mean much is that UTF-16, UC2, UCS4, direct
Unicode code points ? An encoding means something it actually explicitely 
tell that it means a specific code conversion to Unicode code points
and back (when possible). wchar_t does not say what is the integer content
nor even it's size which is left platform/compiler dependant, i.e. unusable
as a base for real technical discussion without more informations you did
not provide.
  Character sets, encodings, Unicode, are hard concepts, but absolutely
needed if you really want to do internationalization properly. XML defined the
framework clearly, and you need to understand it (especially Appendix F) to
not make mistakes in an XML processing chain.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] [patch]wiki api docs

2005-02-04 Thread Daniel Veillard
On Wed, Feb 02, 2005 at 10:37:14PM -0500, Joel Reed wrote:
> The following patch adds a "wiki" target to doc/Makefile.am and a new
> stylesheet wiki.xsl which is a cut-down version of newapi.xsl.
> 
> This cut-down version eliminates all the menuing and such that
> won't be needed for libxml wiki docs.
> 
> Daniel, when you have a chance, could you 
> 
> 1) apply this patch (if acceptable)
> 2) run make wiki from doc/
> 3) copy result html files to the directory specified by 
> $wgLibXmlDocs in the mediawiki extension LibXml.php, or i guess
> change $wgLibXmlDocs to point to e.g. "/opt/src/libxml2/doc/wiki"
> 
> or if you like i can do the above with a shell account of your 
> choosing :)

  Okay, I think I have done it now :-)

> then once done, i will hook up the wiki pages appropriately and
> we can review it online. 
> 
> this will result in auto-generated wiki documentation, but everytime
> a new ".c" file is added, one new wiki page will need to be made
> which will consist of libxml-foo.html. Automatically
> creating mysql rows for these occasionally added pages would imho
> be a bad hack as there is no mediawiki API to do this kind of thing atm
> afaik.

  okay, 

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Problems with error printing

2005-02-07 Thread Daniel Veillard
On Mon, Feb 07, 2005 at 12:00:51PM +0200, Ohad Oded wrote:
> Hi, 
> 
>  
> 
> In error.c there are functions that handle error printing such as
> xmlGenericErrorDefaultFunc, however not all functions use these methods
> for error printing. Some use fprintf(stderr, ...), this is bad for
> applications that are GUI oriented and especially bad if stderr is not
> initialized.
> 
> Some examples:
> 
> xpath.c(11135):  fprintf(stderr, "100 x %s\n",
> comp->string);

  in #ifdef DEBUG_EVAL_COUNTS i.e. only for debugging

> xmlschemas.c(3332): fprintf(stderr, "  target namespace %s\n",
> namespace);

  within #ifdef DEBUG too

> xmlreader.c(520):   fprintf(stderr, "xmlTextReader: state %d
> depth %d ",

  in #ifdef DEBUG_READER

> Can this behavior be fixed? 

  This is not a behaviour. You could not possibly got stderr output from
those unless you modified the sources. So there is nothing to be fixed
and you need to reread that code, doing a basic grep without looking
and complaining without understanding at it is not really a proper way
to get any solution to the problem you may face. If you have *real* stderr
output, then explain what, the library uses stderr for valid reasons,
it may use it for invalid ones, but your report does not show any.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Problems with error printing

2005-02-07 Thread Daniel Veillard
On Mon, Feb 07, 2005 at 02:46:03PM +0200, Ohad Oded wrote:
> Sorry, 
> 
> Most of the fprintf are under some sort of #ifdef.
> Some of them are under #ifdef LIBXML_OUTPUT_ENABLED. I didn't understand
> its documentation in xmlVersion.h as having something to do with dumps
> to stderr.
> However here are some examples that are not under #ifdef:
> xmlregexp.c(2234): fprintf(stderr, "exec save: allocation failed");
> relaxng.c(7768):fprintf(stderr, "callback on %s missing
> info\n",...
> I tried to undef LIBXML_OUTPUT_ENABLED in xmlVersion.h but that resulted
> in compilation errors.
> Example: 
> xmlwriter.c(222) 'xmlOutputBufferCreateFilename' undefined (all its
> definitions are under #ifdef LIBXML_OUTPUT_ENABLED).
> There are some printf's too:
> Xmlreader.c(921)  printf("Expand failed !\n");
> The examples of code here are by no means a total grep, merely some
> examples. 

  what error did *you* got !
I'm all for fixing problems. But I want problems report. You said
you got stderr output, which ones ? 

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Canonicalization (C14N) of an XML element

2005-02-08 Thread Daniel Veillard
On Tue, Feb 08, 2005 at 11:30:44AM -0800, Aleksey Sanin wrote:
> Yes. You have to add all the nodes that you want to get
> canonicalized. However, in this particular case there is
> a better way. The xmlC14NExecute function allows one to
> provide a callback that would be called to determine if
> a given node is "visible" (i.e. included in c14n output)
> or not. To canonicalize just a given node (with all the
> attributes and children nodes) you can write a callback
> function that would return "true" for your node, its attributes,
> namespaces and children nodes and "false" for all other
> nodes in the document.

  Aleksey,

 I don't know if you have followed the -slightly heated- thread
about xml:id and C14N starting at
  http://lists.w3.org/Archives/Public/public-xml-id/2005Feb/0038.html

basically the c14n spec expect propagation if all xml:* attributes
while it is an error to propagate those for xml:base and possibly for 
xml:id.
It seems to me this is the code in c14n.c after line 982. I'm of the
opinion that the C14N spec is broken in that it was assuming cascading
behaviour for all xml:* attributes and while this is true for xml:space
and xml:lang it is not true for new attributes like xml:base and xml:id.
As an implementor what do you think ? My take is that the c14n spec and
the code need fixing, but I would not go forward without your input,
(it's your code :-), and can potentially generate some interop problems
for documents using xml:base and xml:id, which may raise bug reports on
your side.

  No need to rush but it's a problem,

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Flushing writers doesn't work...?

2005-02-09 Thread Daniel Veillard
On Wed, Feb 09, 2005 at 10:20:45AM +0100, Magnus Lie Hetland wrote:
> Hi!
> 
> I've been using xmlTextWriters as an abstraction in an internal
> event-based system in my app -- but it seems they don't sync properly
> when flushed. Maybe I'm expecting too much functionality from
> xmlTextWriterFlush()? I've used both writers from

  it calls xmlOutputBufferFlush() if there have been some data added
to the writer, this should really work as expected.

> xmlNewTextWriterFilename() and xmlNewTextWriterTree(), and neither
> type is synced on calls to flush -- I have to destroy the writer with
> xmlFreeTextWriter() to get the events into the file or tree,
> respectively. That's not very practical... Especially when I'm
> building trees incrementally -- then I have to keep track of the node
> where I want to continue when instantiating a new writer, and so on...
> 
> Is there another way of doing this? Is this a bug/known problem?
> Should I write my own writers/tree builders to get this functionality?

  a better explanation of what you're seeing and how it differs from
what you are expecting would help. I still don't see what the problem
might be. You need to be very precise and provide a reproduceable test
case if possible.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] workarounds for SAX and entity replacement

2005-02-12 Thread Daniel Veillard
On Sat, Feb 12, 2005 at 04:35:47PM +, Graham Bennett wrote:
> Hi all,
> 
> I'm trying to do entity replacement using the SAX2 interface, but I'm
> running into this problem:
> 
> http://bugzilla.gnome.org/show_bug.cgi?id=159219
> 
> where my SAX handler is invoked more than once for each entity.
> 
> Does anyone have any workarounds for this problem?  Is anyone
> successfully doing entity replacement via the SAX interface?

  well libxml2 does but at the tree level, i.e. it does some copies
but at the DOM nodes level. The reason is historical, libxml was designed
to preserve entities, even within attribute values, i.e. was designed
to be able to cope with editing needs. SAX was added later on as
it appeared as a de-facto API. Doing pure SAX based operations would
require keeping state at the parser level instead of at the tree
level which is what libxml2 does currently. This is not really trivial
the harder is all the border cases of wellformedness and validity checking
and there is plenty of trap to fell into if doing things naively.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Redirecting error output with python bindings

2005-02-11 Thread Daniel Veillard
On Fri, Feb 11, 2005 at 08:17:03PM +, Frans Englich wrote:
> On Tuesday 01 February 2005 04:15, Frans Englich wrote:
> > Hello,
> >
> > I have trouble redirecting the error output from libxml2, via the Python
> > bindings.
> >
> > I tried the validate.py[1] example, but it does what I expect it to _not_
> > do: it prints to standard out. After testing a bit, it looks like the
> > noerr() is never called.
> >
> > What I want to achieve is to retrieve the error as a string. What am I
> > doing wrong? is the noerr function called in the example? What is the
> > proper way to do what I want to?
> 
> I've attached two files: validity.py and invalid.xml, as per the example on 
> xmlsoft.org. When I run it, I get an error message to standard out, which I 
> do not expect. Do you get the same result, and do I have the right 
> expectation? This is with Python 2.4 and libxml2 2.6.16 Any documentation 
> which could get me on the right track in this matter?

  please bugzilla then,

   thanks,

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Re: xsd:include question

2005-02-15 Thread Daniel Veillard
On Tue, Feb 15, 2005 at 10:40:13AM +0100, Kasimier Buchcik wrote:
> Hi,
> 
> agantuk B wrote:
> >Thanks for your response. I'll send you a test case
> >shortly.
> >
> >Also, while i'm at it, would you be able to tell me if
> >the implementation for xmlSchemaValidateStream will be
> >available ?  I've huge xml documents (> 50Mb in
> >certain instances) and to use libxml, i will need a
> >mechanism to validate a stream v/s have everything
> >in-memory. (My understanding is that
> >xmlSchemaValidateStream will let me read from an input
> >stream without the need to load the entire document in
> >memory) ?
> 
> It will be available, but I don't know when; Daniel already
> has warned me not to put my nose in streaming validation until
> the schema processor is stable enough :-)

  Well, I'm plugging the streaming subset within the normal
XPath engine. It's not fully debugged yet and I will commit
once libxml2 and libxslt regression tests pass again. This may
take a couple more evenings of work. But I think you can already
use the existing pattern.h interfaces from CVS, if those APIs are
not sufficient, then yeah avoid modifying the pattern.[ch] files
at the moment, Work In Progress.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] libxml2 newbie question about the Reader API

2005-02-17 Thread Daniel Veillard
On Thu, Feb 17, 2005 at 08:59:24PM +0100, Aron Stansvik wrote:
> Hello xml readers.
> 
> Because of some peoples misuse of XML, I'm now writing a simple
> wxWidgets application that needs to process huge XML documents. I've
> tested that the libxml2 Reader API can handle the load well.
> 
> Now I want my application to give some kind of progress feedback to
> the user. Is there a way to obtain the number of bytes read when using
> a Reader obtained using the simple xmlReaderForFile() function, or
> will I have to set up my own custom I/O handlers with
> xmlReaderForIO()? I can't find any example usage of this function
> anywhere, and I having a bit of a hard time deciphering how it
> actually works. Googling for "xmlReaderForIO" only gives 10 hits (!).
> 
> My plan is to just stat() the file for it's size before processing it,
> and then use the number of bytes read to calculate progress, so all I
> need is the position in the input stream that libxml2 uses.

  There is number of simplifications in your approach, like external
parsed entities, encoding conversions.

  http://xmlsoft.org/html/libxml-parser.html#xmlByteConsumed
  From a normal parser you can call this. This is more complex
than you may think. I don't think on can get the parsr from a reader 
but the option exists.

> Greatful for any advice and examples of using custom I/O with the
> Reader API. I've looked at the custom I/O code samples at xmlsoft.org,

  It's like the I/O from other APIs !
   
http://xmlsoft.org/xmlio.html#Example2
http://xmlsoft.org/examples/index.html#InputOutput

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] libxml2 newbie question about the Reader API

2005-02-18 Thread Daniel Veillard
On Fri, Feb 18, 2005 at 12:04:43AM +0100, Aron Stansvik wrote:
> Hi Daniel. Thanks for your fast answer!
> Ah, I somehow missed that first link, thanks. The color scheme and
> layout of xmlsoft.org isn't really top-notch IMHO ;)

  matter of taste.

> Thanks again. I'll have to think this over. How would you go about
> implementing coarse progress information for a reader?

  matter of demand and priorities. Easy to do but you're the first one
requesting it, a bugzilla entry and/or a patch are the most efficient
ways to get this.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] libxml2 linker problem on Cygwin

2005-02-19 Thread Daniel Veillard
On Sat, Feb 19, 2005 at 03:53:34AM -0800, Jitesh N. Verma wrote:
> This email message is for the sole use of the intended recipient(s) and may 
> contain confidential information. Any unauthorized use; review, disclosure or 
> distribution is prohibited. If you are not the intended recipient, please 
> contact the sender by retur
> 
> Copyright  2004 MaXXan Systems, Inc. All rights reserved.

  Those terms are not compatible with the use of this mailing-list.
Either get them removed from subsequent posting here or get help 
somewhere else. We cannot comply with those terms.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Nested nodes

2005-02-20 Thread Daniel Veillard
On Sun, Feb 20, 2005 at 12:35:19PM +0200, Inbal Meir wrote:
> The contents of this email and any attachments are confidential.
> It is intended for the named recipient(s) only.

  this clause is incompatible with the use of this mailing list. Get it
removed, get another email, or get private commercial support somewhere.
  I'm more and more tempted to block emails with such clauses automatically
I said that already yesterday.

> If you have received this email in error please notify the system manager or  
> the 
> sender immediately and do not disclose the contents to anyone or make copies.

  we don't have the capacity to do this and we will expose, copy,
index and publish mails received on the list !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] using xmlTextWriterStartAttributeNS causing infinite loop

2005-02-21 Thread Daniel Veillard
On Mon, Feb 21, 2005 at 08:15:00AM -0500, Rob Richards wrote:
> When using xmlTextWriterStartAttributeNS, I am running into a stack 
> overflow as I end up in an infinite loop.
> Reduced code down to smallest example and using 
> xmlTextWriterEndAttribute makes no difference.
> 
> writer = xmlNewTextWriterFilename ("testwriter.xml", 0);
> xmlTextWriterStartElement (writer, "element");
> xmlTextWriterStartAttributeNS (writer, "prefix", "nameatt", "nsuri");
> xmlTextWriterEndElement (writer);
> xmlFreeTextWriter (writer);
> 
> When xmlTextWriterEndAttribute is hit (in this case from 
> xmlTextWriterEndElement), I get stuck in:
> while (!xmlListEmpty(writer->nsstack)) {
> 
> The nsstack doesnt get popped until after xmlTextWriterWriteAttribute 
> call, but in the meantime, xmlTextWriterWriteAttribute calls 
> xmlTextWriterEndAttribute. The only way I could figure out how to get 
> this to work was to pop it before the xmlTextWriterWriteAttribute call, 
> which also meant having to dupe the prefix and uri. On a windows box 
> right now so havent been able to run regression tests.

  Applied , doesn't seems to break, but next time ptovide patches as
attachments :-)

  thanks,

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Converting to xmlChar type

2005-02-21 Thread Daniel Veillard
On Mon, Feb 21, 2005 at 09:31:51PM +0100, Aron Stansvik wrote:
> On Mon, 21 Feb 2005 11:55:53 -0600, Thomas Jones <[EMAIL PROTECTED]> wrote:
> I think you should just be able to do:
> 
> doc = xmlParseFile(BAD_CAST GenDigSig::getGenDigSigXMLSource());
> 
> But I'm not sure it's a good idea. Could anyone more experienced
> comment on this? I'm new to libxml2 myself.

  a char * in C has no precise meaning. It's a sequence of bytes ended by 0.
You need to know the encoding of that sequence of byte to handle them 
as charecters. an xmlChar * is a 0 terminated sequence of bytes
with an UTF8 encoding. This is documented !
   http://xmlsoft.org/encoding.html

Conclusion: you can use taht direct cast if you know the string encoding
is UTF-8 (or ASCII which is a subset).

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] encoding

2005-02-22 Thread Daniel Veillard
On Wed, Feb 23, 2005 at 09:26:09AM +1100, Malcolm Tredinnick wrote:
> On Tue, 2005-02-22 at 23:26 +0200, Bar Gam wrote:
> > Hello
> 
> Hi :)
> 
> >  
> > If I try to parse a document encoded in iso-8859-8 - should it be
> > converted to UTF-8, or is it supported and handled by the parser on
> > the fly? If the content should be converted (and deconverted) - what
> > method should be used in this 
> > ?case
> 
> Providing the document encoding is correctly specified and providing you
> have Iconv support compiled in, the conversion to UTF-8 will be done for
> you automatically as libxml2 parses the document.
> 
> If the document encoding is not specified in the xml declaration at the
> top of the file (), there is a way to pass it in
> directly when using the libxml API -- this is needed because of the way
> HTTP documents have their encoding specified, for example. But I cannot
> remember the exact call off the top of my head.
> 
> You can see if you have Iconv support available by looking at the output
> of 'xmllint --version'.

  If iconv is not present all the iso-8859-[1-15] are compiled in the library 
by default so unless a very specific setup the conversion will be supported.
Anyway if the encoding is not supported, per the spec it's a fatal error
and the parser fail immediately and deliver no data.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlwriter, invalid StartElement

2005-02-23 Thread Daniel Veillard
On Wed, Feb 23, 2005 at 10:57:40AM +0100, Pierre Joye wrote:
> Hello,
> 
> Little patch to fix a xmlTextWriterStartElement after a
> xmlTextWriterStartAttribute (or NS). Works well too if a text was
> inserted in between (text seems to do not be in the state stack).
> 
> I'm not sure if it's correct to do so. For example if one uses tags in
> an attribute value? should he use text instead?

  I don't understand the writer well, but it seems to me you are right,
starting an element while in an Attribute should probably lead to an error,
same actually if you're in the middle of a comment no ?
  I don't know how C# xmlReader reacts in those case, could someone
try and provide feedback ?

  thanks,

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] libxml and threads

2005-02-23 Thread Daniel Veillard
On Wed, Feb 23, 2005 at 09:54:27AM +0100, Massimo Cafaro wrote:
> Everything works fine, but I have found that many memory leaks are 
> associated with libxml2 APIs. The leaks are small, but they are so many 
> that this is a serious problem. Now, I strongly believe that it is 
> entirely my fault, but I need to understand exactly how to use libxml2 
> in threaded applications. 

[...]
> Leak: 0x0110f690  size=48   string 'MUTX' 
> Call stack: [thread 280c000]: | 0x0 | _pthread_body | 
> thread_starter | provider_thr | grelc_get_sql | 
> xmlSAXParseMemoryWithData | xmlCreateMemoryParserCtxt | 
> xmlNewParserCtxt | xmlInitParserCtxt | xmlDefaultSAXHandlerInit | 
> __xmlDefaultSAXHandler | xmlGetGlobalState | xmlNewGlobalState | 
> xmlInitializeGlobalState | xmlInitGlobals | xmlNewMutex | malloc | 
> malloc_zone_malloc  

  The threads code is the only one which can legally do direct malloc()
without using xmlMalloc(), so it's among the memory use I won't detect
leaks in regression tests.

> It looks like a mutex object is never deallocated. 
> 
> The code looks like 
> 
> xmlDocPtr doc; 
> ... 
> 
> doc = xmlParseMemory (docname, strlen(docname) - 1); 
> ... 
> xmlCleanupParser(); 
> 
> 
> Is this the way to write this kind of code? I was not able to find any 
> example of threaded code. I have found some APIs for dealing with 
> threads tough. 

  You must make sure you made the call to the library initialization
xmlInitParser() before any call to the library in the main thread,
and make sure you never call xmlParserCleanup() unless nothing will
ever use the library or library produced data.

> mutex object and call related lock/unlock functions). The libxml2 I am 
> using is the latest one officially released on January. I am working on 
> Mac oS X 10.3.8 

  I don't use Mac oS X, I know Apple people now use libxml2 and they
should be able to track down that problem better than me. It is a
thread local storage problem and is usually platform specific. The
memory you're pointed out should be freed by xmlCleanupGlobals() 
which is called by xmlCleanupParser() and to be released only once
in the whole application lifetime. I can't see how this specific call
can lead to " many memory leaks".
  I.e. I looked at your problems but don't see how this could lead to
what you are describing.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] libxml and threads

2005-02-23 Thread Daniel Veillard
On Wed, Feb 23, 2005 at 11:55:41AM +0100, Massimo Cafaro wrote:
> On Feb 23, 2005, at 11:38 AM, Daniel Veillard wrote: 
> > > Leak: 0x0110f690  size=48   string 'MUTX'  
> > > Call stack: [thread 280c000]: | 0x0 | _pthread_body |  
> > > thread_starter | provider_thr | grelc_get_sql |  
> > > xmlSAXParseMemoryWithData | xmlCreateMemoryParserCtxt |  
> > > xmlNewParserCtxt | xmlInitParserCtxt | xmlDefaultSAXHandlerInit | 
> > >  
> > > __xmlDefaultSAXHandler | xmlGetGlobalState | xmlNewGlobalState |  
> > > xmlInitializeGlobalState | xmlInitGlobals | xmlNewMutex | malloc 
> > > |  
> > > malloc_zone_malloc   
> > > 
> >  
> >   The threads code is the only one which can legally do direct 
> > malloc() 
> > without using xmlMalloc(), so it's among the memory use I won't 
> > detect 
> > leaks in regression tests. 
> > 
>  
> I do not understand this. What is exactly what you call threads code? 

   code from libxml2 thread.c module.

> The leaks originates in the xmlParseMemory() function, which is called 

   No. The leak originate when the application wide thread mutex is
 allocated. The fact it comes from xmlParseMemory() is just that you did
not initialize the libxml2 module as explained 
1/ in the docs
   http://xmlsoft.org/threads.html
   "call xmlInitParser() in the "main" thread before using any of the
libxml2 API (except possibly selecting a different memory allocator)"
   obviously you are not doing this otherwise that mutex would
   have been allocated by the time you call xmlParseMemory()
2/ in my previous mail

> in my application many times in many threads. I do not know exactly how 
> do you check for leaks, I am using a standard tool on Mac OS X. May be 
> it is worth saying here that the leaks are exactly the same on linux, 
> as detected by valgrind. 

  Then your code is likely in error, very first thing is to follow the
documentation about thread safety ! Then come back with a complete
example reproducing the problem on Linux, not 3 lines out of context.

Daniel



-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlParseFile;encode - newbie question

2005-02-23 Thread Daniel Veillard
On Wed, Feb 23, 2005 at 12:55:40PM +0200, Pieter Louw wrote:
> xml data:
> 
> 
> Murray & Karl
> 

  this is not XML. You cannot parse this with an XML parser, it must
raise an error and not deliver data. Whatever generating this must be fixed.

  You probably need
Murray & Karl

  this is not specific to libxml2.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] libxml and threads

2005-02-23 Thread Daniel Veillard
On Wed, Feb 23, 2005 at 12:26:32PM +0100, Massimo Cafaro wrote:
> May be there is a little misunderstanding here. 
> I said in my first email that it is entirely my fault the problem I am 
> experiencing because I am new to the use of libxml2. 
> I did not say that libxml2 code leaks memory. I want to make clear 
> again that its is my responsibility, not yours. 

  As I said, since that specific part of the code use malloc()
directly and not the wrappers, it is possible to have a leak there
that went unnoticed, though it is unlikely. Hence my request for
a reproduceable test case in case you still get the problem after
following the suggestions.

> I can only say thanks for your suggestions. Unfortunately I did not 
> find a detailed documentation on the web site. This is actually a pity 

   That is not normal, really, if you go to the web site:
 http://xmlsoft.org/
 in the left menu, the link in bold "Developer Menu" should really
 raise your attention, then once there
 http://xmlsoft.org/docs.html
 the item "Thread safety" should really be obvious too
 http://xmlsoft.org/threads.html
 and you get to the page with the advices

  Do you remember what step you missed to get there ?

> since I firmly believe that libxml2 is a great achievement, but its 
> complexity makes it difficult to use it correctly ( I have been 
> developing unix apps for almost 20 years, including of course threaded 
> apps, so I now exactly what kind of problems can occur). 

   So you should not be surprized that a library which maintains state
need to have a initialization routine called in the main thread before
further processing.

> Thanks again, 

   No problem.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlwriter, invalid StartElement

2005-02-23 Thread Daniel Veillard
On Wed, Feb 23, 2005 at 08:45:53AM -0500, Rob Richards wrote:
> C# will close off the attribute and start a new element. libxml on the 
> other hand is putting the element as the attribute value.
> 
> Attached is a patch to check for the attribute state in 
> xmlTextWriterStartElement as well as fix a ns reversal from last patch 
> for xmlTextWriterEndAttribute.

   Do :-)
 Okay applied and commited,

   thanks !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlParseFile;encode - newbie question

2005-02-24 Thread Daniel Veillard
On Thu, Feb 24, 2005 at 03:59:51PM +0200, Pieter Louw wrote:
> #The cleanest way I can think of to handle this
> #is to have a "forgiving" mode for libxml2 that treats bad entity references
> #as plain text.
> 
> Is there currently a feature available to put the parser in "forgiving" 
> mode?

  Yes but you MUST fix the problem on input. Especially for this kind
of stupid, obvious brokeness. I'm horribly serious about this, and
there is no garantee I will keep that mode available except for a couple
of API calls purely dedicated to recovery in the future.
  You are warned, I already stated the input must be fixed, and you
must not rely on libxml2 to work around XML well-formedness errors,
if I see this being abused I will just drop the support, I hope this
is cristal clear.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] windows multi-threading

2005-02-24 Thread Daniel Veillard
On Thu, Feb 24, 2005 at 09:33:11AM -0500, Rich Salz wrote:
> In threads.c for the windows platform it might be better to use
> InterlockedIncrement on run_once_init so that you get better pthread_once
> semantics.  See this link for details
> http://pluto.cdpa.nsysu.edu.tw/sourceware/pthreads-win32/sources/pthreads-snap-2005-01-25/pthread_once.c

  Can you generate a patch ?

thanks,

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] windows multi-threading

2005-02-24 Thread Daniel Veillard
On Thu, Feb 24, 2005 at 10:15:58AM -0500, Rich Salz wrote:
> >   Can you generate a patch ?
> 
> Sure, attached.  Untested.  The code now looks similar to the beos code.

  Hum, I can't test it, it didn't broke on Linux, I commited I hope
someone can give it a try on Windows,

  thanks,

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] windows multi-threading

2005-02-24 Thread Daniel Veillard
On Thu, Feb 24, 2005 at 12:25:55PM -0500, Rob Richards wrote:
> Here's the revised patch.

  Okay, applied and commited,

   thanks !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlParseFile;encode - newbie question

2005-02-27 Thread Daniel Veillard
On Fri, Feb 25, 2005 at 01:14:01PM -0800, Fred Smith wrote:
> 
> Pardon the top-post, stupid mailer won't properly quote replied-to
> mails.
> 
> Regarding the OP's question, How about xmlEncodeEntitiesReentrant() ??
> Seems to do the job for me

  if you have a string, yes it will escape the predefined entities

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Can't install libxslt

2005-02-28 Thread Daniel Veillard
On Fri, Feb 25, 2005 at 07:38:28PM -0500, Paul Tremblay wrote:
> I've tried installing libxslt, and keep getting this error:
> 
> checking for libxml libraries >= 2.6.8... configure: error: Version 2.4.23 
> found. You need at least libxml2 2.6.8 for this version of libxslt
> 
> But I've downloaded libxml2 2.6.8 and compiled it successfully from
> source. When I look in /usrl/local/lib, I see:

  it's teh output of the xml2-config script which is used to
detect the installed version and parameters. You have to fix the 
one used.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Invalid namespace definitions after namespace change

2005-02-28 Thread Daniel Veillard
On Mon, Feb 28, 2005 at 01:14:56PM +0100, Kasimier Buchcik wrote:
> >For my needs that is still unacceptable. I implement an XMPP
> >implementation and for backward-compatibility with many Jabber clients
> >I need to use default namespaces (no prefixes) in some places.
> 
> I see, OK so you need total control of the declarations.

and as I pointed out in my answer to 
  http://bugzilla.gnome.org/show_bug.cgi?id=168764
you must be able to embbed XML instances in XMPP messages, those 
instances may use namespaces in attribute content or text nodes, and
the suggested API would just break XMPP completely.

> >
> >I think a function to remove (or override) namespace declaration from
> >a node is what I need and I will request it via Bugzilla.
> 
> Exactly.
> 
> [1] 
> http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/namespaces-algorithms.html

  DOM and libxml2 are completely different because in libxml2 the namespace
informations are shared, if you modify the namespace node you instead of just
changing the anmespace pointer then you:

1/ don't have to chase all the other nodes to make the same change
2/ don't need to creat new namespaces node and try to track and remove
   the old namespace informations

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlSetExternalEntityLoader in python api

2005-03-01 Thread Daniel Veillard
On Tue, Mar 01, 2005 at 02:14:52PM +, dunk wrote:
> hello,
>   i need to use to xmlSetExternalEntityLoader from python but it appears
> to be missing. I attempted to edit the xml api file but to no avail.
> Could this be added please?

  I suggest you read existing examples like tests/resolver.py
to use the existing resolver APIs from python.

> I tried adding this:
>   
>   
>   
>   
> 
> but importing libxml2 from python then results in a missing symbol error
> complaining about libxml_xmlSetExternalEntityLoader. Are there any docs
> about how to use this file?

  No doc, you still need to code C bindings, the .xml just advertize
that API.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] conversion problem

2005-03-02 Thread Daniel Veillard
On Tue, Mar 01, 2005 at 11:07:49PM -0800, dan berry wrote:
> I parsed the document, using htmlParseDoc (without encoding information)
> 
> The document was converted to utf-8 while the parsing process.
> 
> The problem is reconverting it to its original encoding (The output contains 
> unreadable characters).
> 
>  
> 
> I use the following functions for output handle; do I miss something? Does 
> the original encoding should be saved by the user for reconverting?

  http://xmlsoft.org/html/libxml-tree.html#xmlDocDumpMemoryEnc
  Notice the parameter
txt_encoding: Character encoding to use when generating XML text

Daniel


-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] dumping XML file question

2005-03-03 Thread Daniel Veillard
On Thu, Mar 03, 2005 at 10:18:45AM +0100, Kenneth Østby wrote:
>  xmlDocFormatDump(xml,doc,0);
>  fflush(xml);
>  fclose(xml);
>  free(xml);

  Stop here, you already have a double free of a libc structure !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlwriter, flush file buffer

2005-03-03 Thread Daniel Veillard
On Thu, Mar 03, 2005 at 11:00:27AM +0100, Pierre Joye wrote:
> Hello,
> 
> I'm a bit confused with xmlTextWriterFlush (simple wrapper around
> xmlOutputBufferFlush).
> 
> I expected it to flush the IO and not only to flush the buffer to the
> IO. After a short review, it seems that xmlFileFlush should be called
> as well. Actually the buffer is just pushed out, and no system flush
> is done. xmlFileFlush being called only using the closecallback
> (default callback).
> 
> Is it the expected behiavior?
> 
> The problem is basically the same as described here:
> http://www.mail-archive.com/xml@gnome.org/msg00140.html
> 
> My problem is that I have to mess up directly with the IO when using
> the libxml IO implementation.

  You can't call directly xmlFileFlush() from xmlOutputBufferFlush()
you must use one of the I/O callbacks. And it does call out->writecallback()
there is no "flush" notion at that level of the I/O stack.
  xmlOutputBufferFlush() means the data in the buffers are written to the
I/O, if you want a synchronous write then you should use an I/O open in
that mode.
  Checking for out->closecallback == xmlFileFlush and calling it in that
case might be doable, but a close is not a flush semantically.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Delphi bindings now available for XMLSec

2005-03-04 Thread Daniel Veillard
On Fri, Mar 04, 2005 at 02:49:43PM +1100, [EMAIL PROTECTED] wrote:
> I have generated Delphi bindings for the XMLSec library
> (specifically aimed at providing an interface to the Win32
> libxmlsec DLL distributed by Igor). These bindings are available
> (along with Delphi bindings for libxml2, libxlst, and libexslt) at
> ftp://ftp.zlatkovic.com/pub/libxml/Delphi. I have placed copies on the CVS

  Strange, my mirror of ftp://ftp.zlatkovic.com/pub/libxml on
ftp://xmlsoft.org/win32/ didn't pick the Delphi subdirectory.
And right now the FTP service is full :), I hope it will mirror
later today.

   thanks !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] about libxml2

2005-03-04 Thread Daniel Veillard
On Fri, Mar 04, 2005 at 05:10:06PM +0800, [EMAIL PROTECTED] wrote:
> hi gnome,
> 
> pardon my liberty, I like libxml very much, and It facilitate my work. But It 
> does
> not support xquery now, I want to know if it will be soon?

  xquery makes sense mostly if you have an underlying database. I do not
plan to implement XQuery in libxml2. People who might want to implement it
on top of libxml2 are free to do so.
  XQuery is not complete, it is still a W3C Working Draft.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Nested nodes

2005-03-07 Thread Daniel Veillard
On Mon, Mar 07, 2005 at 12:09:13AM -0800, dan berry wrote:
> Is there an api for checking if one node is nested in another node (without 
> going over the tree structure and check each node)?

  Hum, no. just walk the ->parent list,

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Memory not going away..

2005-03-08 Thread Daniel Veillard
On Tue, Mar 08, 2005 at 03:35:30AM -0500, David W. Bauer Jr. wrote:
> I have a simple test script I am using to my code:
> 
> int
> main(int argc, char **argv, char **env)
> {
> xmlDocPtr   document_network = NULL;
> xmlXPathContextPtr ctxt = NULL;
> 
> xmlXPathInit();

   you should initialize the library instead, not just XPath

> xmlSetDocCompressMode(document_network, 9);
> document_network = xmlParseFile("network.xml");
> ctxt = xmlXPathNewContext(document_network);
> 
> xmlXPathFreeContext(ctxt);
> xmlFreeDoc(document_network);
> xmlCleanupParser();
> xmlMemoryDump();

   what do you have in .memdump ?

> return 0;
> }
> 
> If I run this in gdb and break on the return statement, then view the
> memory usage in top, ps or /proc, I notice that the memory usage does not
> go away.
> 
> I am using a 300GB file, and the parser is requiring about 3GB if
> RAM.  Sorry if this is a simple oversight on my part, but I could not find
> the solution in the code examples or online archive.

   depends how the memory allocator works, ps or to report the amount used
by the process not by the library. Try to malloc 3GB of ram in small chunks,
fill them with data, then free() them, without even using libxml2. My bet
is that you will see the same result.
   What the library really allocates or free should be listed in your
.memdump assuming you compiled the library with memory debug 
 http://xmlsoft.org/xmlmem.html#Debugging

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Memory not going away..

2005-03-08 Thread Daniel Veillard
On Tue, Mar 08, 2005 at 12:04:51PM -0500, David W. Bauer Jr. wrote:
> I re-compiled with --mem-debug and this is the contents of .memdump:
> 
>   11:47:59 AM
> 
>   MEMORY ALLOCATED : 0, MAX was 222911016
> BLOCK  NUMBER   SIZE  TYPE
> 
> 
> That's it. 

  okay, perfect, libxml2 released with free() all the memory it allocated
with malloc().

> Also, I wrote a quick test to verify what I thought to be
> true.. that is that Linux reports the memory correctly as you alloc/free.
> I tested both calloc and malloc and top, ps and /proc were all correct.
> 
> I think that have some not configured properly since memdump is empty.

   no, no... allocated is 0, free() had been called correctly for all
chunk of memory.

> Also, does it sounds correct that the parser requires 10 times the XML
> file size in memory?  That is just something I noticed.

   Not the parser, the DOM tree, yes that's possible depending on the
ratio of data to markup.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Memory not going away.. SOLUTION

2005-03-08 Thread Daniel Veillard
On Tue, Mar 08, 2005 at 01:01:26PM -0500, David W. Bauer Jr. wrote:
> 
> Recall I had:
> 
> xmlXPathInit();
> document_network = xmlParseFile(filename);
> ctxt = xmlXPathNewContext(document_network);
> 
> xmlXPathFreeContext(ctxt);
> xmlFreeDoc(document_network);
>   xmlCleanupParser();
> xmlMemoryDump();
> 
> The solution:
> 
> xmlXPathInit();
> document_network = xmlParseFile(filename);
>   ctxt = xmlXPathNewContext(document_network);
> 
> xmlXPathFreeContext(ctxt);
> xmlCleanupParser();
> xmlFreeDoc(document_network);
> xmlMemoryDump();
> 
> Notice that I need to cleanup the parser prior to freeing the document.

  Makes absolutely no sense. xmlCleanupParser() is a library wide
memory deallocation, you should not call it while you had document allocated
since they could now point to freed area (example predefined entities).
I think your methodology of test is wrong, and the programming way of
trying anything until it seems to work to not be better. Read the doc
dor xmlCleanupParser() it is very clear you should not do this.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Memory not going away..

2005-03-08 Thread Daniel Veillard
On Tue, Mar 08, 2005 at 05:32:20PM -0500, David W. Bauer Jr. wrote:
> Yes, but then I should be able to get that memory back in future calls to
> (m/c)alloc.  The real problem I am fighting with here is that my XML files
> are large (10^8 bytes), and I am unable to parse the entire file with
> xmlParseFile _and_ create my data structures.  I realize that I should be
> using some form of reader, but all I really need is for the xmlDoc to
> release the memory on calls to xmlFreeDoc.. which, it is still not doing
> after all this time.

   it *does*  Take a debugger and put a breakpoint in your free()
routines, you will see that it is called :-(

> I wrote a test script which tests the basic behaviour, and the doc is

   The testing methodology is flawed, the libc memory allocation routine
may just compact and free the extra heap because you just added more calls
to malloc() or free().

> freed.. but when I carry over the solution to my code, the file will not
> go away.  The .memdump IS listing items now, and I am struggling to figure
> out why these objects are not being removed.
> 
> Coincidentally, if I have system with 3 GB of RAM, and I allocate and free
> 3GB of ram in my process, but then do not exit.. any other processes would
> be forced into swap waiting for my process to complete and free up
> resources (namely, 3GB of RAM).  In Linux, calls to free in the process
> return the memory to the OS.

   not instantly, this is wrong, you don't get a syscall per call to free().
There is something else going on, I can't tell what, and I suspect your
testing methodology based on OS lookup to not match what happen at the
libc interface.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] thoughts?

2005-03-08 Thread Daniel Veillard
Speaking for myself and not for anybody else in the project or elsewhere.

On Tue, Mar 08, 2005 at 11:47:56AM -0800, Rick Jones wrote:
> http://veillard.com/nohelp.html

  It's my choice so far because I have been extremely annoyed by this
issue. It doesn't imply any change in Licence or something of that order
just that I don't feel like giving my time away for companies which on
the other hand bite me by paying lawyers and lobbyist to threaten my
programming freedom. If you are using libxml2 it is because that freedom
existed in the first place don't remove it! If you are using libxml2 for
an open source project I will of course help you !
  I may cool down or find a better way to express those companies how
much I'm annoyed (if you have ideas, I welcome them privately at
[EMAIL PROTECTED]) in which case it will be just temporary. I am feeling
at risk, I do feel libxml2 and the whole project potentially at risk due
to this action, and I feel I must not let this go unnoticed.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Memory not going away.. SOLUTION

2005-03-08 Thread Daniel Veillard
On Tue, Mar 08, 2005 at 05:43:22PM -0500, David W. Bauer Jr. wrote:
> Ok, I have provided the simplest of examples, and cannot account for why
> this is so either, but that doesn't change the fact that it is so.

  I can prove libxml2 actually free the memory. Use 
xmllint --repeat --noout network.xml

it will parse the tree, free it with xmlFreeDoc and repeat the
two operations in a loop 100 times. If it does not call() free
accordingly then your system will swap and the xmllint process will
dies due to the out of memory kernel killer.

  Anyway loading a 300MB instance in memory to then build your own
structures reslly does not make sense, use the reader for this really.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Memory not going away..

2005-03-08 Thread Daniel Veillard
On Tue, Mar 08, 2005 at 05:52:09PM -0500, David W. Bauer Jr. wrote:
> One thing that I should mention is that the memory is NOT being released.
> I know this for a fact becuase my application goes on (afer freeing the
> xmlDoc) and allocates until the 3GB limit is reached.
> 
> So, what I see is this:
> 
>   read / parse the file
> 
>   --> memory consumed goes to 2.9GB
> 
>   free the xmlDoc
> 
>   --> memory consumption reported is still the same
> 
>   alloc .1 GB more data structures, then malloc fails due to
>   process memory limit.
> 
> So, the xmlDoc is NOT being freed in any way.

  My experience:
dba10.xml in the XML directory is 20 MBytes
parsed as a DOM tree it uses 100MB of memory
xmllint --repeat --noout dba10.xml
stay at 105MB memory usage in top looping 
  parsing/freeing
my desktop has 512MB and didn't even swap during the experiment.
System is libxml2 from CVS on an RHEL4 AS system.

I cannot reproduce your problem, or your problem is with the memory allocator
of the linux system you used.

> The purpose of the test case was to determine if the system would report
> the memory being freed with _fewer_ calls to the memory library, which is
> a valid approach since it isolates only the problem being addressed.  If I
> were to read/free the doc, then attempt to allocate more memory, it fails
> since the doc is still in memory.

  The document is being freed. libxml2 call free() unless somewhere
somthing changed the behaviour of xmlFree() in your program.

> One major difference is that I am now getting info in the .memdump file,
> which I did not get in my test script:

[...]
>   MEMORY ALLOCATED : 32092, MAX was 212704970

  libxml2 gave back the 2.1 GB of memory to the libc, it just has 
32 KBytes left.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] XSchema and libxml

2005-03-09 Thread Daniel Veillard
On Wed, Mar 09, 2005 at 05:16:46PM +0100, Christian HAESSIG wrote:
> Hi people,
> 
> I have a question about the XSchema integration in the library.
> Is it possible to get and validate a xml file having a reference to its
> schema in it ?

  I think it's possible, you need to create the shemas context with a
NULL URL, Kasimier should know more precisely.

> 
> Subsidiary question : does anyone have a little code/example for doing this
> ?

  if there is such an example I would add it to the example section

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] http_proxy

2005-03-09 Thread Daniel Veillard
On Thu, Mar 10, 2005 at 09:04:09AM +1100, Robert Turnbull wrote:
> G'day,
> 
> I know libxml2 reads in the http_proxy environment variable but I don't 
> think it understands it if the environment variable has the form:
> 
> http_proxy=http://username:[EMAIL PROTECTED]:port
> 
> Which is the format for wget.

  libxml2 HTTP support is minimal (nanohttp) and the goal really 
was to keep it that way. as soon as you add authentication, well
it is more complex than what I think should be done in libxml2,
the I/O architecture of libxml2 is open, you can replace HTTP
default with for example curl if you want a better and more complete
implementation.
   http://xmlsoft.org/html/libxml-xmlIO.html

  If it is mostly for validation, then the best is to store the
required DTDs or schemas in a local catalog and avoid using the
network altogether (though without changing the input files).
   http://xmlsoft.org/catalog.html

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Problems with the "decimal" definition of a RELAX NG XSD on the Solaris 2.8 platform during validation using xmllint

2005-03-09 Thread Daniel Veillard
On Thu, Mar 10, 2005 at 04:39:28PM +1100, [EMAIL PROTECTED] wrote:
> Hi All,
> 
> I have a RELAX NG XSD that uses a 'decimal' definition. I am validating an
> XML document using xmllint but I get unexpected errors.  Libxml2 is running
> on Solaris 2.8 with the following version of libxml2:
> 
> /usr/local/bin/xmllint: using libxml version 20616
>compiled with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer XInclude
> Iconv Unicode Regexps Automata Schemas
> 
> If I use a decimal like this '130.480907024' then there are no errors but if
> I extend the number of decimal points like this '130.48090702489' then I get
> the following error:
> 
> "
> ANZNT078240.xml:61: element eastbc: Relax-NG validity error : Error
> validating datatype decimal
> "
> 
> It seems to me that the precision of the 'decimal' definition in the
> libraries is causing the problem.  The problem doesn't occur on LINUX or MAC
> platforms.  The funny thing is that Solaris 2.8 is a 64 bit system.  Can
> anyone help me with this?
> 
> The RELAX NG XSD is located at
> http://asdd.ga.gov.au/asdd/tech/relaxng/anzmeta-1.3.1.rng and the XML
> document instance is at http://asdd.ga.gov.au/asdd/work/ANZNT078240.xmlm
> if that helps anyone.

  Hum, annoying ! It probably is just a matter of getting someone with
a Solaris 8 box (on sparc64 I assume) to go though dbx and check what
is happening there. I can't do that myself, could you open a bugzilla
entry about this and attaching the examples ? 

 thanks,

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] minor declaration fixes for xpath2.c and xmlregexp.c in 2.6.17

2005-03-10 Thread Daniel Veillard
[ could you check your list subscription, I need to manually approve all
  your mails, thanks ]

On Wed, Mar 09, 2005 at 11:30:36AM -0800, Rick Jones wrote:
> which seems to stem from the forward declaration of usage being static, but 
> the actual definition not:

  okay fixed, thanks.

>  cc -DHAVE_CONFIG_H -I. -I. -I. -I./include -I./include -D_REENTRANT -g 
> -Wp,-H3 -c xmlregexp.c -Wp,-M.deps/xmlregexp.TPlo  +Z -DPIC -o 
> .libs/xmlregexp.o
> cc: "xmlregexp.c", line 3350: warning 604: Pointers are not 
> assignment-compatible.
> cc: "xmlregexp.c", line 3350: warning 563: Argument #5 is not the correct 
> type.
[...]
> Where the code is:
> 
> #ifdef DEBUG_ERR
> static void testerr(xmlRegExecCtxtPtr exec) {
> const xmlChar *string;
> const xmlChar *values[5];
> int nb = 5;
> int nbneg;
> int terminal;
> xmlRegExecErrInfo(exec, &string, &nb, &nbneg, &values[0], &terminal);
> }
> #endif

  DEBUG_ERR should not be defined and that code should not be compiled
by default it was a packaging mistake :-\

> I'm guessing that since values is not assigned before calling 
> xmlRegExecErrInfo it is indeed expecting the call to make a change to the 
> values in values[0] and so the fix would be to drop the const:
[...]
> but that was just a guess and could easily be wrong.

   the array is not const, but the objects pointed by the array pointers
should be const. Not a big deal.

> That takes care of 11.11 compilation - I didn't yet try a run.  There are 
> some other things on 11.23 IPF (aka Itanium aka IA64) that probably belong 
> under separate cover.  They likely relate to there being no shl_load call 
> for HP-UX IPF binaries - dlopen et al being the calls used.  Dlopen et al 
> are also available on later HP-UX PA-RISC releases, so it may be a matter 
> of tweaking some configure stuff.

  sure, send more patches :-), could be a good idea to use the cvs
checkout version for further patches 
   ftp://xmlsoft.org/libxml2-cvs-snapshot.tar.gz

thanks !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Probably should not look for/use shl_load if dlopen is found (2.6.17)

2005-03-10 Thread Daniel Veillard
On Wed, Mar 09, 2005 at 11:51:22AM -0800, Rick Jones wrote:
> On some HP-UX systems, both dlopen and shl_load are present.  The 2.6.17 
> configure script seems to look for both of them and then xmlmodule.c does 
> not prefer one over the other.
> 
> When both shl_load and dlopen are present, we get duplicate definitions of 
> the routines and that makes the compiler rather unhappy :)
> 
> I'm not sure which would be better - only have configure look for shl_load 
> if it does not find dlopen, or modify the #ifdefs in xmlmodule.c such that 
> the shl_load stuff is nested in an #else from the HAVE_DLOPEN.  This patch 
> does the latter - as much because I didn't have autoconf installed on the 
> HP-UX system as anything else :)
> 
> # diff -c  xmlmodule.c.orig xmlmodule.c

  okay, makes sense. I made the changes, thanks !
  BTW patches are better sent as mail attachments so they don't
get messed up by the transport layers.

thanks 

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlTextReaderNext skipping nodes

2005-03-10 Thread Daniel Veillard
On Thu, Mar 10, 2005 at 07:13:05AM -0500, Rob Richards wrote:
> Attached is a patch for this. Testing for the XML_TEXTREADER_BACKTRACK 
> state is correct.

  Thanks, applied and commited. Unclear how to best check this in the
regression tests, maybe as a Python script ?

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlTextReaderNext skipping nodes

2005-03-10 Thread Daniel Veillard
On Thu, Mar 10, 2005 at 08:56:19AM -0500, Rob Richards wrote:
> After a crash course in Pthon - its been a very long time - I threw 
> together this test based on some of the other pyton reader tests.

  Thanks a lot, seems to work fine, integated in the test suite !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] Probably should not look for/use shl_load if dlopen is found (2.6.17)

2005-03-10 Thread Daniel Veillard
On Thu, Mar 10, 2005 at 09:43:12AM -0800, Rick Jones wrote:
> >># diff -c  xmlmodule.c.orig xmlmodule.c
> >
> >
> >  okay, makes sense. I made the changes, thanks !
> >  BTW patches are better sent as mail attachments so they don't
> >get messed up by the transport layers.
> 
> (BTW, I changed my subcription to [EMAIL PROTECTED] from 
> [EMAIL PROTECTED], so the approval stuff should no longer be an issue - 
> noticed it when I saw the delays.)
> 
> Inline vs attachements - every project seems to go differently there :( 
> Some lists strip attachments, hard to keep it striaght which is which.  All 
> thanks to that OS that can't seem to ever shake a cold (virus)... sigh.  
> I'll try to remember to do attachments in the future.

  okidoc, thanks !

> So, with those patches I get clean compiles for both 32 and 64-bit 11.11 
> and 11.23 IPF.  I can though generate beaucoup warnings if I enable all 
> warnings and migration (32 to 64-bit) warnings.  The bulk of them seem 
> harmless (having waded through them briefly) and some look like the 
> compiler being overly paranoid, but some may be of interest.  Would you 
> like to see the entire list (as an attachment of course :)?

  there was a guy from cea.fr who was posting all warning obtained 
by compiling on Solaris or HP-UX in bugzilla, good to have them there
and try to cleanup between releases, so yes sure !

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlReadMemory limitation

2005-03-11 Thread Daniel Veillard
On Fri, Mar 11, 2005 at 08:26:51AM +0100, Espen Ekeroth wrote:
> On RedHat 9 i do get a problem using xmlReadMemory(). It seems like if the 
> memory buffer size is set to a value larger than 60 it do fail. (no 
> coredump or anything, but the application just dies). Is this a limit of 
> xmlReadMemory ?

  xmllint.c uses xmlReadMemory() for processing with --memory

paphio:~/XML -> ls -l dba10.xml
-rw-rw-r--  1 veillard www 14282040 Jan  4 16:06 dba10.xml
paphio:~/XML -> xmllint --noout --memory dba10.xml
paphio:~/XML -> echo $?
0
paphio:~/XML ->

  i.e. I cannot reproduce your problem on Red Hat Enterprise Linux 4.

> or is it the infamous 640kb problem of x86 also affecting 
> linux?

  Certainly not, linux uses flat 32bit addressing and not 16bit
segmented memory accesses !!!

> This e-mail and the information it contains may be privileged and/or
> confidential.  It is for the intended addressee(s) only.
> The unauthorised use, disclosure or copying of this e-mail, or any 
> information it contains, is prohibited. 
> If you are not an intended recipient, please contact the sender and delete 
> the material from your computer.

  This notice is incompatible with the usage of the mailing list,
we will copy archive and redistribute copies of mails sent to the list
to anybody in the Internet. Remove it or unsubscribe this 
address from this list :-(

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlReadMemory limitation

2005-03-11 Thread Daniel Veillard
On Fri, Mar 11, 2005 at 10:31:03AM +0100, Espen Ekeroth wrote:
> Could it be my use of the function: It looks like this:
[...]
> doc = xmlReadMemory(a_node->content, 40, "noname.xml", NULL, 0);
[...]
> The reason for using it like this is that the xml is recevied through the 
> csoap library from a JBoss webservice.
> 
> I have tried to do it useing "sizeof(a_node->content)" but for some reason 
> I only get 4 as the size (looks like the size of the adress.  [I have also 
> tried to get the content first using the xmlNodeGetContent() function, but 
> the result was the same]

you must pass the length of the string buffer. You know that a_node->content
is an UTF-8 string so you can use strlen() to extract the size and pass it
down.
  doc = xmlReadMemory(a_node->content, strlen(a_node->content),
      "noname.xml", NULL, 0);

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlReadMemory limitation

2005-03-11 Thread Daniel Veillard
[Cc'ing back the list because it is a serious issue and I want this
 to be clear and archived ! ]

On Fri, Mar 11, 2005 at 10:32:26AM +0100, Espen Ekeroth wrote:
> About you comment on our "note" in the mail - I have no possible way to 
> remove it since our mail server is adding it.not my client.

   Then that mean that the legal branch of your company refuses you
the right to represent said company in this open source development
project, use a different email address, use Gmail, Yahoo mail, or whatever
but not your company email services to correspond with us.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlReadMemory limitation

2005-03-11 Thread Daniel Veillard
On Fri, Mar 11, 2005 at 10:46:42AM +0100, Espen Ekeroth wrote:
> I have tried this, but the result i 4 bytes. Looks like the size of the 
> adress.

makes absolutely no sense to me, contradict both my knowledge of C
and of the library. Use a debugger to see what's going on !

> This e-mail and the information it contains may be privileged and/or
> confidential.  It is for the intended addressee(s) only.
> The unauthorised use, disclosure or copying of this e-mail, or any 
> information it contains, is prohibited. 
> If you are not an intended recipient, please contact the sender and delete 
> the material from your computer.

  Once again post from somewhere else, legally your mails put us in danger
I do NOT want to expose the GNOME project to potential legal attacks from
the lawyers of your company :-(, I'm horribly serious about this ! We do
the code, we help and all you give back is to threaten us, this is absolutely
intolerable, and I will not tolerate this anymore !!! Is that clear ?

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


Re: [xml] xmlReadMemory limitation

2005-03-11 Thread Daniel Veillard
On Fri, Mar 11, 2005 at 10:55:48AM +0100, Espen Ekeroth wrote:
> ok: I will use another mailing address "[EMAIL PROTECTED]"

  thanks,

> But if you do read the legal notice it says:
> 
> > This e-mail and the information it contains may be privileged and/or
> > confidential.  It is for the intended addressee(s) only.
> 
> As I see it: it si actually sendt to the list -> it is intended to the 
> list -> to the public.

  the list is a set of email adresses, nothing in the legal note 
says it means that it's "the public", just the opposite actually
the purpose of the text is explicitely to forbid to anybody in that
set of recipient to pass it outside the list. And we absolutely need
to do that for the Internet archives of an open-source project.

> Just for info: out company is on its way to be a RedHat partner.

   Great, maybe they will then be receptive about the point that this
legal text prevent representation of the company in Open Source projects
at least on the libxml2/libxslt.
   Thanks for using a different address until this get fixed.

Daniel

-- 
Daniel Veillard  | Red Hat Desktop team http://redhat.com/
[EMAIL PROTECTED]  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/
___
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml


  1   2   3   4   5   6   7   8   9   10   >