<xs:attribute name="stub" default="false">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="true"/>
<xs:enumeration value="false"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
This creates an optional attribute "stub" that is a string which could either be "true" or "false" and is by default "false".
That wasn't too hard to figure out. The harder part was getting my XSLT file to only display non-stub questions.
My first try was
<xsl:if test="@stub != 'false'">
(I used != because of the default).This however never showed any of my questions. It turns out that != doesn't work when an element doesn't exist. After asking around on IRC
<xsl:if test="not(@stub = 'true')">
appears to be the correct way to do things.
No comments:
Post a Comment
Have something you want to say? You think I'm wrong? Found something I said useful?
Leave a comment!