Kai Lahmann: XHTML 2.0 WD

Beitrag lesen

hi

Naja - Gott-sei-Dank ändert sich öfters was in der Branche, sonst wärs ja doch langweilig und für die ganzen 14-Jährigen Schülern, die den ganzen Tag vorm PC sitzen, viel zu leicht, uns zu übertreffen ;)

haha - für die neuen Tags habe ich sogar schon eine Implementierung (wenn man ds so nennen kann...), indem ich die zusätzlichen CSS-Regeln gesammelt habe (sind sehr wenige!).

Hm - Was sind xforms ?

Das ist ein Standard (naja, oder beinahe-Standard - LastCall für die Experten) des W3C für eine Neuordnung von Formularen im Internet. Der Hauptgrund ist auch hier die Trennung von Funktion und Layout. Ich muss allerdings gestehen, dass ich da noch nicht ganz durchgestiegen bin...

Ein Beispiel:
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xforms="http://www.w3.org/2002/01/xforms"
      xmlns:xlink="http://www.w3.org/1999/xlink"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:my="http://commerce.example.com/payment"
      xml:lang="en">
  <head>
    <title>XForms in XHTML</title>

xforms:model
      xforms:instance
        <payment as="credit" xmlns="http://commerce.example.com/payment">
          <cc/>
          <exp/>
        </payment>
      </xforms:instance>
      <xforms:schema xlink:href="payschema.xsd"/>
      <xforms:submitInfo action="http://example.com/submit" method="post" id="s00"/>
      <xforms:bind ref="my:payment/my:cc"
                   relevant="../my:payment/@as = 'credit'"
                   required="true" type="my:cc"/>
      <xforms:bind ref="my:payment/my:exp"
                   relevant="../my:payment/@as = 'credit'"
                   required="true" type="xsd:gYearMonth"/>
    </xforms:model>
  </head>
  <body>
    ...
    <group xmlns="http://www.w3.org/2002/01/xforms" ref="my:payment">
      <selectOne ref="@as">
        <caption>Select Payment Method</caption>
        <choices>
          <item>
            <caption>Cash</caption>
            <value>cash</value>
          </item>
          <item>
            <caption>Credit</caption>
            <value>credit</value>
          </item>
        </choices>
      </selectOne>

<input ref="my:cc">
        <caption>Credit Card Number</caption>
      </input>

<input ref="my:exp">
        <caption>Expiration Date</caption>
      </input>

<submit submitInfo="s00">
        <caption>Submit Form</caption>
      </submit>
    </group>
    ...
  </body>
</html>

noch fragen? ;)

Grüße aus Bleckede

kai