Parameter |
Description |
class |
com.architech.parser.rspDSML |
characterSet |
Optional
character set conversion. |
dnattribute |
The attribute used for the distinguished name
DSML attribute ($dn). |
isvalidating |
If checked this parser will request a
DTD/Schema validating parser |
isnamespaceaware |
If checked this parser will request a namespace
aware parser |
omitxmldeclaration |
If checked, the XML declaration will be omitted
in the output stream. |
prefix |
Prefix used on XML elements to indicate that they belong to the DSML namespace.
Default dsml. Available from 4.6.5 |
uri |
The URI which identifies this namespace.
Default http://www.dsml.org/DSML.
Available from 4.6.5 |
This example shows how you can generate DSML documents on the fly.
var dsml = system.getParser ( "metamerge.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 you dont want the "<?xml version= ...." header
// dsml.setOmitXMLDeclaration ( true );
dsml.initParser();
dsml.writeEntry ( entry );
dsml.closeParser();
var result = dsml.getXML();
task.logmsg ( result );