Reading RIF/ReqIF Files

File Format

The ReqIF model reader enables to read:

The RIF/ReqIF data must be stored in an XML file, as described by the related RIF/ReqIF specification. The XML document may be archived in a Zip file (recommended).

External files (e.g. images or spreadsheets) might be referenced by the RIF/ReqIF document. If the XML document is stored in an archive file, those external files must be stored within the Zip archive. Otherwise the file paths are resolved relatively to the XML document location.

RIF Compatibility

RIF 1.1a and 1.2 files are silently converted to ReqIF on loading.

Noteworthy and known limitations:

Reading OLE Objects

OLE objects can be inserted in a AttributeValueXHTML instance. In that case the AttributeValueXHTML.theValue attribute contains XHTML tags that reference the OLE objects, e.g.:

    <xhtml:div><xhtml:object data="path_to_ole_object"/></xhtml:div>

Here is a sample code that determines attached OLE objects and get access to their content:

    import com.sodius.mdw.metamodel.reqif.*;
    import com.sodius.mdw.metamodel.reqif.xhtml.Attachment;
    import com.sodius.mdw.metamodel.reqif.xhtml.AttachmentResolver;
    import com.sodius.mdw.metamodel.reqif.xhtml.XHTMLUtils;
    ...
    File reqifFile = new File(<location of the loaded ReqIF file>);
    AttributeValueXHTML value = ...;
    AttachmentResolver resolver = XHTMLUtils.createAttachmentResolver(reqifFile);
    for (Attachment attachment : XHTMLUtils.getAttachments(value)) {
    	System.out.println("Found an OLE object: " + attachment.getPath());
    	InputStream input = resolver.getInputStream(attachment);
    	...
    }

Programming the Reader

When the reader is launched from rules or Java code, you can set options to tweak the reader's behavior. Refer to the Javadoc of Options to list available settings.

Related reference
API Reference