@wuiXslProcessButton(XML, XSL, [LABEL], [MIME_TYPE], [TITLE], [FORMATTRS], [XSLTPROC_PARAMS], [BUTTONATTRS])

Insert a single form button to apply a XSL style sheet to a XML document.

The following parameters are recognized:

XML

The full path to the XML file to process (on the server).

XSL

The full path to the XSL file to apply (on the server).

[LABEL]

The text the user clicks on. If omitted defaults to Process XML.

[MIME_TYPE]

The MIME type describing the results that will be returned. If omitted defaults to text/html.

[TITLE]

Optional title attribute to appear as a tooltip to the user when their mouse hovers over the button.

[FORMATTRS]

Optional set of attributes to apply to form entity.

[XSLTPROC_PARAMS]

Optional set of additional parameters to pass to the xsltproc invocation (like: "-stringparam gpsFile ${GPSFILEPATH}").

[BUTTONATTRS]

Optional set of attributes to apply to input button entity.

This macro is useful when you want to apply a XSL style sheet to a XML document and return the resulting output (typically nice looking HTML) back to the user.

Example of using the macro:

@wuiXslProcessButton("/var/log/nmap.xml","/usr/share/xsl/nmap.xsl","Format nmap XML",,,"@htmlAttr("target","_blank")")

Assuming the com.ccg.macros.at.All class is within your CLASSPATH and the config/html.at macros file has been generated (Hint: run make atmacros in the wui directory), a developer should be able to run the above example by copy/pasting from below:

[root@probe root]# java com.ccg.macros.at.All <<EOF
@include("config/html.at",,"d")
@wuiXslProcessButton("/var/log/nmap.xml","/usr/share/xsl/nmap.xsl","Format nmap XML",,,"@htmlAttr("target","_blank")")
EOF

This macro is defined as:

<form@htmlAttr("action","@topDir()/cgi-bin/system/xsltproc.cgi")@ifEqual("@param(5)",,,"@param(5)")>
@wuiInputHidden("xml","@param(0)")
@wuiInputHidden("xsl","@param(1)")
@wuiInputHidden("mime","@fnb("@param(3)","text/html")")
@ifEqual("@param(6)",,,"@wuiInputHidden("xsltprocParams","@param(6)")")
@wuiInputButton("xsltproc","@fnb("@param(2)","Process XML")","@param(4)","@param(7)")
</form>