Skip to main content

Decipher Support

All the topics, resources needed for Decipher.

 

FocusVision Knowledge Base

Editing XML

Overview

It is possible to create and edit survey elements programmatically using the XML Editor.

Accessing the XML

There are two ways to access the XML Editor in Decipher:

1. Via the Project Overview page: Click "Build", then click  "More Tools" and select "Edit XML".

2. Via the Survey Editor: Click "More Tools", then select "Edit XML".

Viewing the XML Editor

dec_editing_xml_001.png

1.  Actions:  Contains useful actions, supported by keyboard shortcuts.

  • Save (ctrl+enter)
  • Revert to Last Save
  • Find (ctrl+f)
  • Find Next (ctrl+g)
  • Find Previous (ctrl+shift+g)
  • Replace (ctrl+shift+f)
  • Replace All (ctrl+shift+r)

2.  View Options:  Allows you to show any errors in the XML (keyboard shortcut: ctrl+shift+f).

3. Undo / Redo:  Click the arrows to undo or redo recent changes.

4. Launch Survey:  Click to launch the survey with the current XML setup.

Note: In a live survey (temp-edit-live), clicking "Launch Survey" will save the latest changes and then initialize the launch process.

5. Survey XML:  This field allows you to edit the survey XML.

6. Test Survey:  Saves any unsaved changes and opens the survey for testing.

7. Save:  Save changes made to the survey XML.

Making Changes

Make your changes in the XML Editor using the appropriate XML syntax. Click here to review a list of tags that are not supported in the Survey Editor.

Click the "Save" button to save changes periodically. If the changes you're attempting to save contain errors a warning message will appear and the changes will be identified for you.

Once you've finished making changes, be sure to save them. Then you may select "Test Survey" to review the survey, or use the navigation menu along the top of the screen to navigate to another location. If there are unsaved changes when you attempt to navigate away from the XML, you will be asked if you'd like to stay on the page or leave. If you choose to leave, your changes will be lost.

Warning:  If you close the browser window that contains the survey XML, any unsaved changes will be lost.

If you return to the building application, you will see a warning message. Follow the instructions in the message and the changes made in the XML will appear in your survey.

Tags Accepted in the Survey Editor

  • <image>
  • <exec> elements can now be added via the structural elements
  • <res> (intermediate support)
  • <pipe> (intermediate support): appears in the question tree and stage.
  • <languages> (simple support)
  • “timeout” and “style” are now allowed on <exit> tags (child tags of <samplesource> tags)
  • <title> can be used within a <samplesource> tag instead of the “title” attribute.
  • The “list” attribute of a <samplesource> tag supports string data.
  • The “invalid” attribute of a <samplesource> tag is allowed.
  • The “newVirtual”, “trackCheckbox”, and “flatShowEmpty” <survey> attributes are now supported
  • “cond” attribute is supported on a <suspend/> tag
  • “incidence” attribute is supported on a <term> tag
  • “filename” and “database” attributes are supported on <var> tags (child tags of <samplesource> tags). If you use these tags you will be shown a warning when going to edit sample sources in the Survey Editor.
  • <if> tags will be converted to <block> tags with “cond” attribute intact.
  • <random> tags will be converted to <block> tags with “randomize” attribute set.
  • <net> tags (children of question-type tags)
  • <nets> tags (children of <float> and <number> tags)
  • <sbase> tag is available to <survey> and question-type tags
  • <onLoad> tag is available most everywhere
  • <weights> tag is available as a child of the <survey> tag
  • <alt> tag is available as child of question-type tags.  It will be converted to an attribute by the XML Editor.  <alt> tags as children of <survey> tags will remain tags.
  • Leading <suspend/> tags are automatically inserted into the survey (as currently required by the Survey Editor) if they do not already exist.

Tags Not Supported by the Survey Editor

The following tags are NOT supported by the Survey Editor and will cause validation errors:

  • <comment> is invalid (however, <comment> tags inside questions are valid)
  • <else> is invalid
  • <finish> is invalid
  • <group> tags are supported to a maximum level of 1
  • <notify> is invalid
  • “doit” is no longer supported as an attribute for a <quota> tag.
  • <onLoad> tag is available most everywhere

Note: If <onLoad> functionality is desired, you can add a reusable answer list with <insert> instead.

Any of these (and macros!) are valid within a <blackbox> tag, which is editable in the Survey Editor. An example would be:

<blackbox id="UNIQUE1" label="bar">
 <arg id="UNIQUE2" name="label" datatype="str">bar</arg>
 <arg id="UNIQUE3" name="code" datatype="longstr"/>
 <code>
    <exec>
    print 'Hello, world!'
    </exec>
 </code>
</blackbox>
  • Was this article helpful?