title: XSLT check value against enumeration or default to something else
body: <p>I'm attempting to convert a Time Zone value from one system to a different value to be pushed to another.</p>
  
  <p>All good I wish they had of used state names instead of city names but never mind, this is an integration and can not be changed in both systems to just match each other.</p>
  
  <p>I'm using XSLT to translate 1 xml document to another to do this.</p>
  
  <p>In <strong>source</strong> system the time zone string one of the following:</p>
  
  <pre><code>Australia/Adelaide
  Australia/Brisbane
  Australia/Canberra
  Australia/Darwin
  Australia/Hobart
  Australia/Melbourne
  Australia/Perth
  Australia/Sydney
  </code></pre>
  
  <p>In the <strong>target</strong> system the time zones are set up as per the following:</p>
  
  <pre><code>Australia/Adelaide
  Australia/Brisbane
  Australia/Canberra,Melbourne,Sydney
  Australia/Darwin
  Australia/Hobart
  Australia/Perth
  </code></pre>
  
  <p>I know I can just use a <code>&lt;xsl:choose&gt;</code> and use <code>&lt;xs:when&gt;</code> etc to determine each string, but wanted to learn how to compare what's coming in from source against the enumeration source type, if it exists use it, if it doesn't exist then use a default value. Is this possible.</p>
  
  <p>My enumeration in the <strong>xslt</strong> is defined per the target system as that what's required:</p>
  
  <pre><code>&lt;xs:simpleType name="timeZoneType"&gt;
      &lt;xs:restriction base="xs:string"&gt;
          &lt;xs:enumeration value="Australia/Canberra,Melbourne,Sydney" /&gt;
          &lt;xs:enumeration value="Australia/Adelaide" /&gt;
          &lt;xs:enumeration value="Australia/Brisbane" /&gt;
          &lt;xs:enumeration value="Australia/Darwin" /&gt;
          &lt;xs:enumeration value="Australia/Hobart" /&gt;
          &lt;xs:enumeration value="Australia/Perth" /&gt;
      &lt;/xs:restriction&gt;
  &lt;/xs:simpleType&gt;
  </code></pre>
  
  <p>Cheers in advance for any help</p>