Home Search

DriveWorks Pro 22
XML Document (Simple)

Send Feedback

XML Document (Simple)

This Document type is used to export data directly in to a XML Document from the DriveWorks project.

An XML (Extensible Markup Language) is a format commonly used for inter-operation between different systems.

DriveWorks can drive values into place-holders in an XML Document.


To Add an XML Document (Simple):

In DriveWorks Administrator open the Project the Document is to be added to and go to Stage 4: Output Rules then Documents - Files

  1. Click the "Add" button on the command bar.
  2. Choose XML Document (Simple) from the list in the Create a New Document wizard.
  3. Give the new Document a name.
  4. Click "Next" and browse for the master XML Document, click "Open" and "Finish".

To Edit an XML Document (Simple):

  1. The Master File Path is the location of the XML Document. If the location of the Document changes then it will need re-browsing to using the "Browse..." button.
  2. The Output File Name is the name given to the newly created Document. Click the "Build..." button to give the Document a name.
  3. The Output File Path is the location where the driven Document will be stored. Click the "Build..." button to set the Document Path.

    Please see Info: Where To Store DriveWorks Data for information on where to store the data associated to a DriveWorks implementation.

  4. The Document can also be hidden from the Document List in the Specification Explorer by checking the Hide from Document list General Setting.
  5. To build a rule for a Tagged Element (Placeholder) select an element from the list and click the "Build..." button. If no elements are present but the Document contains them click the "Refresh" button.
The Document can be Deleted if it is not required by making the result of the Document name return Delete.
The Document Name will need to be unique if the Document is created in the same location for each Specification, otherwise existing Documents will be overwritten.

If the Document Path is not set then the file will be created in the Specification Folder.

At any point a HTML preview can be created by clicking the "Preview" button on the command bar.

How to create a simple XML Document:

Example XML Document
<?xml version="1.0"?> 
<?xml-stylesheet type="text/xsl" href="XMLDocumentTransform.xsl"?> 
  <Field id="Field1">By DriveWorks</Field> 
  <Field id="Field2">100mm</Field>   

This XML Document contains two tagged elements "Field1" and "Field2". These two tagged elements will appear in the Tagged Elements section when editing the XML Document.

It is simple to add another tagged element by typing the following below the other tagged elements.

Example Title
<Field id="Field3">Example Text</Field>
Each element is opened with <Field id="Name"> and closed with the terminator </Field>. This is important for well structured XML.

For any external application reading an XML file, the above is all that is required. If an XML file is to be displayed in a web browser, it will require a transform file to accompany the file. The transform file tells the browser how to display the XML.

XSL files must exist in the same location as the XML file it is used to display.

When requiring a XSL transform file to display a driven XML file, create a new Document for output and use the Copied File option.

Select the XSL file to use and build a rule that will place it in the same location as the XML file being driven. Exactly the same procedure for any static image files used in the XML can be adopted.

The XML Document (Simple) is triggered in the Specification Flow by the Release Documents task.