<html>
<head>
<style><!--
  body {background-color:#ffffff;}
  .file {border:1px solid #eeeeee;margin-top:1em;margin-bottom:1em;}
  .pathname {font-family:monospace; float:right;}
  .fileheader {margin-bottom:.5em;}
  .diff {margin:0;}
  .tasklist {padding:4px;border:1px dashed #000000;margin-top:1em;}
  .tasklist ul {margin-top:0;margin-bottom:0;}
  tr.alt {background-color:#eeeeee}
  #added {background-color:#ddffdd;}
  #addedchars {background-color:#99ff99;font-weight:bolder;}
  tr.alt #added {background-color:#ccf7cc;}
  #removed {background-color:#ffdddd;}
  #removedchars {background-color:#ff9999;font-weight:bolder;}
  tr.alt #removed {background-color:#f7cccc;}
  #copied {background-color:#ccccff;}
  tr.alt #copied {background-color:#bbbbf7;}
  #info {color:#888888;}
  #context {background-color:#eeeeee;}
  td {padding-left:.3em;padding-right:.3em;}
  tr.head {border-bottom-width:1px;border-bottom-style:solid;}
  tr.head td {padding:0;padding-top:.2em;}
  .task {background-color:#ffff00;}
  .comment {white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;white-space:pre-wrap;word-wrap:break-word;padding:4px;border:1px dashed #000000;background-color:#ffffdd}
  .error {color:red;}
  hr {border-width:0px;height:2px;background:black;}
--></style>
</head>
<body>
<table cellspacing="0" cellpadding="0" border="0" rules="cols">
<tr class="head"><td colspan="5">Commit in <b><tt>asxsd/trunk/src</tt></b></td></tr>
<tr><td><tt>main/java/uk/co/badgersinfoil/asxsd/components/<a href="#file1">ElementDeclarationComponent.java</a></tt> </td><td></td><td align="right" id="added">+10</td><td align="right" id="removed">-1</td><td nowrap="nowrap" align="center">184 -&gt; 185</td></tr>
<tr class="alt"><td><tt>test/resources/xsd/<a href="#file2">UnionSimpleTypeTest.xsd</a></tt> </td><td></td><td align="right" id="added">+14</td><td></td><td nowrap="nowrap" align="center">184 -&gt; 185</td></tr>
<tr><td></td><td></td><td align="right" id="added">+24</td><td align="right" id="removed">-1</td><td></td></tr>
</table>
<small id="info">2 modified files</small><br />
<pre class="comment">
fix handling of unions in anonymous simpleTypes
</pre>
<hr /><a name="file1" /><div class="file">
<span class="pathname">asxsd/trunk/src/main/java/uk/co/badgersinfoil/asxsd/components</span><br />
<div class="fileheader"><big><b>ElementDeclarationComponent.java</b></big> <small id="info">184 -&gt; 185</small></div>
<pre class="diff"><small id="info">--- trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/ElementDeclarationComponent.java        2007-11-12 00:08:08 UTC (rev 184)
+++ trunk/src/main/java/uk/co/badgersinfoil/asxsd/components/ElementDeclarationComponent.java        2007-11-12 00:37:15 UTC (rev 185)
@@ -9,6 +9,7 @@
</small></pre><pre class="diff" id="context"> import org.eclipse.xsd.XSDElementDeclaration;
 import org.eclipse.xsd.XSDSimpleTypeDefinition;
 import org.eclipse.xsd.XSDTypeDefinition;
</pre><pre class="diff" id="added">+import org.eclipse.xsd.XSDVariety;
</pre><pre class="diff" id="context"> import uk.co.badgersinfoil.asxsd.BasicMappingFunction;
 import uk.co.badgersinfoil.asxsd.CodegenContext;
 import uk.co.badgersinfoil.asxsd.CodegenRole;
</pre><pre class="diff"><small id="info">@@ -50,12 +51,20 @@
</small></pre><pre class="diff" id="context">         {
                 XSDElementDeclaration elementDecl = (XSDElementDeclaration)component;
                 XSDTypeDefinition typeDef = elementDecl.getTypeDefinition();
</pre><pre class="diff" id="removed">-                if (XSDUtils.isAnonymous(typeDef)) {
</pre><pre class="diff" id="added">+                if (XSDUtils.isAnonymous(typeDef) &amp;&amp; !nonAtomic(typeDef)) {
</pre><pre class="diff" id="context">                         return super.typeDescriptorFor(context, elementDecl);
                 }
                 return context.typeDescriptorFor(typeDef);
         }
 
</pre><pre class="diff" id="added">+        private static boolean nonAtomic(XSDTypeDefinition typeDef) {
+                if (typeDef instanceof XSDComplexTypeDefinition) {
+                        return false;
+                }
+                XSDSimpleTypeDefinition simpleType = (XSDSimpleTypeDefinition)typeDef;
+                return simpleType.getVariety() != XSDVariety.ATOMIC_LITERAL;
+        }
+
</pre><pre class="diff" id="context">         public ASCompilationUnit createType(CodegenContext context,
                                          XSDConcreteComponent component)
         {
</pre></div>
<hr /><a name="file2" /><div class="file">
<span class="pathname">asxsd/trunk/src/test/resources/xsd</span><br />
<div class="fileheader"><big><b>UnionSimpleTypeTest.xsd</b></big> <small id="info">184 -&gt; 185</small></div>
<pre class="diff"><small id="info">--- trunk/src/test/resources/xsd/UnionSimpleTypeTest.xsd        2007-11-12 00:08:08 UTC (rev 184)
+++ trunk/src/test/resources/xsd/UnionSimpleTypeTest.xsd        2007-11-12 00:37:15 UTC (rev 185)
@@ -3,6 +3,20 @@
</small></pre><pre class="diff" id="context">            xmlns:t="http://example.org/test"
            targetNamespace="http://example.org/test"&gt;
   &lt;complexType name="Test"&gt;
</pre><pre class="diff" id="added">+    &lt;sequence&gt;
+      &lt;element name="b" minOccurs="0"&gt;
+        &lt;simpleType&gt;
+          &lt;union&gt;
+            &lt;simpleType&gt;
+              &lt;restriction base="NMTOKEN"/&gt;
+            &lt;/simpleType&gt;
+            &lt;simpleType&gt;
+              &lt;restriction base="int"/&gt;
+            &lt;/simpleType&gt;
+          &lt;/union&gt;
+        &lt;/simpleType&gt;
+      &lt;/element&gt;
+    &lt;/sequence&gt;
</pre><pre class="diff" id="context">     &lt;attribute name="a" type="t:Simp"&gt;
     &lt;/attribute&gt;
   &lt;/complexType&gt;
</pre></div>
<center><small><a href="http://www.badgers-in-foil.co.uk/projects/cvsspam/" title="commit -&gt; email">CVSspam</a> 0.2.12</small></center>
</body></html>