Skip to content

Instantly share code, notes, and snippets.

@lacco
Created April 26, 2010 22:05

Revisions

  1. lacco revised this gist Apr 26, 2010. 1 changed file with 0 additions and 13 deletions.
    13 changes: 0 additions & 13 deletions html-view.xpl
    Original file line number Diff line number Diff line change
    @@ -1,17 +1,4 @@
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Copyright (C) 2008 Orbeon, Inc.
    This program is free software; you can redistribute it and/or modify it under the terms of the
    GNU Lesser General Public License as published by the Free Software Foundation; either version
    2.1 of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU Lesser General Public License for more details.
    The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
    -->
    <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  2. lacco created this gist Apr 26, 2010.
    150 changes: 150 additions & 0 deletions html-view.xpl
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,150 @@
    <?xml version="1.0" encoding="UTF-8"?>
    <!--
    Copyright (C) 2008 Orbeon, Inc.
    This program is free software; you can redistribute it and/or modify it under the terms of the
    GNU Lesser General Public License as published by the Free Software Foundation; either version
    2.1 of the License, or (at your option) any later version.
    This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
    without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    See the GNU Lesser General Public License for more details.
    The full text of the license is available at http://www.gnu.org/copyleft/lesser.html
    -->
    <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:oxf="http://www.orbeon.com/oxf/processors"
    xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns:xxi="http://orbeon.org/oxf/xml/xinclude">

    <!-- Unroll the form (theme, components, inclusions) -->
    <p:processor name="oxf:pipeline">
    <p:input name="config" href="unroll-form.xpl"/>
    <p:input name="instance">
    <root>
    <app>Foo</app><form>Bar</form><document>1</document><mode>view</mode>
    </root>
    </p:input>
    <p:input name="data">
    <xhtml:html xmlns:xhtml="http://www.w3.org/1999/xhtml"
    xmlns:xforms="http://www.w3.org/2002/xforms"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:ev="http://www.w3.org/2001/xml-events"
    xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns:xxi="http://orbeon.org/oxf/xml/xinclude"
    xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"
    xmlns:exforms="http://www.exforms.org/exf/1-0"
    xmlns:fr="http://orbeon.org/oxf/xml/form-runner"
    xmlns:saxon="http://saxon.sf.net/"
    xmlns:sql="http://orbeon.org/oxf/xml/sql"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <xhtml:head>
    <xhtml:title>Untitled Form</xhtml:title>
    <xforms:model id="fr-form-model">
    <xforms:instance id="fr-form-instance">
    <form>
    <section-1>
    <control-1/>
    </section-1>
    </form>
    </xforms:instance>


    <xforms:bind id="fr-form-binds" nodeset="instance('fr-form-instance')">
    <xforms:bind id="section-1-bind" nodeset="section-1">
    <xforms:bind id="control-1-bind" name="control-1" nodeset="control-1"/>
    </xforms:bind>
    </xforms:bind>


    <xforms:instance id="fr-form-metadata" xxforms:readonly="true">
    <metadata>
    <application-name>test</application-name>
    <form-name>test</form-name>
    <title xml:lang="en">Untitled Form</title>
    <description xml:lang="en"/>
    <author/>
    <logo mediatype="" filename="" size=""/>
    </metadata>
    </xforms:instance>


    <xforms:instance id="fr-form-attachments">
    <attachments>
    <css mediatype="text/css" filename="" size=""/>
    <pdf mediatype="application/pdf" filename="" size=""/>
    </attachments>
    </xforms:instance>



    <xforms:instance id="fr-form-resources" xxforms:readonly="false">
    <resources>
    <resource xml:lang="en">
    <section-1>
    <label>Kontaktdaten</label>
    <help/>
    </section-1>
    <control-1>
    <label>Name</label>
    <hint/>
    <help/>
    <alert/>
    </control-1>
    </resource>
    </resources>
    </xforms:instance>


    <xforms:instance id="fr-service-request-instance" xxforms:exclude-result-prefixes="#all">
    <request/>
    </xforms:instance>

    <xforms:instance id="fr-service-response-instance" xxforms:exclude-result-prefixes="#all">
    <response/>
    </xforms:instance>

    </xforms:model>
    </xhtml:head>
    <xhtml:body>
    <fr:view>
    <xforms:label ref="instance('fr-form-metadata')/title"/>
    <fr:body>
    <fr:section id="section-1-section" bind="section-1-bind">
    <xforms:label ref="instances('fr-form-resources')/section-1/label"/>
    <xforms:help ref="instances('fr-form-resources')/section-1/help"/>
    <fr:grid columns="2">
    <xhtml:tr>
    <xhtml:td>
    <xforms:input id="control-1-control" bind="control-1-bind">
    <xforms:label ref="instances('fr-form-resources')/control-1/label"/>
    <xforms:hint ref="instances('fr-form-resources')/control-1/hint"/>
    <xforms:help ref="instances('fr-form-resources')/control-1/help"/>
    </xforms:input>
    </xhtml:td>
    <xhtml:td/>
    </xhtml:tr>
    </fr:grid>
    </fr:section>
    </fr:body>
    </fr:view>
    </xhtml:body>
    </xhtml:html>
    </p:input>
    <p:output name="data" id="outout"/>
    </p:processor>

    <p:processor name="oxf:xml-serializer">
    <p:input name="data" href="#outout"/>
    <p:input name="config">
    <config>
    <indent-amount>4</indent-amount>
    </config>
    </p:input>
    </p:processor>

    </p:config>