[jboss-svn-commits] JBoss Common SVN: r4237 - in jbossxb/trunk/src: main/java/org/jboss/xb/builder and 4 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Apr 9 05:30:11 EDT 2010


Author: alex.loubyansky at jboss.com
Date: 2010-04-09 05:30:10 -0400 (Fri, 09 Apr 2010)
New Revision: 4237

Added:
   jbossxb/trunk/src/test/java/org/jboss/test/xml/JNDIBindingUnitTestCase.java
   jbossxb/trunk/src/test/java/org/jboss/test/xml/naming/
   jbossxb/trunk/src/test/java/org/jboss/test/xml/naming/JNDIBinding.java
   jbossxb/trunk/src/test/java/org/jboss/test/xml/naming/JNDIBindings.java
Modified:
   jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/AbstractPosition.java
   jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ElementPosition.java
   jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/WildcardBinding.java
   jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java
   jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/BuilderParticleHandler.java
   jbossxb/trunk/src/test/resources/xml/naming/jndi-binding-service_1_0.xsd
   jbossxb/trunk/src/test/resources/xml/naming/testBindings.xml
Log:
JBXB-247

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/AbstractPosition.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/AbstractPosition.java	2010-04-09 01:08:05 UTC (rev 4236)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/AbstractPosition.java	2010-04-09 09:30:10 UTC (rev 4237)
@@ -78,10 +78,10 @@
 
       if(particle.isRepeatable())
          repeatableHandler = term.getRepeatableHandler();
-      
-      if(skip)
-         handler = DefaultHandlers.UOE_PARTICLE_HANDLER;
-      else
+
+//      if(skip)
+//         handler = DefaultHandlers.UOE_PARTICLE_HANDLER;
+//      else
          initHandler();
    }
 
@@ -136,12 +136,13 @@
 
    protected void initValue(Attributes atts)
    {
-      if(skip)
-      {
-         o = previous == null ? null : previous.o;
-         return;
-      }
-      
+
+// attributes and characters of skipped elements should be set on the parent
+//      if(skip)
+//      {
+//         o = previous == null ? null : previous.o;
+//         return;
+//      }
       Object parent = previous == null ? null : previous.o;
       o = handler.startParticle(parent, qName, particle, atts, stack.getNamespaceRegistry());
    }

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ElementPosition.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ElementPosition.java	2010-04-09 01:08:05 UTC (rev 4236)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/ElementPosition.java	2010-04-09 09:30:10 UTC (rev 4237)
@@ -267,8 +267,6 @@
    public void endParticle()
    {
       ended = true;
-      if(skip)
-         return;
       
       ElementBinding element = (ElementBinding) term;
       List<ElementInterceptor> interceptors = null;
@@ -400,6 +398,9 @@
          o = null;
       }
 
+      if(skip)
+         return;
+
       //
       // endElement
       //

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/WildcardBinding.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/WildcardBinding.java	2010-04-09 01:08:05 UTC (rev 4236)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/binding/sunday/unmarshalling/WildcardBinding.java	2010-04-09 09:30:10 UTC (rev 4237)
@@ -345,7 +345,7 @@
       @Override
       protected void initHandler()
       {
-         handler = DefaultHandlers.UOE_PARTICLE_HANDLER;
+         handler = DefaultHandlers.NOOP_PARTICLE_HANDLER;
       }
    }
 }

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java	2010-04-09 01:08:05 UTC (rev 4236)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/JBossXBNoSchemaBuilder.java	2010-04-09 09:30:10 UTC (rev 4237)
@@ -2174,10 +2174,10 @@
    {
       TypeBinding wrapperType = new TypeBinding();
       SequenceBinding seq = new SequenceBinding(schemaBinding);
-      seq.setHandler(DefaultHandlers.UOE_PARTICLE_HANDLER);
+      seq.setHandler(DefaultHandlers.NOOP_PARTICLE_HANDLER);
       ParticleBinding particle = new ParticleBinding(seq);
       wrapperType.setParticle(particle);
-      wrapperType.setHandler(DefaultHandlers.UOE_PARTICLE_HANDLER);
+      wrapperType.setHandler(DefaultHandlers.NOOP_PARTICLE_HANDLER);
 
       ElementBinding wrapperElement = createElementBinding(propertyType, wrapperType, wrapperQName, false);
       wrapperElement.setNillable(annotation.nillable());

Modified: jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/BuilderParticleHandler.java
===================================================================
--- jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/BuilderParticleHandler.java	2010-04-09 01:08:05 UTC (rev 4236)
+++ jbossxb/trunk/src/main/java/org/jboss/xb/builder/runtime/BuilderParticleHandler.java	2010-04-09 09:30:10 UTC (rev 4237)
@@ -99,7 +99,7 @@
    public static ParticleHandler parentGroup(final ModelGroupBinding group)
    {
       if(group.isSkip())
-         return DefaultHandlers.UOE_PARTICLE_HANDLER;
+         return DefaultHandlers.NOOP_PARTICLE_HANDLER;
       
       ParticleHandler handler = group.getHandler();
       if(handler == null)

Added: jbossxb/trunk/src/test/java/org/jboss/test/xml/JNDIBindingUnitTestCase.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/JNDIBindingUnitTestCase.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/JNDIBindingUnitTestCase.java	2010-04-09 09:30:10 UTC (rev 4237)
@@ -0,0 +1,116 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2009, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.test.xml;
+
+import java.net.InetAddress;
+import java.net.URL;
+import java.util.Properties;
+
+import org.jboss.test.xml.naming.JNDIBinding;
+import org.jboss.test.xml.naming.JNDIBindings;
+import org.jboss.xb.binding.Unmarshaller;
+import org.jboss.xb.binding.UnmarshallerFactory;
+import org.jboss.xb.binding.resolver.MultiClassSchemaResolver;
+
+/**
+ * A JNDIBindingUnitTestCase.
+ * 
+ * @author <a href="alex at jboss.com">Alexey Loubyansky</a>
+ * @version $Revision: 1.1 $
+ */
+public class JNDIBindingUnitTestCase extends AbstractJBossXBTest
+{
+   public JNDIBindingUnitTestCase(String name)
+   {
+      super(name);
+   }
+
+   public void testJNDIBinding() throws Exception
+   {
+      MultiClassSchemaResolver resolver = new MultiClassSchemaResolver();
+      resolver.mapSchemaLocation("urn:jboss:jndi-binding-service:1.0", "xml/naming/jndi-binding-service_1_0.xsd");
+      resolver.mapSchemaLocation("urn:jboss:custom-object-binding", "xml/naming/custom-object-binding.xsd");
+
+      String xml = getFullPath("xml/naming/testBindings.xml");
+
+      Unmarshaller unmarshaller = UnmarshallerFactory.newInstance().newUnmarshaller();
+      JNDIBindings jndiBindings = (JNDIBindings) unmarshaller.unmarshal(xml, resolver);
+      assertNotNull(jndiBindings);
+      JNDIBinding[] bindings = jndiBindings.getBindings();
+      assertNotNull(bindings);
+      assertEquals(5, bindings.length);
+      
+      JNDIBinding binding = bindings[0];
+      assertNotNull(binding);
+      assertEquals("ctx1/key1", binding.getName());
+      assertEquals("value1", binding.getValue());
+      assertNull(binding.getEditor());
+      assertNull(binding.getType());
+      assertTrue(binding.isTrim());
+      
+      binding = bindings[1];
+      assertNotNull(binding);
+      assertEquals("ctx1/user.home", binding.getName());
+      assertEquals(System.getProperty("user.home"), binding.getValue());
+      assertNull(binding.getEditor());
+      assertNull(binding.getType());
+      assertTrue(binding.isTrim());
+      
+      binding = bindings[2];
+      assertNotNull(binding);
+      assertEquals("ctx1/key2", binding.getName());
+      assertEquals(new URL("http://www.jboss.org"), binding.getValue());
+      assertNull(binding.getEditor());
+      assertEquals("java.net.URL", binding.getType());
+      assertTrue(binding.isTrim());
+
+      binding = bindings[3];
+      assertNotNull(binding);
+      assertEquals("ctx2/key1", binding.getName());
+      Properties props = (Properties) binding.getValue();
+      assertNotNull(props);
+      assertEquals(2, props.size());
+      assertEquals("value1", props.getProperty("key1"));
+      assertEquals("value2", props.getProperty("key2"));
+      assertNull(binding.getEditor());
+      assertNull(binding.getType());
+      assertFalse(binding.isTrim());
+
+      binding = bindings[4];
+      assertNotNull(binding);
+      assertEquals("hosts/localhost", binding.getName());
+      assertEquals(InetAddress.getByName("127.0.0.1"), binding.getValue());
+      assertEquals("org.jboss.util.propertyeditor.InetAddressEditor", binding.getEditor());
+      assertNull(binding.getType());
+      assertTrue(binding.isTrim());
+   }
+   
+   private String getFullPath(String name)
+   {
+      URL url = Thread.currentThread().getContextClassLoader().getResource(name);
+      if(url == null)
+      {
+         fail("Resource not found: " + name);
+      }
+      return url.getFile();
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xml/naming/JNDIBinding.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/naming/JNDIBinding.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/naming/JNDIBinding.java	2010-04-09 09:30:10 UTC (rev 4237)
@@ -0,0 +1,182 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.xml.naming;
+
+import java.beans.PropertyEditor;
+
+import org.jboss.util.propertyeditor.PropertyEditors;
+
+/**
+ * A representation of a binding into JNDI.
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 81030 $
+ */
+public class JNDIBinding
+{
+   /** The jndi name to bind under */
+   private String name;
+   /** The binding text */
+   private String text;
+   /** The optional binding type the text should be converted to */
+   private String type;
+   /** The optional explicit PropertyEditor implementation class */
+   private String editor;
+   /** The actual binding value */
+   private Object value;
+   /** A flag indicating if the text should be trimmed */
+   private boolean trim;
+
+   /**
+    * The JNDI name to bind under
+    * @return
+    */ 
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   /**
+    * The text representation of the binding
+    * @return
+    */ 
+   public String getText()
+   {
+      return text;
+   }
+   /**
+    * Set the text representation of the binding. If the replace attribute
+    * is true, the text will be searched for system property references of the
+    * form ${x}.
+    * 
+    * @param text
+    */ 
+   public void setText(String text)
+   {
+      if( trim == true )
+         text = text.trim();
+      this.text = text;     
+   }
+
+   /**
+    * The optional type the text representation should be converted to.
+    * 
+    * @return
+    */ 
+   public String getType()
+   {
+      return type;
+   }
+   /**
+    * 
+    * @param type - type the text representation should be converted to.
+    */ 
+   public void setType(String type)
+   {
+      this.type = type;
+   }
+
+   /**
+    * The optional PropertyEditor implementation class name.
+    * @return
+    */ 
+   public String getEditor()
+   {
+      return editor;
+   }
+   /**
+    * 
+    * @param editor - the optional PropertyEditor implementation class name.
+    */ 
+   public void setEditor(String editor)
+   {
+      this.editor = editor;
+   }
+
+   /**
+    * Object the binding value. If there is a binding from an external xml
+    * fragment it will be whatever that was. If there is a type it will be the
+    * value as obtained by converting the text of the value element to an object
+    * using the type PropertyEditor. If there is an explicit PropertyEditor
+    * given by the editor attribute that will be used to convert the text into
+    * an object.
+    * 
+    * @return the value binding
+    * @throws Exception - on failure to load/use the PropertyEditor
+    */ 
+   public Object getValue() throws Exception
+   {
+      if( value == null && text != null )
+      {
+         // If there is a property editor set, transform text to value
+         if( editor != null )
+         {
+            ClassLoader loader = Thread.currentThread().getContextClassLoader();
+            Class editorClass = loader.loadClass(editor);
+            PropertyEditor pe = (PropertyEditor) editorClass.newInstance();
+            pe.setAsText(text);
+            value = pe.getValue();            
+         }
+         else if( type != null )
+         {
+            PropertyEditor pe = PropertyEditors.getEditor(type);
+            pe.setAsText(text);
+            value = pe.getValue();
+         }
+         else
+         {
+            value = text;
+         }
+      }
+      return value;
+   }
+   /**
+    * Set the raw value binding
+    * @param value
+    */ 
+   public void setValue(Object value)
+   {
+      this.value = value;
+   }
+
+   /**
+    * 
+    * @return flag indicating if the text should be trimmed
+    */ 
+   public boolean isTrim()
+   {
+      return trim;
+   }
+   /**
+    * 
+    * @param trim - flag indicating if the text should be trimmed
+    */ 
+   public void setTrim(boolean trim)
+   {
+      this.trim = trim;
+   }
+}

Added: jbossxb/trunk/src/test/java/org/jboss/test/xml/naming/JNDIBindings.java
===================================================================
--- jbossxb/trunk/src/test/java/org/jboss/test/xml/naming/JNDIBindings.java	                        (rev 0)
+++ jbossxb/trunk/src/test/java/org/jboss/test/xml/naming/JNDIBindings.java	2010-04-09 09:30:10 UTC (rev 4237)
@@ -0,0 +1,43 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2008, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.xml.naming;
+
+/**
+ * A collection of JNDI bindings
+ * 
+ * @author Scott.Stark at jboss.org
+ * @version $Revision: 81030 $
+ */
+public class JNDIBindings
+{
+   private JNDIBinding[] bindings;
+
+   public JNDIBinding[] getBindings()
+   {
+      return bindings;
+   }
+
+   public void setBindings(JNDIBinding[] bindings)
+   {
+      this.bindings = bindings;
+   }
+}

Modified: jbossxb/trunk/src/test/resources/xml/naming/jndi-binding-service_1_0.xsd
===================================================================
--- jbossxb/trunk/src/test/resources/xml/naming/jndi-binding-service_1_0.xsd	2010-04-09 01:08:05 UTC (rev 4236)
+++ jbossxb/trunk/src/test/resources/xml/naming/jndi-binding-service_1_0.xsd	2010-04-09 09:30:10 UTC (rev 4237)
@@ -1,87 +1,87 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xs:schema version="1.0beta" attributeFormDefault="unqualified"
-   elementFormDefault="qualified"
-   targetNamespace="urn:jboss:jndi-binding-service"
-   xmlns:jndi="urn:jboss:jndi-binding-service"
-   xmlns:xs="http://www.w3.org/2001/XMLSchema"
-   xmlns:jbxb="http://www.jboss.org/xml/ns/jbxb"
-   >
-   <xs:annotation>
-      <xs:documentation>This schema defines the content model for the
-         JNDIBindingService BindingsConfig attribute content.<![CDATA[
-	    <jndi:bindings xmlns:jndi="urn:jboss:jndi-binding-service"
-	      version="1.0">
-	      ...
-	    </jndi:bindings>
-         ]]></xs:documentation>
-      <xs:appinfo>
-         <jbxb:schemaBindings>
-            <jbxb:ignoreUnresolvedFieldOrClass>false</jbxb:ignoreUnresolvedFieldOrClass>
-            <jbxb:replacePropertyRefs>true</jbxb:replacePropertyRefs>
-         </jbxb:schemaBindings>
-      </xs:appinfo>
-   </xs:annotation>
-   <xs:element name="bindings">
-      <xs:annotation>
-         <xs:appinfo>
-            <jbxb:class impl="org.jboss.naming.JNDIBindings"/>
-         </xs:appinfo>
-      </xs:annotation>
-      <xs:complexType>
-         <xs:sequence>
-            <xs:element name="binding" minOccurs="1"
-               maxOccurs="unbounded">
-               <xs:annotation>
-                  <xs:appinfo>
-                     <jbxb:class impl="org.jboss.naming.JNDIBinding"/>
-                     <jbxb:property name="Bindings" />
-                  </xs:appinfo>
-               </xs:annotation>
-               <xs:complexType>
-                  <xs:choice minOccurs="1" maxOccurs="1">
-                     <xs:element name="value">
-                        <xs:annotation>
-                           <xs:appinfo>
-                              <jbxb:skip/>
-                           </xs:appinfo>
-                        </xs:annotation>
-                        <xs:complexType>
-                           <xs:annotation>
-                              <xs:appinfo>
-                                 <jbxb:characters>
-                                    <jbxb:property name="text"/>
-                                 </jbxb:characters>
-                              </xs:appinfo>
-                           </xs:annotation>
-                           <xs:simpleContent>
-                              <xs:extension base="xs:string">
-                                 <xs:attribute name="type" type="xs:string" use="optional">
-                                 </xs:attribute>
-                                 <xs:attribute name="editor" type="xs:string" use="optional">
-                                 </xs:attribute>
-                                 <xs:attribute name="trim" type="xs:boolean" default="true">
-                                 </xs:attribute>
-                              </xs:extension>
-                           </xs:simpleContent>
-                        </xs:complexType>
-                     </xs:element>
-                     <xs:any namespace="##other">
-                        <xs:annotation>
-                           <xs:documentation>An extension point for arbitrary xml value fragments</xs:documentation>
-                           <xs:appinfo>
-                              <jbxb:property name="value"/>
-                           </xs:appinfo>
-                        </xs:annotation>
-                     </xs:any>
-                  </xs:choice>
-                  <xs:attribute name="name" type="xs:string" use="required">
-                     <xs:annotation>
-                        <xs:documentation>The JNDI name of the binding</xs:documentation>
-                     </xs:annotation>
-                  </xs:attribute>
-               </xs:complexType>
-            </xs:element>
-         </xs:sequence>
-      </xs:complexType>
-   </xs:element>
-</xs:schema>
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema version="1.0beta" attributeFormDefault="unqualified"
+   elementFormDefault="qualified"
+   targetNamespace="urn:jboss:jndi-binding-service:1.0"
+   xmlns:jndi="urn:jboss:jndi-binding-service:1.0"
+   xmlns:xs="http://www.w3.org/2001/XMLSchema"
+   xmlns:jbxb="http://www.jboss.org/xml/ns/jbxb"
+   >
+   <xs:annotation>
+      <xs:documentation>This schema defines the content model for the
+         JNDIBindingService BindingsConfig attribute content.<![CDATA[
+	    <jndi:bindings xmlns:jndi="urn:jboss:jndi-binding-service"
+	      version="1.0">
+	      ...
+	    </jndi:bindings>
+         ]]></xs:documentation>
+      <xs:appinfo>
+         <jbxb:schemaBindings>
+            <jbxb:ignoreUnresolvedFieldOrClass>false</jbxb:ignoreUnresolvedFieldOrClass>
+            <jbxb:replacePropertyRefs>true</jbxb:replacePropertyRefs>
+         </jbxb:schemaBindings>
+      </xs:appinfo>
+   </xs:annotation>
+   <xs:element name="bindings">
+      <xs:annotation>
+         <xs:appinfo>
+            <jbxb:class impl="org.jboss.test.xml.naming.JNDIBindings"/>
+         </xs:appinfo>
+      </xs:annotation>
+      <xs:complexType>
+         <xs:sequence>
+            <xs:element name="binding" minOccurs="1"
+               maxOccurs="unbounded">
+               <xs:annotation>
+                  <xs:appinfo>
+                     <jbxb:class impl="org.jboss.test.xml.naming.JNDIBinding"/>
+                     <jbxb:property name="Bindings" />
+                  </xs:appinfo>
+               </xs:annotation>
+               <xs:complexType>
+                  <xs:choice minOccurs="1" maxOccurs="1">
+                     <xs:element name="value">
+                        <xs:annotation>
+                           <xs:appinfo>
+                              <jbxb:skip/>
+                           </xs:appinfo>
+                        </xs:annotation>
+                        <xs:complexType>
+                           <xs:annotation>
+                              <xs:appinfo>
+                                 <jbxb:characters>
+                                    <jbxb:property name="text"/>
+                                 </jbxb:characters>
+                              </xs:appinfo>
+                           </xs:annotation>
+                           <xs:simpleContent>
+                              <xs:extension base="xs:string">
+                                 <xs:attribute name="type" type="xs:string" use="optional">
+                                 </xs:attribute>
+                                 <xs:attribute name="editor" type="xs:string" use="optional">
+                                 </xs:attribute>
+                                 <xs:attribute name="trim" type="xs:boolean" default="true">
+                                 </xs:attribute>
+                              </xs:extension>
+                           </xs:simpleContent>
+                        </xs:complexType>
+                     </xs:element>
+                     <xs:any namespace="##other">
+                        <xs:annotation>
+                           <xs:documentation>An extension point for arbitrary xml value fragments</xs:documentation>
+                           <xs:appinfo>
+                              <jbxb:property name="value"/>
+                           </xs:appinfo>
+                        </xs:annotation>
+                     </xs:any>
+                  </xs:choice>
+                  <xs:attribute name="name" type="xs:string" use="required">
+                     <xs:annotation>
+                        <xs:documentation>The JNDI name of the binding</xs:documentation>
+                     </xs:annotation>
+                  </xs:attribute>
+               </xs:complexType>
+            </xs:element>
+         </xs:sequence>
+      </xs:complexType>
+   </xs:element>
+</xs:schema>

Modified: jbossxb/trunk/src/test/resources/xml/naming/testBindings.xml
===================================================================
--- jbossxb/trunk/src/test/resources/xml/naming/testBindings.xml	2010-04-09 01:08:05 UTC (rev 4236)
+++ jbossxb/trunk/src/test/resources/xml/naming/testBindings.xml	2010-04-09 09:30:10 UTC (rev 4237)
@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <jndi:bindings
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
-   xmlns:jndi="urn:jboss:jndi-binding-service"
-   xs:schemaLocation="urn:jboss:jndi-binding-service jndi-binding-service_1_0.xsd"
+   xmlns:jndi="urn:jboss:jndi-binding-service:1.0"
+   xs:schemaLocation="urn:jboss:jndi-binding-service:1.0 urn:jboss:jndi-binding-service:1.0"
    >
    <jndi:binding name="ctx1/key1">
       <jndi:value>value1</jndi:value>



More information about the jboss-svn-commits mailing list