Skip to content

Instantly share code, notes, and snippets.

@sardinecan
Created April 12, 2019 15:46
Show Gist options
  • Save sardinecan/9a29df0e1ee12f8bd647301d15cdc2a7 to your computer and use it in GitHub Desktop.
Save sardinecan/9a29df0e1ee12f8bd647301d15cdc2a7 to your computer and use it in GitHub Desktop.
Xforms : instance avec espace de nom
declare
%rest:path("/testNamespace")
%output:method("xml")
function test() {
(processing-instruction xml-stylesheet {'href="static/xsltforms/xsltforms/xsltforms.xsl"', 'type="text/xsl"'},
processing-instruction css-conversion {'no'},
<html
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:test="test">
<head>
<title>Test of XForms Submission Namespace Inclusion</title>
<xf:model>
<xf:instance>
<model xmlns="test">
<element/>
</model>
</xf:instance>
<xf:bind nodeset="test:element" id="test"/>
</xf:model>
</head>
<body>
<h1>Xforms namespace test</h1>
<div>
<xf:input bind="test">
<xf:label>ID: </xf:label>
</xf:input>
<pre>
<xf:output value="serialize(test:element, yes)"/>
</pre>
</div>
</body>
</html>
)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment