[xml] xmllint readline with --shell

2011-01-20 Thread Sylvain Pointeau
Hi, I am on macosx and I tried to recompile the latest libxml2-2.7.8 with the readline support for having the history when using xmllint --shell I tried with this command line: LDFLAGS="-L/usr/local/lib" CFLAGS="-L/usr/local/include -L/usr/local/include/readline" ./configure --with-readline but

Re: [xml] xmllint readline with --shell

2011-01-23 Thread Sylvain Pointeau
> > I tried with this command line: > LDFLAGS="-L/usr/local/lib" CFLAGS="-L/usr/local/include > -L/usr/local/include/readline" ./configure --with-readline > > There is a mistake in the configure --help we activate readline by --with-history which is not documented in the configure help. so the rig

[xml] create node from a string (with xml elements inside)

2011-04-19 Thread Sylvain Pointeau
Hi, I would like to modify an existing xml file by adding a set of nodes but passed as a parameter to a program like ./modify myxml.xml "//this_element_xpath" "hello" but I didn't find any method to create a node(-set) from a string, Does it exist? I tried xmlNewChild with the node name "mynode"

Re: [xml] create node from a string (with xml elements inside)

2011-04-19 Thread Sylvain Pointeau
Hello again, I did it with parsing a doc in memory like const char * xml = "hello"; xmlDocPtr doc_fragment = xmlReadMemory(xml, strlen(xml),"noname.xml",NULL,0); xmlNodePtr root_node = xmlDocGetRootElement(doc_fragment); xmlNodePtr new_node = xmlDocCopyNode (ro

Re: [xml] create node from a string (with xml elements inside)

2011-04-30 Thread Sylvain Pointeau
> > > I would rather suggest you use xmlParseInNodeContext() for this, > see include/libxml/parser.h > http://xmlsoft.org/html/libxml-parser.html#xmlParseInNodeContext > > You will get back a node list to place at that location, it doesn't > try to insert automatically. > > I followed your rec

[xml] xmlOutputBufferCreateFile VS2015 I/O error : Bad file descriptor

2016-04-16 Thread Sylvain Pointeau
Hello, porting my program on windows, I noticed that xmlOutputBufferCreateFile raised a message I/O error : Bad file descriptor. Below is the sample program that crashes for me: FILE *f = fopen("C:\\myfolder\testdata.xml", "w"); xmlOutputBufferPtr output = xmlOutputBufferCreateFile(f, NULL); x

Re: [xml] xmlOutputBufferCreateFile VS2015 I/O error : Bad file descriptor

2016-04-16 Thread Sylvain Pointeau
Hello, using xmlOutputBufferPtr output = xmlOutputBufferCreateFilename("C :\\myfolder\testdata.xml", 0, 0); works... what can be wrong with xmlOutputBufferCreateFile? Best regards, Sylvain On Sat, Apr 16, 2016 at 10:23 AM, Sylvain Pointeau < sylvain.point...@gmail.com>

Re: [xml] xmlOutputBufferCreateFile VS2015 I/O error : Bad file descriptor

2016-04-16 Thread Sylvain Pointeau
4 C++ libxml2.dll!fflush(_iobuf * stream) Line 94 C++ libxml2.dll!xmlFileFlush(void * context) Line 1104 C libxml2.dll!xmlOutputBufferClose(_xmlOutputBuffer * out) Line 2606 C Best regards, Sylvain On Sat, Apr 16, 2016 at 11:25 AM, Sylvain Pointeau < sylvain.point...@gmail.com> wrote:

Re: [xml] xmlOutputBufferCreateFile VS2015 I/O error : Bad file descriptor

2016-04-16 Thread Sylvain Pointeau
On Sat, Apr 16, 2016 at 12:53 PM, Nikolay Sivov wrote: > On 16.04.2016 11:23, Sylvain Pointeau wrote: > > > > FILE*f = fopen("C:\\myfolder\\testdata.xml", "w"); > > > > xmlOutputBufferPtroutput = xmlOutputBufferCreateFile(f, NULL); > > >

Re: [xml] xmlOutputBufferCreateFile VS2015 I/O error : Bad file descriptor

2016-04-16 Thread Sylvain Pointeau
On Sat, Apr 16, 2016 at 1:02 PM, gait.boxman wrote: > You're missing a backslash in the path.. > > --Gait > > Verzonden vanaf mijn Samsung Galaxy-smartphone. > Oorspronkelijk bericht ---- > Van: Sylvain Pointeau > Datum: 16-04-2016 10:23 (GMT+01:00) >

Re: [xml] xmlOutputBufferCreateFile VS2015 I/O error : Bad file descriptor

2016-04-16 Thread Sylvain Pointeau
ave an idea on where the issue could be? Best regards, Sylvain On Sat, Apr 16, 2016 at 11:59 AM, Sylvain Pointeau < sylvain.point...@gmail.com> wrote: > hello again, > > I investigated a bit more with my own compiled libxml2 in debug mode, the > stack trace is: > >

Re: [xml] xmlOutputBufferCreateFile VS2015 I/O error : Bad file descriptor

2016-04-16 Thread Sylvain Pointeau
at, Apr 16, 2016 at 5:44 PM, Sylvain Pointeau < sylvain.point...@gmail.com> wrote: > Hello, > > it also fails when creating the FILE *f = (FILE*) xmlFileOpen( > "C:\\test_data\\testxml.xml"); > or using the file descriptor: > > int fd = _open(&

Re: [xml] xmlOutputBufferCreateFile VS2015 I/O error : Bad file descriptor

2016-04-16 Thread Sylvain Pointeau
On Sat, Apr 16, 2016 at 10:52 PM, Nick Wellnhofer wrote: > On 16/04/2016 22:41, Sylvain Pointeau wrote: > >> for reference I compile libxml this way: >> cscript.exe configure.js iconv=no ftp=no http=no compiler=msvc >> cruntime=/MT >> debug=yes prefix=&quo