# Problems with using libxml2

**URL:** <https://forum.legato.io/t/problems-with-using-libxml2/5521>\
**Category:** Uncategorized\
**Created:** [November 25, 2020, 12:42pm UTC](https://forum.legato.io/t/problems-with-using-libxml2/5521 "2020-11-25T12:42:34Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Reinhard](https://avatars.discourse-cdn.com/v4/letter/r/a9adbd/32.png) [@Reinhard](https://forum.legato.io/u/Reinhard)\
**Post date:** [November 25, 2020, 2:13pm UTC](https://forum.legato.io/t/problems-with-using-libxml2/5521/5 "2020-11-25T14:13:05Z")

</div>

The Forum won’t let me Upload files so:

**xmlTest.c :**

// Include the core framework C APIs.  
#include “legato.h”

// Include your component’s API interfaces.  
#include “interfaces.h”  
#include \<libxml/parser.h\>  
#include \<libxml/tree.h\>

// This function is called only once on startup. Place your initialization and event registration  
// here.  
COMPONENT\_INIT  
{  
xmlDocPtr doc;  
doc = NULL;  
if(doc == NULL)  
{  
LE\_INFO(“Is Empty”);  
}  
doc = xmlParseFile(“test.xml”);  
xmlFreeDoc(doc);  
}

**Component.cdef :**

// This is component definition file that specifies the internal content and external interfaces  
// of reusable software components.  
//  
// For more details on the component definition (.cdef) file format see:  
// [Component Definition .cdef - Legato Docs](https://docs.legato.io/latest/defFilesCdef.html)

// Source code files.  
sources:  
{  
xmlTest.c  
}

// Bind resources from the target module into your application.  
requires:  
{  
// IPC APIs used by this component.  
api:  
{

```
}

// File paths local to your target module.
file:
{
    
}

// Directories on your target module to make accessible to the app.
dir:
{
   
}

// Linux filesystem device paths.

```

device:  
{

}  
component:  
{  
}

```
// Shared libraries pre-installed on the module.
lib:
{      
    xml2
}   

```

}

bundles:  
{  
file:  
{  
/home/reinhard/.leaf/wp85-toolchain\_SWI9X15Y\_07.14.01.00-linux64/sysroots/armv7a-neon-poky-linux-gnueabi/usr/include/lib/libxml2.so /lib/  
}

}

cflags:  
{  
}

**xmlTest.adef:**

// Specify the bundled components for your application here. This section needs to contain a list  
// of system paths to your component directory.

version: 1.0.0  
maxFileSystemBytes: 512K  
sandboxed: true  
start: manual

components:  
{  
}

// Add the list of executables to be constructed and moved to the /bin directory of the app. The  
// executable content is a list of the components inside the executable.  
//  
// Example binding format:  
// clientExe.clientComponent.clientInterface → serverExe.serverComponent.serverInterface  
executables:  
{  
xmlTest = ( xmlTestComponent )  
}

// The processes section specifies processes to run when the app is started including environment  
// variables, command-line arguments, limits, and fault handling actions.  
processes:  
{

```
run:
{
    ( xmlTest )
}

```

}

// Bindings that allow client side API interfaces to be bound to servers found within other  
// applications in the system.  
bindings:  
{

}

---

_[View the full topic](https://forum.legato.io/t/problems-with-using-libxml2/5521)._
