< XForms

Motivation

Why are you creating this example? Should start with "You want to..."

Screen Image

A sample screen image. Many people do not have the ability to run the examples so this is critical.

Use this format:

Make SURE you label all images with a license. Please use creative commons share alike with attribution if you can.

Sample Code

  • Please make the default namespace xhtml.
  • Please use the xf as the namespace prefix for all XForms elements.
  • Use spaces to indent, not tabs. Wikimedia and browsers use different setting for tab-stops. This can not be changed.
  • Wrap your source code using the source element to give the code syntax highlighting:
   <source lang="xml">
   ...
   </source>

Sample XForms Template

<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">
   <head>
       <title>Form Title</title>
       <style type="text/css">
          @namespace xf url("http://www.w3.org/2002/xforms");
          body {font-family:Helvetica, sans-serif;}
       </style>
       <xf:model>
          <xf:instance xmlns="">
            <data>
               <my-element>Hello World</my-element>
            </data>
          </xf:instance>
       </xf:model>
    </head>
    <body>
         <xf:input ref="my-element">
            <xf:label>Message: </xf:label>
         </xf:input>
    </body>
</html>

Auto navigation macro

Please place the following macro at the end of each example:

{{auto navigation|NextExample|PriorExample}}


This allows readers to just page through the examples without using the back button.

Discussion

Some analysis of the more difficult or unusual sections of the example. Any long complex XPath expressions should be explained on a step-by-step basis.

Credits

Make sure you give credits to other examples that people have done. Our license is Sharealike with Attribution so we want to also give other developers attribution if they started some examples. Give a URL to the original author's code if you can.

This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.