*
Metamerge logo
Search

Advanced Search
*
*
*
* HOME DOCUMENTS & RESOURCES DOWNLOADS EARLY TECH ACCESS SUPPORT FAQ KNOWN ISSUES OLD VERSIONS
*

DSML Parser

Overview

The DSML parser reads and writes XML documents according to the DSML 1.0 Specification. The parser will silently ignore schema entries.

Configuration

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.

Example

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 ); 

This example shows how you can read a DSML document using script:

var dsml = system.getParser ("metamerge.DSML");
dsml.setInputStream ( new java.io.FileInputStream("dirdata.dsml") );
dsml.initParser ();
var entry = dsml.readEntry();
while ( entry != null ) {
	task.dumpEntry ( entry );
	entry = dsml.readEntry();
}

References

See Also

XML Parser, SOAP Parser

 
*
  Metamerge Integrator version 4.5 ©Copyright Metamerge AS 2000-2002 Last edited 2002-04-30 contact us