xmlbeansxx

Table of Contents
Source code


You can access source code from our xmlbeansxx git repository

Download


You can download xmlbeansxx from sourceforge



Copyright © 2004-2009 touk.pl
All rights reserved.



Welcome to xmlbeansxx - Open Source C++ XML data binding library

About xmlbeansxx

xmlbeansxx is an open source C++ library easing the processing of XML data.
It is very similar to and in fact was inspired by Apache XMLBeans.
The goal is to have the same functionalities and interfaces of XMLBeans.

You can find good introduction on devx.com article about xmlbeansxx
http://www.devx.com/cplus/Article/28656/0
or you can read pdf version from here :
Manipulate_XML_Documents_in_CPP_with_xmlbeansxx.pdf

Documentation

Checkout xmlbeansxx documentation
Doxygen generated documentation:  xmlbeansxx-doc.zip, browsing online: http://top.touk.pl/resources/xmlbeansxx/doc/html/

Source code

Xmlbeansxx source code is available under the terms of Apache License 2.0 from http://top.touk.pl/git/xmlbeansxx

Issue tracker

Please report any spotted problems on jira here: http://top.touk.pl/jira/browse/XMLBEANSXX

Download

You can download binaries from http://top.touk.pl/resources/xmlbeansxx/releases/

Or http://sourceforge.net/project/showfiles.php?group_id=118556 (deprecated)

Features

Easy access to XML Schema based XML data through generated C++ classes.
Easy iteration over any XML data, even with no schema file, through XmlCursor iterators.
Runtime XPath queries, through XQuery technology (being implemented).
Memory safe - uses boost::smart_ptr technology.
Clear, configurable logging - uses log4cxx.
Fast & lightweighted

Requirements

Supported Operating Systems:

Linux (tested under RedHat, PLD, and Debian)
Windows
Mac

Installed libraries (required):

cmake or autotools
maven
xerces-c
boost

Installed libraries (recommended):

log4cxx
gmpxx
CppUnit - for testing

Labels

xml xml Delete
xmlbeansxx xmlbeansxx Delete
c++ c++ Delete
xmlbeans xmlbeans Delete
schema schema Delete
xsd xsd Delete
databinding databinding Delete
soap soap Delete
webservices webservices Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. May 13, 2009

    Anonymous says:

    Fajnie, że się pojawiła jakaś dokumentacja , szkoda tylko, że jest nieaktualna ...

    Fajnie, że się pojawiła jakaś dokumentacja , szkoda tylko, że jest nieaktualna

    Pozdrawiam

    Paweł Stawicki

    1. May 20, 2009

      Anonymous says:

      Paweł bo to jest stara leśna dokumentacji c&p do confluence. Oczywiście moż...

      Paweł bo to jest stara leśna dokumentacji c&p do confluence.

      Oczywiście możesz się zarejestrować i ją poprawić

      1. May 20, 2009

        Anonymous says:

        Kuba
    2. Jun 04, 2009

      Rafał Rusin says:

      Dodałem dokumentację wygenerowaną z doxygena. Wkrótce będzie też możliwość przeg...

      Dodałem dokumentację wygenerowaną z doxygena. Wkrótce będzie też możliwość przeglądania jej online.

      1. Jul 27, 2009

        Rafał Rusin says:

        Już jest

        Już jest

  2. May 21, 2009

    Anonymous says:

    what's the latest on xpath. I can only run xpath on a generic XmlDocument. ...

    what's the latest on xpath. I can only run xpath on a generic XmlDocument.  Trying to run on a typed generated document leads to an index out of bounds exception.

    -- dan

    1. May 21, 2009

      Anonymous says:

      apparently the issue is in StoreString.  StoreString->IsStored returns t...

      apparently the issue is in StoreString.  StoreString->IsStored returns true, but the index is behind the size of StringStorage.

    2. May 22, 2009

      Anonymous says:

      Looks like i created a DLL that uses xmlbeansxx.lib, and an application that lin...

      Looks like i created a DLL that uses xmlbeansxx.lib, and an application that links in xmlbeanxx.lib and the DLL.  Apparently StringStorage uses a static global variable, and there is a separate instance of this in the DLL and the static LIB.  Hence the problem.  I'm going to put xmlbeansxx into a DLL, so I can work around this.

      1. Jun 03, 2009

        Rafał Rusin says:

        Quite advanced bug StringStorage is a class for conserving space for strings, ...

        Quite advanced bug

        StringStorage is a class for conserving space for strings, which are contained in schema. I don't remember exactly, but I think you can avoid this problem by modifying

        bool StoreString::isStored() const
        

        to return always false.

        This will cause a bit more memory consumption, but should avoid your problem.

        Regards

        1. Jul 15, 2009

          Fernando says:

          Hi, the solution of change the isStored method doesn't work. In some point, the ...

          Hi, the solution of change the isStored method doesn't work. In some point, the StoreString::free() is called and the delete instruction fails:

          void StoreString::free(){   
          if (!isStored() && buf!=0) {       
           delete[] ((char *)buf); //fails when isStored returns allways false   
          }   
          buf=0;}
          

          I am using the 0.9.7 version of xmlbeansxx

          Regards

          Fernando

      2. Jul 15, 2009

        Anonymous says:

        Hello, a have the same problem. When a xml objects goes from a dll to another dl...

        Hello, a have the same problem. When a xml objects goes from a dll to another dll, its properties dissapears. (I think is the the StoreString object and the map of properties)

        The works around of put xmlbeans in a dll works?

        Regards

        Fernando

        1. Oct 18, 2009

          Dan Greve says:

          Yes, the DLL worked for me.  However, i needed to modify a number of files ...

          Yes, the DLL worked for me.  However, i needed to modify a number of files in xmlbeansxx to properly dllexport all the necessary symbols.

          I'm the original anonymous coward from this thread.

          -- dan

          1. Anonymous replies:

            You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account. You can also Sign Up for a new account.

  3. Jun 17, 2009

    Anonymous says:

    Hello, I have recently tried to build xmlbeansxx. I've managed to generate the ...

    Hello,

    I have recently tried to build xmlbeansxx. I've managed to generate the visual studio  sln, but i got stuck at building the library. I get an error about Maven tool working offline even if Maven is set to work online in settings files. Anyone knows a workaround for this issue? Thank you!

    Here is the error message i get:

    1>NOTE: Maven is executing in offline mode. Any artifacts not already in your local
    1>repository will be inaccessible.
    1>[INFO] Scanning for projects...
    1>[INFO] ------------------------------------------------------------------------
    1>[INFO] Building XMLBeansxx Generator
    1>[INFO]    task-segment: [package]
    1>[INFO] ------------------------------------------------------------------------
    1>[INFO] ------------------------------------------------------------------------
    1>[ERROR] BUILD ERROR
    1>[INFO] ------------------------------------------------------------------------
    1>[INFO] Error building POM (may not be this project's POM).
    1>Project ID: org.apache.maven.plugins:maven-resources-plugin
    1>Reason: POM 'org.apache.maven.plugins:maven-resources-plugin' not found in repository: System is offline.
    1>  org.apache.maven.plugins:maven-resources-plugin:pom:2.3
    1> for project org.apache.maven.plugins:maven-resources-plugin
    1>[INFO] ------------------------------------------------------------------------
    1>[INFO] For more information, run Maven with the -e switch

    1. Jul 27, 2009

      Rafał Rusin says:

      Try following patch: Index: generator/CMakeLists.txt =========================...

      Try following patch:

       Index: generator/CMakeLists.txt
      ===================================================================
      --- generator/CMakeLists.txt	(revision 12874)
      +++ generator/CMakeLists.txt	(working copy)
      @@ -32,7 +32,7 @@
       )
      
       ADD_CUSTOM_COMMAND(OUTPUT ${GEN_BINFILES} ${GEN_LIBFILES} ${GEN_JAR}
      -	COMMAND ${MVN_PROG} -o -Dbase=${CMAKE_CURRENT_SOURCE_DIR} -Prelease package
      +	COMMAND ${MVN_PROG} -Dbase=${CMAKE_CURRENT_SOURCE_DIR} -Prelease package
       	MAIN_DEPENDENCY ${CMAKE_CURRENT_BINARY_DIR}/pom.xml
       	DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/pom.xml
       )
      
      
      1. Oct 18, 2009

        Dan Greve says:

        thx, this patch will help in future builds -- dan

        thx, this patch will help in future builds

        -- dan

  4. Jul 27, 2009

    Fernando says:

    Hi, i have a linking problem with enum and static const int   class Enum {...

    Hi, i have a linking problem with enum and static const int

      class Enum {
      public:
        static const int length = 3;
        static const int INT_G_2_S_REQUEST = 0;
        static const int INT_G_2_S_RESPONSE = 1;
        static const int INT_G_2_S_NOTIFICATION = 2;

    ...

    undefined reference to `com::gamingstandards::g2S::schemas::v103::TSessionTypes::Enum::INT_G_2_S_REQUEST'

    This error happen in gcc 4.3.3 and not in visual studio.

    ¿Any ideas?

    I am using the 0.9.7 version of xmlbeansxx

    Regards

    Fernando

  5. Aug 07, 2009

    Anonymous says:

    Hi everybody,   I saw on the Apache XMLBeans site that there were a whish ...

    Hi everybody,

      I saw on the Apache XMLBeans site that there were a whish (an incubation project) to add C++ capabilities to the Apache XMLBeans project starting from the Xmlbeansxx tool. Is this idea still in the air? If yes, I will be interested to collaborate with others on this project.

      KR,

      Marc

    1. Aug 12, 2009

      Kuba Nowakowski says:

      Hi Marc Yes this is the old wish We put current xmlbeansxx version in few pr...

      Hi Marc

      Yes this is the old wish

      We put current xmlbeansxx version in few production projects, however we were stopped by apache meritocracy and our laziness.

      If you are interested in collaborate feel free to send us proposal what would you like to do?

      For sure we will try to help.

      Best regards

      Kuba

    2. Oct 07, 2009

      Rafał Rusin says:

      I've set up repository on github, so we can gather contributors there. If you ar...

      I've set up repository on github, so we can gather contributors there. If you are interested, please check out "getting involved section".

      Regards

      1. Oct 18, 2009

        Dan Greve says:

        I didn't see a getting involved section on github, so i just created a repositor...

        I didn't see a getting involved section on github, so i just created a repository to browse.  I'm interested in adding the shared dll library, and what it might take to do xpath support.

        -- dan

        1. Dec 12, 2009

          Anonymous says:

          Getting involed section is on this site. Regards

          Getting involed section is on this site.

          Regards

          1. Jan 29, 2010

            Dan Greve says:

            yup, saw it after i posted.

            yup, saw it after i posted.

  6. Jan 22, 2010

    William Ma says:

    Hi, I currently have the XMLBeansxx built and installed in Cygwin. Is it possi...

    Hi,

    I currently have the XMLBeansxx built and installed in Cygwin. Is it possible to build XmlBeansxx as a Visual Studio project in Windows? If yes, then how?

    Regards,

    -William

    1. Jan 22, 2010

      Rafał Rusin says:

      Yes, this is possible and we actually did some development in Visual Studio. Yo...

      Yes, this is possible and we actually did some development in Visual Studio.

      You can generate projects using those 2 scripts:

      vsbootstrap.bat
      vsbootstrapr.bat
      

      First is for DEBUG and second for RELEASE configuration.

      It uses CMake's generator for Visual Studio projects.

  7. Jan 28, 2010

    William Ma says:

    Thanks for the help on my previous question! I have another question: Which ve...

    Thanks for the help on my previous question!

    I have another question: Which version of Boost and Xerces-c libraries is being used in XmlBeansxx v0.9.8 (for building and running it in MS VS 2008)?

    Regards,

    1. Jan 29, 2010

      Paweł Stawicki says:

      Any boost version should work. When not let me know. We have tested xmlbeansxx...

      Any boost version should work.

      When not let me know.

      We have tested xmlbeansxx with  boost 1.35 on VS 2005.

      Best Regards,

      Paweł

      1. Jan 29, 2010

        Dan Greve says:

        I use boost 1.37 and Xerces-c 2.8.0, also with VS 2005. Dan G

        I use boost 1.37 and Xerces-c 2.8.0, also with VS 2005.

        Dan G

      2. Feb 11, 2010

        William Ma says:

        I've just tested XmlBeansxx with Boost 1.35 on VS2008. Debug build is fine, but ...

        I've just tested XmlBeansxx with Boost 1.35 on VS2008. Debug build is fine, but Release build(or any build with NDEBUG is defined) will fail due to a bug in the Boost/range/iterator_range.hpp-is_singular() function. Upgrade Boost to 1.36 can fix it (or replace the 1.35 is_singular() implementation by the one in 1.36).

    2. Feb 08, 2010

      William Ma says:

      Thanks for the reply! Yes, I successfully get Xmlbeansxx working with VS2008, an...

      Thanks for the reply! Yes, I successfully get Xmlbeansxx working with VS2008, and I'm using boost 1.41 with Xerces 2.6.0

      In fact, i spent much less time to get it working under VS2008 comparing to build it in Cygwin!

      Again, thanks for the help everyone!

      1. Feb 09, 2010

        Rafał Rusin says:

        Great. If you want it running under xerces 3, I did small fixes. It's currently...

        Great.

        If you want it running under xerces 3, I did small fixes. It's currently here: http://github.com/rafalrusin/xmlbeansxx. I'll move it to top soon.

        Regards

        1. Feb 12, 2010

          Rafał Rusin says:

          OK, moved to top http://top.touk.pl/git?p=xmlbeansxx;a=summary
  8. Jan 29, 2010

    Dan Greve says:

    I found a bug in CoreTypes.h.  Line 69 should be changed from   ...

    I found a bug in CoreTypes.h.  Line 69 should be changed from

        typedef long int mpz_class;

    to

        typedef long long mpz_class;

    long int on Windows 32-bit is only 4 bytes, and is insufficient to represent 8 byte data types, such as xs:long

    Dan G

    1. Jan 29, 2010

      Rafał Rusin says:

      Could you fill a jira entry for it and attach a patch (using for example git dif...

      Could you fill a jira entry for it and attach a patch (using for example git diff)?

      http://top.touk.pl/jira/browse/XMLBEANSXX

      Regards

      1. Jan 30, 2010

        Dan Greve says:

        I'll give it a try.  yet another cm tool to learn.  I created a git br...

        I'll give it a try.  yet another cm tool to learn.  I created a git branch last year, just never got around to trying it out

        1. Feb 12, 2010

          Rafał Rusin says:

          Jira is quite common, at least in open source. It's worth trying out.

          Jira is quite common, at least in open source. It's worth trying out.

  9. Mar 31

    Anonymous says:

    Hi, I am using MS Visual Studio 2008 and succeeded in building the solution wi...
    Hi,
    
    I am using MS Visual Studio 2008 and succeeded in building the solution with CMake.
    
    But know I get build errors.
    
    I tried already this patch ADD_CUSTOM_COMMAND(OUTPUT $
    
    {GEN_BINFILES}
    $
    
    {GEN_LIBFILES}
    $
    
    {GEN_JAR}
    COMMAND $
    
    {MVN_PROG}
    -o -Dbase=$
    
    {CMAKE_CURRENT_SOURCE_DIR}
    -Prelease package
    COMMAND $
    
    {MVN_PROG}
    -Dbase=$
    
    {CMAKE_CURRENT_SOURCE_DIR}
    -Prelease package
    MAIN_DEPENDENCY $
    
    {CMAKE_CURRENT_BINARY_DIR}
    /pom.xml
    DEPENDS $
    
    {CMAKE_CURRENT_BINARY_DIR}
    /pom.xml
    )
    but it shows no effect.
    
    Thanks in advance.
    
    Sylvia
    
    Here the output:
    
    2>--- Rebuild All started: Project: generator, Configuration: Debug Win32 -----
    2>Deleting intermediate and output files for project 'generator', configuration 'Debug|Win32'
    2>Generating pom.xml
    2>Generating target/xmlbeansxx-gen//bin/acx_pthread.m4, target/xmlbeansxx-gen//bin/scompxx, target/xmlbeansxx-gen//bin/xmlbeansxx-geninclude, target/xmlbeansxx-gen//bin/xmlvalidator, target/xmlbeansxx-gen//bin/xmlbeansxx-gen, target/xmlbeansxx-gen//bin/xmlbeansxx-genbuiltin, target/xmlbeansxx-gen//bin/xmlbeansxx-split, target/xmlbeansxx-gen//bin/xmlbeansxx-gen.bat, target/xmlbeansxx-gen//bin/xmlbeansxx-genbuiltin.bat, target/xmlbeansxx-gen//lib/commons-logging-1.1.jar, target/xmlbeansxx-gen//lib/xbean-1.0.4.jar, target/xmlbeansxx-gen//lib/log4j-1.2.12.jar, target/xmlbeansxx-gen//xmlbeansxx-gen.jar
    2>[INFO]
    2>NOTE: Maven is executing in offline mode. Any artifacts not already in your local
    2>repository will be inaccessible.
    2>[INFO] Scanning for projects...
    2>[INFO] ------------------------------------------------------------------------
    2>[INFO] Building XMLBeansxx Generator
    2>[INFO]    task-segment: [package]
    2>[INFO] ------------------------------------------------------------------------
    2>[INFO] ------------------------------------------------------------------------
    2>[ERROR] BUILD ERROR
    2>[INFO] ------------------------------------------------------------------------
    2>[INFO] Error building POM (may not be this project's POM).
    2>Project ID: org.apache.maven.plugins:maven-assembly-plugin
    2>Reason: POM 'org.apache.maven.plugins:maven-assembly-plugin' not found in repository: System is offline.
    2>  org.apache.maven.plugins:maven-assembly-plugin:pom:2.1
    2> for project org.apache.maven.plugins:maven-assembly-plugin
    2>[INFO] ------------------------------------------------------------------------
    2>[INFO] For more information, run Maven with the -e switch
    2>[INFO] ------------------------------------------------------------------------
    2>[INFO] Total time: < 1 second
    2>[INFO] Finished at: Wed Mar 31 01:43:29 CEST 2010
    2>[INFO] Final Memory: 3M/7M
    2>[INFO] ------------------------------------------------------------------------
    2>Project : error PRJ0002 : Error result 1 returned from 'C:\Windows\system32\cmd.exe'.
    2>Build log was saved at "file://d:\Software\3rd_Party\xmlbeansxx-0.9.8\build\generator\generator.dir\Debug\BuildLog.htm"
    2>generator - 1 error(s), 0 warning(s)
    3>--- Rebuild All started: Project: xmlbeansxxd, Configuration: Debug Win32 -----
    3>Deleting intermediate and output files for project 'xmlbeansxxd', configuration 'Debug|Win32'
    3>Generating configLog4cxx.h
    3>Generating configGmpxx.h
    3>Generating configLibxml2.h
    3>Generating xml-fragment.h, xml-fragment.cpp
    3>Der Befehl "..\..\generator\target\xmlbeansxx-gen\bin\xmlbeansxx-gen.bat" ist entweder falsch geschrieben oder
    3>konnte nicht gefunden werden.
    3>Project : error PRJ0019: A tool returned an error code from "Generating xml-fragment.h, xml-fragment.cpp"
    3>Build log was saved at "file://d:\Software\3rd_Party\xmlbeansxx-0.9.8\build\src\xmlbeansxx\xmlbeansxxd.dir\Debug\BuildLog.htm"
    3>xmlbeansxxd - 1 error(s), 0 warning(s)
    
    1. Mar 31

      Anonymous says:

      Dear Sylvia You are running maven in offline mode so it can't download plugins ...

      Dear Sylvia

      You are running maven in offline mode so it can't download plugins to build project.

      Please try it again without  -o switch in 

       {MVN_PROG}
      -o -Dbase=$
      

      Kuba

      1. Mar 31

        Anonymous says:

        Dear Kuba, thanks a lot. But I get still one error, that the following file ca...

        Dear Kuba,

        thanks a lot.

        But I get still one error, that the following file can not be found.

        "..\..\generator\target\xmlbeansxx-gen\bin\xmlbeansxx-gen.bat"

        I serched on my computer, but I could not find it.

        Sylvia

        1. Mar 31

          Anonymous says:

          I unpacked the archive again and now the file "xmlbeansxx-gen.bat" is existing. ...

          I unpacked the archive again and now the file "xmlbeansxx-gen.bat" is existing.

          Most parts compile after adding some additional include directories, uncommenting the line:

           #include <xerces/internal/XMLGrammarPoolImpl.hpp>
          

          But unfortunately I still get compiling errors:

           2>XercesUtils.cpp
          2>..\..\..\src\xmlbeansxx\XercesUtils.cpp(65) : error C2259:  'xmlbeansxx::BinStdInputStream' : cannot instantiate abstract class
          2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; due to following members:
          2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'const XMLCh  \*xercesc_3_1::BinInputStream::getContentType(void) const' : is abstract
          2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;  D:\Software\3rd_Party\xerces\xerces-c-3.1.0-x86-windows-vc-9.0\include\xercesc/util/BinInputStream.hpp(67)  : see declaration of 'xercesc_3_1::BinInputStream::getContentType'
          

          Is xerces 3 not supported jet, or is it possible to get rid of this problem. What is the latest version of xerces that is supportet by xmlbeansxx.

          Thanks in advance.

          Sylvia

          1. Mar 31

            Rafał Rusin says:

            Are you using latest snapshot, or tagged package? Xerces 3 support was recently...

            Are you using latest snapshot, or tagged package?

            Xerces 3 support was recently added:

            http://top.touk.pl/git?p=xmlbeansxx;a=log;h=refs/heads/master

            Rafał Rusin [Mon, 8 Feb 2010 23:15:31 +0000]

            Updates for Xerces-3 and boost 1.38

            It was tested under linux only.

            1. Mar 31

              Anonymous says:

              Dear Rafal, I am using the tagged package xmlbeansxx-0.9.8. After adding the 2...

              Dear Rafal,

              I am using the tagged package xmlbeansxx-0.9.8.

              After adding the 2 lines within the file XercesUtils.hpp the compiling succeeded.

              Thanks a lot.

              Sylvia

  10. Apr 03

    Anonymous says:

    Is it possible to build xmlbeansxx as a shared library with the MSVC90 compiler?...

    Is it possible to build xmlbeansxx as a shared library with the MSVC90 compiler?

    Which settings do I have to change in order to build a shared library?

    Thanks in advance.

    Sylvia

    1. Apr 06

      Rafał Rusin says:

      As far as I remember, there were some problems with DLL version under windows. S...

      As far as I remember, there were some problems with DLL version under windows. So I suggest using static linking for now.

      Regards,

      Rafał Rusin

  11. Jun 03

    Anonymous says:

    Hi! Could you tell me how can I make serialize and deserialize XML in generated ...

    Hi!
    Could you tell me how can I make serialize and deserialize XML in generated cpp (cpp generated from xsd).

    More:
    1) I have c.xsd
    2) I generated c.cpp
    3) how can I make (serialize) c.xml -> c.cpp and (deserialize) c.cpp -> c.xml

    Many thanks for your help.

    1. Jun 16

      Rafał Rusin says:

      Hello, you can check out examples from source code (if you click snapshot, then...

      Hello,

      you can check out examples from source code (if you click snapshot, then you will get zipped sources):

      http://top.touk.pl/git?p=xmlbeansxx;a=tree;f=examples/small;h=54ab7ec64333493b7deef7957c64061f142eca49;hb=HEAD

      Regards

Add Comment