Hello!

I think this is a simple error but I'm new to XSD and XmlBeans.

I have a XML generated by an Oracle SP:

<?xml version = '1.0' encoding = 'iso-8859-1'?>
<parametropacote>
   <parametros num="1">
      <row_id>1-HXCWOK</row_id>
      <nome_pacote>Franquia Unique 600</nome_pacote>
      <num_min_endereco>1</num_min_endereco>
      <num_max_endereco>1</num_max_endereco>
      <num_min_is_voz>1</num_min_is_voz>
      <num_max_is_voz>2</num_max_is_voz>
      <num_min_is_dados>1</num_min_is_dados>
      <num_max_is_dados>1</num_max_is_dados>
      <num_min_is_webline>1</num_min_is_webline>
      <num_max_is_webline>1</num_max_is_webline>
      <num_min_localidade>1</num_min_localidade>
      <num_max_localidade>1</num_max_localidade>
      <num_min_is_voip>0</num_min_is_voip>
      <num_max_is_voip>0</num_max_is_voip>
      <coexiste_is_dados_webline>Não</coexiste_is_dados_webline>
   </parametros>
   .....
</parametropacote>

I've compiled my XMLBeans with this XSD:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsd:schema
        xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
        xmlns:local="http://www.gvt.com/store";
        elementFormDefault="qualified"
        targetNamespace="http://www.gvt.com/store"; >
        <xsd:element name="parametropacote" type="local:parametropacote" />
        <xsd:complexType name="parametropacote" >
                <xsd:sequence>
                        <xsd:element name="parametros" type="local:parametros" 
minOccurs="1" maxOccurs="unbounded" />
                </xsd:sequence>
        </xsd:complexType>
        <xsd:complexType name="parametros" >
                <xsd:sequence>
                        <xsd:element name="row_id" type="xsd:string" 
minOccurs="0" maxOccurs="1" nillable="true" />
                        <xsd:element name="nome_pacote" type="xsd:string" 
minOccurs="0" maxOccurs="1" nillable="true" />
                        <xsd:element name="num_min_endereco" type="xsd:int" 
minOccurs="0" maxOccurs="1" nillable="true" />
                        <xsd:element name="num_max_endereco" type="xsd:int" 
minOccurs="0" maxOccurs="1" nillable="true" />
                        <xsd:element name="num_min_is_voz" type="xsd:int" 
minOccurs="0" maxOccurs="1" nillable="true" />
                        <xsd:element name="num_max_is_voz" type="xsd:int" 
minOccurs="0" maxOccurs="1" nillable="true" />
                        <xsd:element name="num_min_is_dados" type="xsd:int" 
minOccurs="0" maxOccurs="1" nillable="true" />
                        <xsd:element name="num_max_is_dados" type="xsd:int" 
minOccurs="0" maxOccurs="1" nillable="true" />
                        <xsd:element name="num_min_is_webline" type="xsd:int" 
minOccurs="0" maxOccurs="1" nillable="true" />
                        <xsd:element name="num_max_is_webline" type="xsd:int" 
minOccurs="0" maxOccurs="1" nillable="true" />
                        <xsd:element name="num_min_is_voip" type="xsd:int" 
minOccurs="0" maxOccurs="1" nillable="true" />
                        <xsd:element name="num_max_is_voip" type="xsd:int" 
minOccurs="0" maxOccurs="1" nillable="true" />
                        <xsd:element name="coexiste_is_dados_webline" 
type="xsd:string" minOccurs="0" maxOccurs="1" nillable="true" />
                </xsd:sequence>
                <xsd:attribute name="num" type="xsd:int" use="required" />
        </xsd:complexType>
</xsd:schema>

On  ParametropacoteDocument.Factory.parse(xml); I got the error:
07/04/23 16:40:57 org.apache.xmlbeans.XmlException: error: The document is not 
a [EMAIL PROTECTED]://www.gvt.com/store: document element namespace mismatch 
expected "http://www.gvt.com/store"; got ""

Thanks for any help!

--
Fernando Bernardino

Reply via email to