LDAPXML: An LDAP to XML Converter

LDAPXML is a set of java classes that allow you to access LDAP entries as custom defined XML. It allows you to map the various LDAP objectClasses and attributes to XML namespaces, attributes, elements etc. If you're looking for something that just pulls LDAP data into XML format without mapping it to a custom schema, then DSML is what you're looking for.

LDAPXML uses map files written in XML to map the data. Here's the map file documentation, as well as a sample.

Documentation

Java API Docs
LX Map File Documentation
Custom Conversion hooks

Sample Code

Basic usage:

// connection: A connected LDAP connection 
// doc: An XML document
// test.map: A LX map 

LXMap map = LXMap.loadMap("file:///test/test.map");
		
LXReader reader = new LXReader();
reader.setConnection(connection);
reader.setMap(map);
		
Element el = reader.retrieveEntry(doc, "cn=test,dc=test,dc=com");
// el now contains a mapped entry

Multiple entries:

LXResults res = reader.retrieveSearch(doc, "dc=test,dc=com", "(objectClass=person)");
		
// ... either enumerate the results ...
for(int i = 0; i < res.getLength(); i++)
    el = res.getResult(i);

// ... or just use them all together ...
doc = res.assembleDocument();

Notes:

Download:

Binary JAR: ldapxml-0.9.4.jar
Full Sources: ldapxml-0.9.4-src.jar

Old Versions:

Binary JAR: ldapxml-0.9.3.jar
Full Sources: ldapxml-0.9.3-src.jar
Binary JAR: ldapxml-0.9.2.jar
Full Sources: ldapxml-0.9.2-src.jar
Binary JAR: ldapxml-0.9.1.jar [broken]
Full Sources: ldapxml-0.9.1-src.jar [broken]
Binary JAR: ldapxml-0.9.jar
Full Sources: ldapxml-0.9-src.jar

Licensing and Support

Open Source: BSD type license. Contact me when bugs are found.

   [ home page ]