The DSML Parser reads and writes XML documents. The Parser silently ignores schema entries.
The Parser has the following parameters:
This Parser extends the Simple XML Parser; therefore, the same notices with regards to Character Encoding apply.
The following example shows how we can generate DSML documents dynamically:
var dsml = system.getParser ( "ibmdi.DSML" ); var entry = system.newEntry();
entry.setAttribute ("$dn", "uid=johnd,o=doe.com"); entry.setAttribute ("mail", "john@doe.com"); entry.setAttribute ("uid", "johnd"); entry.setAttribute ("objectclass", "top"); entry.addAttributeValue ("objectclass", "person");
dsml.setOutputStream ( new java.io.StringWriter() ); // Uncomment if we dont want the "<?xml version= ...." header // dsml.setOmitXMLDeclaration ( true ); dsml.initParser(); dsml.writeEntry ( entry ); dsml.closeParser();
var result = dsml.getXML(); task.logmsg ( result );
The following example shows how we can read a DSML document using script:
var dsml = system.getParser ("ibmdi.DSML"); dsml.setInputStream ( new java.io.FileInputStream("dirdata.dsml") ); dsml.initParser ();
var entry = dsml.readEntry(); while ( entry != null ) { task.dumpEntry ( entry ); entry = dsml.readEntry(); }
Simple XML Parser,
SOAP Parser,
DSMLv2 Parser.