Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xf="http://www.w3.org/2002/xforms"> <head> <xf:model> <xf:instance id="selected-values" xmlns=""> <instance> <pets/> <favorite/> </instance> </xf:instance> <xf:instance id="pets" xmlns=""> <root> <item name="Cat" value="cat"/> <item name="Dog" value="dog"/> <item name="Fish" value="fish"/> <item name="Cobra" value="cobra"/> </root> </xf:instance> </xf:model> </head> <body> <xf:select ref="pets" appearance="full"> <xf:label>Please list all your pets:</xf:label> <xf:itemset nodeset="instance('pets')/item"> <xf:label ref="@name"/> <xf:value ref="@value"/> </xf:itemset> </xf:select> <br/> <xf:select1 ref="favorite"> <xf:label>Select your favorite pet:</xf:label> <xf:itemset> <xf:label/> <xf:value/> </xf:itemset> <xf:itemset nodeset="instance('pets')/item[@value = tokenize(context()/../pets, '\s+')]"> <xf:label ref="@name"/> <xf:value ref="@value"/> </xf:itemset> </xf:select1> </body> </html>
This paste will be private.
From the Design Piracy series on my blog: