XML library

This is a discussion on XML library within the C Programming forums, part of the General Programming Boards category; hi, i have downloaded xml library from xmlsoft.org, the library name is libxml2 (for linux, windows) .... i read the ...

  1. #1
    Registered User
    Join Date
    Jun 2003
    Posts
    31

    XML library

    hi, i have downloaded xml library from xmlsoft.org, the library name is libxml2 (for linux, windows) .... i read the doc but it is not very clear .... i don't understand if with this library is possible to create xml files or it's only possible to parse xml file...

    thank u

    bye


  2. #2
    Registered User
    Join Date
    Jun 2003
    Posts
    31
    this is a simple apllication that it should create an xml file....if i understand api specification....

    but with borland 5.5 compiler i have an error with linker...

    -------------------------------------------------

    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include <libxml/xmlmemory.h>
    #include <libxml/parser.h>
    #include <libxml/tree.h>


    int main()
    {
    xmlDocPtr docPtr;
    xmlNodePtr nodePtr;
    xmlChar *name;
    xmlChar *content;

    docPtr = xmlNewDoc("1.0");

    name = "tag";
    content = "mmm";

    nodePtr = xmlNewDocNode(NULL, NULL, name, content);


    return 0;
    }
    Last edited by Massive; 07-04-2003 at 04:40 AM.

  3. #3
    Registered User
    Join Date
    Jun 2003
    Posts
    31
    these is the errors:


    Error: Unresolved external '_xmlNewDoc' referenced from D:\UNI\PROGETTONE\XML\TEST.OBJ
    Error: Unresolved external '_xmlNewDocNode' referenced from D:\UNI\PROGETTONE\XML\TEST.OBJ

    please help me

  4. #4
    Registered User
    Join Date
    Jun 2003
    Posts
    31
    but i already put the library in the path ( \include) the problem is that the linker doesn't find the reference....

    don't u think??
    Last edited by Massive; 07-04-2003 at 04:34 AM.

  5. #5
    Registered User
    Join Date
    Jun 2003
    Posts
    31
    of course u are right....

    i'm a little bit stupid

    but if i compile with option
    -L library there is another error


    D:\uni\Progettone\XML>bcc32 -L "c:\Program Files\borland\compiler\lib\libxml2.lib" test.c
    Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
    test.c:
    Warning W8004 test.c 25: 'nodePtr' is assigned a value that is never used in function main
    Warning W8004 test.c 25: 'docPtr' is assigned a value that is never used in function main
    Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
    Error: 'C:\PROGRAM FILES\BORLAND\COMPILER\LIB\LIBXML2.LIB' contains invalid OMF record, type 0x21 (possibly COFF)



    what's wrong????
    Last edited by Massive; 07-04-2003 at 06:39 AM.

  6. #6
    Registered User
    Join Date
    Aug 2002
    Posts
    351
    this may help you.

  7. #7
    Registered User
    Join Date
    Jun 2003
    Posts
    31
    i tried but there is already the same problem.......

  8. #8
    Registered User
    Join Date
    Jun 2003
    Posts
    31
    i resolved the problem with COFF2OMF borland tool ......the compile goes all ok.

    now i have to understand how to use tihs libraries

    i execute the program compiled above but it doesn't create an xml file, it creates two file:
    1) tree.obj
    2) tree.tds

    wich type of file are these??

  9. #9
    Registered User
    Join Date
    Jun 2003
    Posts
    31
    i know but i don't know where are these functions....

    thank u however
    Last edited by Massive; 07-04-2003 at 08:12 AM.

  10. #10
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
    Error: 'C:\PROGRAM FILES\BORLAND\COMPILER\LIB\LIBXML2.LIB' contains invalid OMF record, type 0x21 (possibly COFF)
    <<

    In your Borland bin directory you should find COFF2OMF.EXE

    Code:
    COFF to OMF Converter Version 1.0.0.74 Copyright (c) 1999, 2000 Inprise Corporation
    Syntax:   COFF2OMF [options] InputFile OutputFile
      -h, -?  Display help
      -q      Quiet mode
      -v      Verbose mode
      -r      Remove (delete) output file if empty
      -lib:xx Specify options for OMF import library generation:
           ms - Allow entries that have MS C++ name mangling (default: no)
           st - Normalize names instead of aliasing MS stdcall mangling
           ca - Don't perform MS cdecl aliasing (default is to alias)
    
    COFF2OMF will convert a COFF import library file (InputFile)
    to the corresponding OMF type import library file (OutputFile).
    If you don't know how to use it, try google'ing it.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. XML Library for C?
    By keira in forum C Programming
    Replies: 2
    Last Post: 10-18-2007, 07:15 AM
  2. Cross platform XML library
    By Josh Kasten in forum C++ Programming
    Replies: 2
    Last Post: 04-09-2007, 05:04 PM
  3. Problem with Apache XML C++ Parser library
    By gandalf_bar in forum C++ Programming
    Replies: 2
    Last Post: 07-21-2004, 10:42 AM
  4. xml library
    By Guido in forum C++ Programming
    Replies: 3
    Last Post: 04-10-2004, 05:07 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21