AnsweredAssumed Answered

Form Documentation

Question asked by baltner on Apr 5, 2017
Latest reply on Apr 11, 2017 by rickbakker

Greetings:

 

I want to start documenting the forms we have created with Nintex Forms, including the form's controls, variables, rules, etc. I started doing this manually but then realized that the Form.xml  (exported form) already has all the information that I want (and much more) but to make it more readable I'd need to convert it into an HTML format, showing only the information that I am interested in.  This, of course, suggested that I write an XSLT stylesheet to transform the exported Form.xml into an informative, self-documenting, web page.  Good idea but...

 

...so far I have been unable to transform the Form.xml, even for such  such a simple purpose as displaying just the display names of the controls. For example, here is an XSLT style sheet (demo2.xslt) to display all the control DisplayName elements:

 

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" xmlns:d3p1="http://schemas.datacontract.org/2004/07/Nintex.Forms.SharePoint.FormControls" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Nintex.Forms" version="1.0">

<xsl:output method="html"/>
<xsl:template match="/">
<html>
<head><title>Nintex Form Documentation Browser</title></head>
<body>
<h1>Form Controls</h1>

<xsl:apply-templates />
</xsl:template>
</body>
</html>

<xsl:template match="FormControls">
<xsl:apply-templates select="d2p1:FormControlProperties"/>
</xsl:template>

<xsl:template match="d2p1:FormControlProperties">
<xsl:apply-templates select="d2p1:DisplayName"/>
</xsl:template>

<xsl:template match="d2p1:DisplayName">
<b>Display Name: <xsl:value-of select="." /></b><br/>
</xsl:template>

</xsl:stylesheet>

 

I add this to the Form.xml file like this:

 

<?xml version="1.0" encoding="utf-16"?>
<?xml-stylesheet href="demo2.xslt" type="text/xsl"?>
<Form xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Nintex.Forms">
<AddListFormWebPartSubmitMessage>false</AddListFormWebPartSubmitMessage><AssignedUseSetting>Production</AssignedUseSetting><Category i:nil="true" /><Css>
/* Template styles */

...etc. for the rest of the file

 

In some browsers, such as IE, including this stylesheet in the XML should transform the form xml into an HTML file showing only the control names.  However, this doesn't work for me.  I have tried many permutations of the XSLT stylesheet but always get something like this:

 

falseProduction /* Template styles */ .nf-form-input { background-color: #ffffff; } .nf-form-input .nf-filler-control-inner, .nf-form-label .nf-filler-control-inner { top: 10px; bottom: 10px; left: 10px; right: 10px; } .nf-form-input .nf-textbox-wrapper { left: 0px; right: 0px; } .nf-section { border-top: 1px solid #FF0000; margin-top: -1px; } .nf-section-bottom { border-top: 2px solid #FF0000; margin-top: -2px; } .nf-item { background-color: white; } .nf-item-alternating { background-colo

...etc...

 

Notice that even though my stylesheet should be skipping all the junk at the beginning (before <FormControls...> in the XML it is still showing the contents of the AddListFormWebPartSubmitMessage, AssignedUseSetting, and  Css elements.

 

So my questions are these:  a) hasn't anybody done this before?  It seems like a natural way to self-document a form, and b) what's wrong with the above XSLT when applied to the Form.XML?

 

Thanks, in advance,

Bruce

Outcomes