You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jaxme-dev@ws.apache.org by "John E. Conlon" <jc...@verticon.com> on 2004/07/21 22:31:53 UTC

[JaxMe] Replacing Sun RI with 0.3 release candidate

Hi JaxMe Dev,

After switching from the Sun RI to the JaxMe 0.3 candidate I notices 2
immediate differences.  The first occurred at build using the ant task
and the second when I try to unmarshal a valid instance document that is
schema aware. 

1. During the Ant Build.  This one was easily worked around by using a
package attribute in the ant task. But thought you would like to see and
perhaps document this difference with the Sun Ri in the new documentation for 0.3.

The Sun RI will accept and build with this task:
<xjc schema="${src.test}/xml/Config.xsd" 
     target="${build.java_gen_src}"/>

But JaxME fails with...

BUILD FAILED
/home/projects/java/jaxb/build.xml:101:
org.apache.ws.jaxme.xs.parser.impl.LocSAXException: At
file:/home/projects/java/jaxb/src/test/xml/Config.xsd, line 43, column
44: Unable to derive package name from an empty namespace URI. Use the
schemaBindings to specify a package name.

Here is my XSD:

<?xml version = "1.0" encoding = "UTF-8"?>
<schema xmlns = "http://www.w3.org/2001/XMLSchema"
	 targetNamespace = "http://www.verticon.com/jaxb/schema"
	 xmlns:s = "http://www.verticon.com/jaxb/schema"
	 elementFormDefault = "qualified"
	 attributeFormDefault = "unqualified">

        <element name = "TestConfiguration"
                 type = "s:TestConfigurationType"/>

        <complexType name = "TestConfigurationType">
                <choice>
                        <element name = "ChildOne" type =
"s:ChildOneType"/>
                        <element name = "ChildTwo" type =
"s:ChildTwoType"/>
                </choice>
        </complexType>

        <complexType name = "ChildTwoType">
			<choice>
				<element name = "Resource"  type = "s:ResourceType"/>
				<element name = "Commands"  type = "string"/>
			</choice>
               <attribute name = "name" use = "required" type =
"string"/>
               <attribute name = "type" use = "required" type =
"s:ChildTwoTypeType"/>
        </complexType>

         <complexType name = "ChildOneType">
		<attribute name = "location" use = "required" type = "anyURI"/>
                <attribute name = "name" use = "required" type =
"string"/>
	</complexType>

        <complexType name = "ResourceType">
		<attribute name = "location" use = "required" type = "anyURI"/>
	</complexType>


       <simpleType name='ChildTwoTypeType'>
          <annotation>
              <documentation>supported child two types</documentation>
          </annotation>
          <restriction base='string'>
            <enumeration value='groovy'>
              <annotation>
                  <documentation>Groovy scripting
language.</documentation>
              </annotation>
            </enumeration>
            <enumeration value='jython'>
              <annotation>
                  <documentation>Jython scripting
language.</documentation>
              </annotation>
            </enumeration>
          </restriction>
      </simpleType>

</schema>




2. UnMarshal
I have also encountered a problem when I unmarshall a valid instance
document that is schema aware.

Here is the exception:
 org.xml.sax.SAXParseException: Unknown attribute: 'schemaLocation' in
namespace 'http://www.w3.org/2001/XMLSchema-instance'

Here is my test instance:
<?xml version = "1.0" encoding = "UTF-8"?>
<TestConfiguration
          xmlns = "http://www.verticon.com/jaxb/schema"
          xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation = "http://www.verticon.com/jaxb/schema
          Config.xsd">
          <ChildTwo name="defaultExample" type="jython">
            <Commands>
              Hello World
             </Commands>
          </ChildTwo>
</TestConfiguration>


Again this works with the Sun RI.  Note: I can unmarshal an instance if
it does not reference a schema.  

Any ideas how to set this up so I can keep my instance documents schema
aware?

thanks,
John Conlon


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org


Re: [JaxMe] Replacing Sun RI with 0.3 release candidate

Posted by Jochen Wiedmann <jo...@freenet.de>.
Hi, John,

both problems should be considered bugs that we have to fix. Admittedly, 
that doesn't help you currently, but I see that we can fix it. Anyways, 
could you please be so kind and file bug reports in Jira? That helps 
keeping you uptodate.


Jochen


---------------------------------------------------------------------
To unsubscribe, e-mail: jaxme-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: jaxme-dev-help@ws.apache.org