You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by riya <ra...@gmail.com> on 2009/02/18 02:19:21 UTC

Issues

Hi, 

I generated xsd using inst2xsd provided with xmlbeans. 

command:
inst2xsd rd Address_Valid_Request.xml

Following is the xsd I got: 
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="ADDR_VALID_REQUEST" type="ADDR_VALID_REQUESTType"/>
  <xs:complexType name="HEADERType">
    <xs:sequence>
      <xs:element type="xs:string" name="APPLICATION_ID"/>
      <xs:element type="xs:string" name="IBPASSWORD"/>
      <xs:element type="xs:string" name="LANGUAGE_CD"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="ADDR_VALID_REQUESTType">
    <xs:sequence>
      <xs:element type="HEADERType" name="HEADER"/>
      <xs:element type="xs:int" name="DSID"/>
      <xs:element type="xs:string" name="COUNTRY"/>
      <xs:element type="xs:string" name="ADDRESS1"/>
      <xs:element type="xs:string" name="ADDRESS2"/>
      <xs:element type="xs:string" name="ADDRESS3"/>
      <xs:element type="xs:string" name="ADDRESS4"/>
      <xs:element type="xs:string" name="CITY"/>
      <xs:element type="xs:string" name="STATE"/>
      <xs:element type="xs:string" name="COUNTY"/>
      <xs:element type="xs:int" name="POSTAL"/>
    </xs:sequence>
  </xs:complexType>
</xs:schema>

Now when  I try to generate a xml based on jar generated from above xsd, I
get following:

<xml-fragment>
  <HEADER>
    <APPLICATION_ID>USER</APPLICATION_ID>
    <IBPASSWORD>xyz</IBPASSWORD>
    <LANGUAGE_CD>ENG</LANGUAGE_CD>
  </HEADER>
  <DSID>45454545</DSID>
  <COUNTRY>USA</COUNTRY>
  <ADDRESS1>s</ADDRESS1>
  <ADDRESS2>s</ADDRESS2>
  <ADDRESS3/>
  <ADDRESS4/>
  <CITY>s</CITY>
  <STATE>CA</STATE>
  <COUNTY/>
  <POSTAL>95014</POSTAL>
</xml-fragment> 

The xml as you can see is mostly fine, except for the top node which is
</xml-fragment>. 

Can some one please tell me how to correct this? 

Thanks in advance!
riya
-- 
View this message in context: http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22070264.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


[ANN]VTD-XML 2.5

Posted by jz...@ximpleware.com.
VTD-XML 2.5 is now released. Please go to 
https://sourceforge.net/project/showfiles.php?group_id=110612&package_id=120 
172&release_id=661376 to download the latest version. 

Changes from Version 2.4 (2/2009) 

* Added separate VTD indexing generating and loading (see 
http://vtd-xml.sf.net/persistence.html for further info)
* Integrated extended VTD supporting 256 GB doc (In Java only).
* Added duplicateNav() for replicate multiple VTDNav instances sharing XML, 
VTD and LC buffer (availabe in Java and C#).
* Various bug fixes and enhancements. 


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: Issues

Posted by riya <ra...@gmail.com>.
Thank you so much :-)
It works now. 


Gordon Rogers-2 wrote:
> 
> What you need to do is output the ADDRVALIDREQUESTDocument object rather
> than the ADDRVALIDREQUESTType object. It's the ADDRVALIDREQUESTDocument
> that will give you access to the top level <ADDR_VALID_REQUEST> element.
> What you are printing out is the contents of the complex type
> ADDR_VALID_REQUESTType which has no knowledge of the context in which it
> may appear - the type could be used as the basis of numerous other
> elements or types and so has no notion of the <ADDR_VALID_REQUEST>
> element, therefore XML Beans can only display the xml fragment as
> represented by the type.
> 
> The short answer is that instead of 
> 	log.info("XML Request" + newObj.toString()); 
> you need to
> 	log.info("XML Request" + addDoc.toString()); 
> or
> 	log.info("XML Request" + addDoc.xmlText()); which is much better
> as you can start to play around with XmlOptions
> 	
> 
> 
> -----Original Message-----
> From: riya [mailto:rachana8p@gmail.com] 
> Sent: 19 February 2009 23:30
> To: user@xmlbeans.apache.org
> Subject: RE: <xml-fragment> Issues
> 
> 
> Hi, 
> Thanks for replying. Will it be possible for you to explain in terms of
> coding. I am still a new comer in xml beans, I tried to find out for
> some
> time but I couldn't figure out what exactly I need to do. 
> 
> Thanks, 
> Rachana 
> 
> Horninger, Joe (Contr) (Mission Systems) wrote:
>> 
>> Easy.  The Document Object needs the Type object added to it.  From
> there,
>> you can post the Document instead of the type.  I ran into this
> problem on
>> more than one occasion in the beginnning with xmlbeans.
>>  
>> Document == Top Level object.
>>  
>> Type == Document Payload (fragment).
>>  
>> It's a little strange, but the document is structured that way for
> some
>> reason.
>>  
>> Cheers!
>>  
>> --Joey
>> 
>> ________________________________
>> 
>> From: riya [mailto:rachana8p@gmail.com]
>> Sent: Thu 2/19/2009 11:37 AM
>> To: user@xmlbeans.apache.org
>> Subject: Re: <xml-fragment> Issues
>> 
>> 
>> 
>> 
>> Hi,
>> Thanks for replying.
>> Here is my code based on Jar I generated from the xsd I mentioned:
>> ADDRVALIDREQUESTDocument addDoc =
>> ADDRVALIDREQUESTDocument.Factory.newInstance();
>> 
>>                 ADDRVALIDREQUESTType newObj =
>> addDoc.addNewADDRVALIDREQUEST();
>> 
>>                  HEADERType  newHeader=   newObj.addNewHEADER();
>>                 newHeader.setAPPLICATIONID(appID);
>>                 newHeader.setIBPASSWORD(pwd);
>>                
>> newHeader.setLANGUAGECD((String)addressMap.get("strLang"));
>>                
>>                 newObj.setDSID((String)addressMap.get("strID"));
>>
> newObj.setCOUNTRY((String)addressMap.get("strCountry"));
>>
> newObj.setADDRESS1((String)addressMap.get("address1"));
>>
> newObj.setADDRESS2((String)addressMap.get("address2"));
>>
> newObj.setADDRESS3((String)addressMap.get("address3"));
>>
> newObj.setADDRESS4((String)addressMap.get("address4"));
>>                 newObj.setCITY((String)addressMap.get("city"));
>>                 newObj.setSTATE((String)addressMap.get("stateCode"));
>>                 newObj.setCOUNTY((String)addressMap.get("strCounty"));
>>
> newObj.setPOSTAL((String)addressMap.get("postalCode"));
>> 
>>     Now log.info("XML Request" + newObj.toString());   prints xml with
>> <xml-fragment> as top node.
>> 
>> 
>> Jacob Danner-2 wrote:
>>>
>>> Can you post a snippet of code?
>>> -jacobd
>>>
>>> On Tue, Feb 17, 2009 at 5:19 PM, riya <ra...@gmail.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I generated xsd using inst2xsd provided with xmlbeans.
>>>>
>>>> command:
>>>> inst2xsd rd Address_Valid_Request.xml
>>>>
>>>> Following is the xsd I got:
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <xs:schema attributeFormDefault="unqualified"
>>>> elementFormDefault="qualified"
>>>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>>>  <xs:element name="ADDR_VALID_REQUEST"
> type="ADDR_VALID_REQUESTType"/>
>>>>  <xs:complexType name="HEADERType">
>>>>    <xs:sequence>
>>>>      <xs:element type="xs:string" name="APPLICATION_ID"/>
>>>>      <xs:element type="xs:string" name="IBPASSWORD"/>
>>>>      <xs:element type="xs:string" name="LANGUAGE_CD"/>
>>>>    </xs:sequence>
>>>>  </xs:complexType>
>>>>  <xs:complexType name="ADDR_VALID_REQUESTType">
>>>>    <xs:sequence>
>>>>      <xs:element type="HEADERType" name="HEADER"/>
>>>>      <xs:element type="xs:int" name="DSID"/>
>>>>      <xs:element type="xs:string" name="COUNTRY"/>
>>>>      <xs:element type="xs:string" name="ADDRESS1"/>
>>>>      <xs:element type="xs:string" name="ADDRESS2"/>
>>>>      <xs:element type="xs:string" name="ADDRESS3"/>
>>>>      <xs:element type="xs:string" name="ADDRESS4"/>
>>>>      <xs:element type="xs:string" name="CITY"/>
>>>>      <xs:element type="xs:string" name="STATE"/>
>>>>      <xs:element type="xs:string" name="COUNTY"/>
>>>>      <xs:element type="xs:int" name="POSTAL"/>
>>>>    </xs:sequence>
>>>>  </xs:complexType>
>>>> </xs:schema>
>>>>
>>>> Now when  I try to generate a xml based on jar generated from above
> xsd,
>>>> I
>>>> get following:
>>>>
>>>> <xml-fragment>
>>>>  <HEADER>
>>>>    <APPLICATION_ID>USER</APPLICATION_ID>
>>>>    <IBPASSWORD>xyz</IBPASSWORD>
>>>>    <LANGUAGE_CD>ENG</LANGUAGE_CD>
>>>>  </HEADER>
>>>>  <DSID>45454545</DSID>
>>>>  <COUNTRY>USA</COUNTRY>
>>>>  <ADDRESS1>s</ADDRESS1>
>>>>  <ADDRESS2>s</ADDRESS2>
>>>>  <ADDRESS3/>
>>>>  <ADDRESS4/>
>>>>  <CITY>s</CITY>
>>>>  <STATE>CA</STATE>
>>>>  <COUNTY/>
>>>>  <POSTAL>95014</POSTAL>
>>>> </xml-fragment>
>>>>
>>>> The xml as you can see is mostly fine, except for the top node which
> is
>>>> </xml-fragment>.
>>>>
>>>> Can some one please tell me how to correct this?
>>>>
>>>> Thanks in advance!
>>>> riya
>>>> --
>>>> View this message in context:
>>>>
> http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22070264.html
>>>> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>>>>
>>>>
>>>>
> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>>>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>>
>>>
>>>
>> 
>> --
>> View this message in context:
>>
> http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22106941.html
>> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>> 
>> 
>> 
>> 
>> 
>>  
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>> 
> 
> -- 
> View this message in context:
> http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22111932.html
> Sent from the Xml Beans - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22125834.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: Issues

Posted by Gordon Rogers <go...@corelogic.co.uk>.
What you need to do is output the ADDRVALIDREQUESTDocument object rather
than the ADDRVALIDREQUESTType object. It's the ADDRVALIDREQUESTDocument
that will give you access to the top level <ADDR_VALID_REQUEST> element.
What you are printing out is the contents of the complex type
ADDR_VALID_REQUESTType which has no knowledge of the context in which it
may appear - the type could be used as the basis of numerous other
elements or types and so has no notion of the <ADDR_VALID_REQUEST>
element, therefore XML Beans can only display the xml fragment as
represented by the type.

The short answer is that instead of 
	log.info("XML Request" + newObj.toString()); 
you need to
	log.info("XML Request" + addDoc.toString()); 
or
	log.info("XML Request" + addDoc.xmlText()); which is much better
as you can start to play around with XmlOptions
	


-----Original Message-----
From: riya [mailto:rachana8p@gmail.com] 
Sent: 19 February 2009 23:30
To: user@xmlbeans.apache.org
Subject: RE: <xml-fragment> Issues


Hi, 
Thanks for replying. Will it be possible for you to explain in terms of
coding. I am still a new comer in xml beans, I tried to find out for
some
time but I couldn't figure out what exactly I need to do. 

Thanks, 
Rachana 

Horninger, Joe (Contr) (Mission Systems) wrote:
> 
> Easy.  The Document Object needs the Type object added to it.  From
there,
> you can post the Document instead of the type.  I ran into this
problem on
> more than one occasion in the beginnning with xmlbeans.
>  
> Document == Top Level object.
>  
> Type == Document Payload (fragment).
>  
> It's a little strange, but the document is structured that way for
some
> reason.
>  
> Cheers!
>  
> --Joey
> 
> ________________________________
> 
> From: riya [mailto:rachana8p@gmail.com]
> Sent: Thu 2/19/2009 11:37 AM
> To: user@xmlbeans.apache.org
> Subject: Re: <xml-fragment> Issues
> 
> 
> 
> 
> Hi,
> Thanks for replying.
> Here is my code based on Jar I generated from the xsd I mentioned:
> ADDRVALIDREQUESTDocument addDoc =
> ADDRVALIDREQUESTDocument.Factory.newInstance();
> 
>                 ADDRVALIDREQUESTType newObj =
> addDoc.addNewADDRVALIDREQUEST();
> 
>                  HEADERType  newHeader=   newObj.addNewHEADER();
>                 newHeader.setAPPLICATIONID(appID);
>                 newHeader.setIBPASSWORD(pwd);
>                
> newHeader.setLANGUAGECD((String)addressMap.get("strLang"));
>                
>                 newObj.setDSID((String)addressMap.get("strID"));
>
newObj.setCOUNTRY((String)addressMap.get("strCountry"));
>
newObj.setADDRESS1((String)addressMap.get("address1"));
>
newObj.setADDRESS2((String)addressMap.get("address2"));
>
newObj.setADDRESS3((String)addressMap.get("address3"));
>
newObj.setADDRESS4((String)addressMap.get("address4"));
>                 newObj.setCITY((String)addressMap.get("city"));
>                 newObj.setSTATE((String)addressMap.get("stateCode"));
>                 newObj.setCOUNTY((String)addressMap.get("strCounty"));
>
newObj.setPOSTAL((String)addressMap.get("postalCode"));
> 
>     Now log.info("XML Request" + newObj.toString());   prints xml with
> <xml-fragment> as top node.
> 
> 
> Jacob Danner-2 wrote:
>>
>> Can you post a snippet of code?
>> -jacobd
>>
>> On Tue, Feb 17, 2009 at 5:19 PM, riya <ra...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> I generated xsd using inst2xsd provided with xmlbeans.
>>>
>>> command:
>>> inst2xsd rd Address_Valid_Request.xml
>>>
>>> Following is the xsd I got:
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <xs:schema attributeFormDefault="unqualified"
>>> elementFormDefault="qualified"
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>>  <xs:element name="ADDR_VALID_REQUEST"
type="ADDR_VALID_REQUESTType"/>
>>>  <xs:complexType name="HEADERType">
>>>    <xs:sequence>
>>>      <xs:element type="xs:string" name="APPLICATION_ID"/>
>>>      <xs:element type="xs:string" name="IBPASSWORD"/>
>>>      <xs:element type="xs:string" name="LANGUAGE_CD"/>
>>>    </xs:sequence>
>>>  </xs:complexType>
>>>  <xs:complexType name="ADDR_VALID_REQUESTType">
>>>    <xs:sequence>
>>>      <xs:element type="HEADERType" name="HEADER"/>
>>>      <xs:element type="xs:int" name="DSID"/>
>>>      <xs:element type="xs:string" name="COUNTRY"/>
>>>      <xs:element type="xs:string" name="ADDRESS1"/>
>>>      <xs:element type="xs:string" name="ADDRESS2"/>
>>>      <xs:element type="xs:string" name="ADDRESS3"/>
>>>      <xs:element type="xs:string" name="ADDRESS4"/>
>>>      <xs:element type="xs:string" name="CITY"/>
>>>      <xs:element type="xs:string" name="STATE"/>
>>>      <xs:element type="xs:string" name="COUNTY"/>
>>>      <xs:element type="xs:int" name="POSTAL"/>
>>>    </xs:sequence>
>>>  </xs:complexType>
>>> </xs:schema>
>>>
>>> Now when  I try to generate a xml based on jar generated from above
xsd,
>>> I
>>> get following:
>>>
>>> <xml-fragment>
>>>  <HEADER>
>>>    <APPLICATION_ID>USER</APPLICATION_ID>
>>>    <IBPASSWORD>xyz</IBPASSWORD>
>>>    <LANGUAGE_CD>ENG</LANGUAGE_CD>
>>>  </HEADER>
>>>  <DSID>45454545</DSID>
>>>  <COUNTRY>USA</COUNTRY>
>>>  <ADDRESS1>s</ADDRESS1>
>>>  <ADDRESS2>s</ADDRESS2>
>>>  <ADDRESS3/>
>>>  <ADDRESS4/>
>>>  <CITY>s</CITY>
>>>  <STATE>CA</STATE>
>>>  <COUNTY/>
>>>  <POSTAL>95014</POSTAL>
>>> </xml-fragment>
>>>
>>> The xml as you can see is mostly fine, except for the top node which
is
>>> </xml-fragment>.
>>>
>>> Can some one please tell me how to correct this?
>>>
>>> Thanks in advance!
>>> riya
>>> --
>>> View this message in context:
>>>
http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22070264.html
>>> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>>>
>>>
>>>
---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>
>>
>>
> 
> --
> View this message in context:
>
http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22106941.html
> Sent from the Xml Beans - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> 
> 
> 
>  
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 

-- 
View this message in context:
http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22111932.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: Issues

Posted by riya <ra...@gmail.com>.
Hi, 
Thanks for replying. Will it be possible for you to explain in terms of
coding. I am still a new comer in xml beans, I tried to find out for some
time but I couldn't figure out what exactly I need to do. 

Thanks, 
Rachana 

Horninger, Joe (Contr) (Mission Systems) wrote:
> 
> Easy.  The Document Object needs the Type object added to it.  From there,
> you can post the Document instead of the type.  I ran into this problem on
> more than one occasion in the beginnning with xmlbeans.
>  
> Document == Top Level object.
>  
> Type == Document Payload (fragment).
>  
> It's a little strange, but the document is structured that way for some
> reason.
>  
> Cheers!
>  
> --Joey
> 
> ________________________________
> 
> From: riya [mailto:rachana8p@gmail.com]
> Sent: Thu 2/19/2009 11:37 AM
> To: user@xmlbeans.apache.org
> Subject: Re: <xml-fragment> Issues
> 
> 
> 
> 
> Hi,
> Thanks for replying.
> Here is my code based on Jar I generated from the xsd I mentioned:
> ADDRVALIDREQUESTDocument addDoc =
> ADDRVALIDREQUESTDocument.Factory.newInstance();
> 
>                 ADDRVALIDREQUESTType newObj =
> addDoc.addNewADDRVALIDREQUEST();
> 
>                  HEADERType  newHeader=   newObj.addNewHEADER();
>                 newHeader.setAPPLICATIONID(appID);
>                 newHeader.setIBPASSWORD(pwd);
>                
> newHeader.setLANGUAGECD((String)addressMap.get("strLang"));
>                
>                 newObj.setDSID((String)addressMap.get("strID"));
>                 newObj.setCOUNTRY((String)addressMap.get("strCountry"));
>                 newObj.setADDRESS1((String)addressMap.get("address1"));
>                 newObj.setADDRESS2((String)addressMap.get("address2"));
>                 newObj.setADDRESS3((String)addressMap.get("address3"));
>                 newObj.setADDRESS4((String)addressMap.get("address4"));
>                 newObj.setCITY((String)addressMap.get("city"));
>                 newObj.setSTATE((String)addressMap.get("stateCode"));
>                 newObj.setCOUNTY((String)addressMap.get("strCounty"));
>                 newObj.setPOSTAL((String)addressMap.get("postalCode"));
> 
>     Now log.info("XML Request" + newObj.toString());   prints xml with
> <xml-fragment> as top node.
> 
> 
> Jacob Danner-2 wrote:
>>
>> Can you post a snippet of code?
>> -jacobd
>>
>> On Tue, Feb 17, 2009 at 5:19 PM, riya <ra...@gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> I generated xsd using inst2xsd provided with xmlbeans.
>>>
>>> command:
>>> inst2xsd rd Address_Valid_Request.xml
>>>
>>> Following is the xsd I got:
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <xs:schema attributeFormDefault="unqualified"
>>> elementFormDefault="qualified"
>>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>>  <xs:element name="ADDR_VALID_REQUEST" type="ADDR_VALID_REQUESTType"/>
>>>  <xs:complexType name="HEADERType">
>>>    <xs:sequence>
>>>      <xs:element type="xs:string" name="APPLICATION_ID"/>
>>>      <xs:element type="xs:string" name="IBPASSWORD"/>
>>>      <xs:element type="xs:string" name="LANGUAGE_CD"/>
>>>    </xs:sequence>
>>>  </xs:complexType>
>>>  <xs:complexType name="ADDR_VALID_REQUESTType">
>>>    <xs:sequence>
>>>      <xs:element type="HEADERType" name="HEADER"/>
>>>      <xs:element type="xs:int" name="DSID"/>
>>>      <xs:element type="xs:string" name="COUNTRY"/>
>>>      <xs:element type="xs:string" name="ADDRESS1"/>
>>>      <xs:element type="xs:string" name="ADDRESS2"/>
>>>      <xs:element type="xs:string" name="ADDRESS3"/>
>>>      <xs:element type="xs:string" name="ADDRESS4"/>
>>>      <xs:element type="xs:string" name="CITY"/>
>>>      <xs:element type="xs:string" name="STATE"/>
>>>      <xs:element type="xs:string" name="COUNTY"/>
>>>      <xs:element type="xs:int" name="POSTAL"/>
>>>    </xs:sequence>
>>>  </xs:complexType>
>>> </xs:schema>
>>>
>>> Now when  I try to generate a xml based on jar generated from above xsd,
>>> I
>>> get following:
>>>
>>> <xml-fragment>
>>>  <HEADER>
>>>    <APPLICATION_ID>USER</APPLICATION_ID>
>>>    <IBPASSWORD>xyz</IBPASSWORD>
>>>    <LANGUAGE_CD>ENG</LANGUAGE_CD>
>>>  </HEADER>
>>>  <DSID>45454545</DSID>
>>>  <COUNTRY>USA</COUNTRY>
>>>  <ADDRESS1>s</ADDRESS1>
>>>  <ADDRESS2>s</ADDRESS2>
>>>  <ADDRESS3/>
>>>  <ADDRESS4/>
>>>  <CITY>s</CITY>
>>>  <STATE>CA</STATE>
>>>  <COUNTY/>
>>>  <POSTAL>95014</POSTAL>
>>> </xml-fragment>
>>>
>>> The xml as you can see is mostly fine, except for the top node which is
>>> </xml-fragment>.
>>>
>>> Can some one please tell me how to correct this?
>>>
>>> Thanks in advance!
>>> riya
>>> --
>>> View this message in context:
>>> http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22070264.html
>>> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>
>>
>>
> 
> --
> View this message in context:
> http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22106941.html
> Sent from the Xml Beans - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> 
> 
> 
>  
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 

-- 
View this message in context: http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22111932.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


RE: Issues

Posted by "Horninger, Joe (Contr Mission Systems)" <Jo...@ngc.com>.
Easy.  The Document Object needs the Type object added to it.  From there, you can post the Document instead of the type.  I ran into this problem on more than one occasion in the beginnning with xmlbeans.
 
Document == Top Level object.
 
Type == Document Payload (fragment).
 
It's a little strange, but the document is structured that way for some reason.
 
Cheers!
 
--Joey

________________________________

From: riya [mailto:rachana8p@gmail.com]
Sent: Thu 2/19/2009 11:37 AM
To: user@xmlbeans.apache.org
Subject: Re: <xml-fragment> Issues




Hi,
Thanks for replying.
Here is my code based on Jar I generated from the xsd I mentioned:
ADDRVALIDREQUESTDocument addDoc =
ADDRVALIDREQUESTDocument.Factory.newInstance();

                ADDRVALIDREQUESTType newObj = addDoc.addNewADDRVALIDREQUEST();

                 HEADERType  newHeader=   newObj.addNewHEADER();
                newHeader.setAPPLICATIONID(appID);
                newHeader.setIBPASSWORD(pwd);
                newHeader.setLANGUAGECD((String)addressMap.get("strLang"));
               
                newObj.setDSID((String)addressMap.get("strID"));
                newObj.setCOUNTRY((String)addressMap.get("strCountry"));
                newObj.setADDRESS1((String)addressMap.get("address1"));
                newObj.setADDRESS2((String)addressMap.get("address2"));
                newObj.setADDRESS3((String)addressMap.get("address3"));
                newObj.setADDRESS4((String)addressMap.get("address4"));
                newObj.setCITY((String)addressMap.get("city"));
                newObj.setSTATE((String)addressMap.get("stateCode"));
                newObj.setCOUNTY((String)addressMap.get("strCounty"));
                newObj.setPOSTAL((String)addressMap.get("postalCode"));

    Now log.info("XML Request" + newObj.toString());   prints xml with
<xml-fragment> as top node.


Jacob Danner-2 wrote:
>
> Can you post a snippet of code?
> -jacobd
>
> On Tue, Feb 17, 2009 at 5:19 PM, riya <ra...@gmail.com> wrote:
>>
>> Hi,
>>
>> I generated xsd using inst2xsd provided with xmlbeans.
>>
>> command:
>> inst2xsd rd Address_Valid_Request.xml
>>
>> Following is the xsd I got:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <xs:schema attributeFormDefault="unqualified"
>> elementFormDefault="qualified"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>  <xs:element name="ADDR_VALID_REQUEST" type="ADDR_VALID_REQUESTType"/>
>>  <xs:complexType name="HEADERType">
>>    <xs:sequence>
>>      <xs:element type="xs:string" name="APPLICATION_ID"/>
>>      <xs:element type="xs:string" name="IBPASSWORD"/>
>>      <xs:element type="xs:string" name="LANGUAGE_CD"/>
>>    </xs:sequence>
>>  </xs:complexType>
>>  <xs:complexType name="ADDR_VALID_REQUESTType">
>>    <xs:sequence>
>>      <xs:element type="HEADERType" name="HEADER"/>
>>      <xs:element type="xs:int" name="DSID"/>
>>      <xs:element type="xs:string" name="COUNTRY"/>
>>      <xs:element type="xs:string" name="ADDRESS1"/>
>>      <xs:element type="xs:string" name="ADDRESS2"/>
>>      <xs:element type="xs:string" name="ADDRESS3"/>
>>      <xs:element type="xs:string" name="ADDRESS4"/>
>>      <xs:element type="xs:string" name="CITY"/>
>>      <xs:element type="xs:string" name="STATE"/>
>>      <xs:element type="xs:string" name="COUNTY"/>
>>      <xs:element type="xs:int" name="POSTAL"/>
>>    </xs:sequence>
>>  </xs:complexType>
>> </xs:schema>
>>
>> Now when  I try to generate a xml based on jar generated from above xsd,
>> I
>> get following:
>>
>> <xml-fragment>
>>  <HEADER>
>>    <APPLICATION_ID>USER</APPLICATION_ID>
>>    <IBPASSWORD>xyz</IBPASSWORD>
>>    <LANGUAGE_CD>ENG</LANGUAGE_CD>
>>  </HEADER>
>>  <DSID>45454545</DSID>
>>  <COUNTRY>USA</COUNTRY>
>>  <ADDRESS1>s</ADDRESS1>
>>  <ADDRESS2>s</ADDRESS2>
>>  <ADDRESS3/>
>>  <ADDRESS4/>
>>  <CITY>s</CITY>
>>  <STATE>CA</STATE>
>>  <COUNTY/>
>>  <POSTAL>95014</POSTAL>
>> </xml-fragment>
>>
>> The xml as you can see is mostly fine, except for the top node which is
>> </xml-fragment>.
>>
>> Can some one please tell me how to correct this?
>>
>> Thanks in advance!
>> riya
>> --
>> View this message in context:
>> http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22070264.html
>> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>
>

--
View this message in context: http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22106941.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org





Re: Issues

Posted by riya <ra...@gmail.com>.
Hi, 
Thanks for replying. 
Here is my code based on Jar I generated from the xsd I mentioned:
ADDRVALIDREQUESTDocument addDoc =
ADDRVALIDREQUESTDocument.Factory.newInstance();
 
		ADDRVALIDREQUESTType newObj = addDoc.addNewADDRVALIDREQUEST();

	  	 HEADERType  newHeader=   newObj.addNewHEADER();

		newHeader.setAPPLICATIONID(appID);
		newHeader.setIBPASSWORD(pwd);
		newHeader.setLANGUAGECD((String)addressMap.get("strLang"));
	  	
		newObj.setDSID((String)addressMap.get("strID"));
		newObj.setCOUNTRY((String)addressMap.get("strCountry"));
		newObj.setADDRESS1((String)addressMap.get("address1"));
		newObj.setADDRESS2((String)addressMap.get("address2"));
		newObj.setADDRESS3((String)addressMap.get("address3"));
		newObj.setADDRESS4((String)addressMap.get("address4"));
		newObj.setCITY((String)addressMap.get("city"));
		newObj.setSTATE((String)addressMap.get("stateCode"));
		newObj.setCOUNTY((String)addressMap.get("strCounty"));
		newObj.setPOSTAL((String)addressMap.get("postalCode"));

    Now log.info("XML Request" + newObj.toString());   prints xml with
<xml-fragment> as top node. 


Jacob Danner-2 wrote:
> 
> Can you post a snippet of code?
> -jacobd
> 
> On Tue, Feb 17, 2009 at 5:19 PM, riya <ra...@gmail.com> wrote:
>>
>> Hi,
>>
>> I generated xsd using inst2xsd provided with xmlbeans.
>>
>> command:
>> inst2xsd rd Address_Valid_Request.xml
>>
>> Following is the xsd I got:
>> <?xml version="1.0" encoding="UTF-8"?>
>> <xs:schema attributeFormDefault="unqualified"
>> elementFormDefault="qualified"
>> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>>  <xs:element name="ADDR_VALID_REQUEST" type="ADDR_VALID_REQUESTType"/>
>>  <xs:complexType name="HEADERType">
>>    <xs:sequence>
>>      <xs:element type="xs:string" name="APPLICATION_ID"/>
>>      <xs:element type="xs:string" name="IBPASSWORD"/>
>>      <xs:element type="xs:string" name="LANGUAGE_CD"/>
>>    </xs:sequence>
>>  </xs:complexType>
>>  <xs:complexType name="ADDR_VALID_REQUESTType">
>>    <xs:sequence>
>>      <xs:element type="HEADERType" name="HEADER"/>
>>      <xs:element type="xs:int" name="DSID"/>
>>      <xs:element type="xs:string" name="COUNTRY"/>
>>      <xs:element type="xs:string" name="ADDRESS1"/>
>>      <xs:element type="xs:string" name="ADDRESS2"/>
>>      <xs:element type="xs:string" name="ADDRESS3"/>
>>      <xs:element type="xs:string" name="ADDRESS4"/>
>>      <xs:element type="xs:string" name="CITY"/>
>>      <xs:element type="xs:string" name="STATE"/>
>>      <xs:element type="xs:string" name="COUNTY"/>
>>      <xs:element type="xs:int" name="POSTAL"/>
>>    </xs:sequence>
>>  </xs:complexType>
>> </xs:schema>
>>
>> Now when  I try to generate a xml based on jar generated from above xsd,
>> I
>> get following:
>>
>> <xml-fragment>
>>  <HEADER>
>>    <APPLICATION_ID>USER</APPLICATION_ID>
>>    <IBPASSWORD>xyz</IBPASSWORD>
>>    <LANGUAGE_CD>ENG</LANGUAGE_CD>
>>  </HEADER>
>>  <DSID>45454545</DSID>
>>  <COUNTRY>USA</COUNTRY>
>>  <ADDRESS1>s</ADDRESS1>
>>  <ADDRESS2>s</ADDRESS2>
>>  <ADDRESS3/>
>>  <ADDRESS4/>
>>  <CITY>s</CITY>
>>  <STATE>CA</STATE>
>>  <COUNTY/>
>>  <POSTAL>95014</POSTAL>
>> </xml-fragment>
>>
>> The xml as you can see is mostly fine, except for the top node which is
>> </xml-fragment>.
>>
>> Can some one please tell me how to correct this?
>>
>> Thanks in advance!
>> riya
>> --
>> View this message in context:
>> http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22070264.html
>> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
>> For additional commands, e-mail: user-help@xmlbeans.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22106941.html
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org


Re: Issues

Posted by Jacob Danner <ja...@gmail.com>.
Can you post a snippet of code?
-jacobd

On Tue, Feb 17, 2009 at 5:19 PM, riya <ra...@gmail.com> wrote:
>
> Hi,
>
> I generated xsd using inst2xsd provided with xmlbeans.
>
> command:
> inst2xsd rd Address_Valid_Request.xml
>
> Following is the xsd I got:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
> xmlns:xs="http://www.w3.org/2001/XMLSchema">
>  <xs:element name="ADDR_VALID_REQUEST" type="ADDR_VALID_REQUESTType"/>
>  <xs:complexType name="HEADERType">
>    <xs:sequence>
>      <xs:element type="xs:string" name="APPLICATION_ID"/>
>      <xs:element type="xs:string" name="IBPASSWORD"/>
>      <xs:element type="xs:string" name="LANGUAGE_CD"/>
>    </xs:sequence>
>  </xs:complexType>
>  <xs:complexType name="ADDR_VALID_REQUESTType">
>    <xs:sequence>
>      <xs:element type="HEADERType" name="HEADER"/>
>      <xs:element type="xs:int" name="DSID"/>
>      <xs:element type="xs:string" name="COUNTRY"/>
>      <xs:element type="xs:string" name="ADDRESS1"/>
>      <xs:element type="xs:string" name="ADDRESS2"/>
>      <xs:element type="xs:string" name="ADDRESS3"/>
>      <xs:element type="xs:string" name="ADDRESS4"/>
>      <xs:element type="xs:string" name="CITY"/>
>      <xs:element type="xs:string" name="STATE"/>
>      <xs:element type="xs:string" name="COUNTY"/>
>      <xs:element type="xs:int" name="POSTAL"/>
>    </xs:sequence>
>  </xs:complexType>
> </xs:schema>
>
> Now when  I try to generate a xml based on jar generated from above xsd, I
> get following:
>
> <xml-fragment>
>  <HEADER>
>    <APPLICATION_ID>USER</APPLICATION_ID>
>    <IBPASSWORD>xyz</IBPASSWORD>
>    <LANGUAGE_CD>ENG</LANGUAGE_CD>
>  </HEADER>
>  <DSID>45454545</DSID>
>  <COUNTRY>USA</COUNTRY>
>  <ADDRESS1>s</ADDRESS1>
>  <ADDRESS2>s</ADDRESS2>
>  <ADDRESS3/>
>  <ADDRESS4/>
>  <CITY>s</CITY>
>  <STATE>CA</STATE>
>  <COUNTY/>
>  <POSTAL>95014</POSTAL>
> </xml-fragment>
>
> The xml as you can see is mostly fine, except for the top node which is
> </xml-fragment>.
>
> Can some one please tell me how to correct this?
>
> Thanks in advance!
> riya
> --
> View this message in context: http://www.nabble.com/%3Cxml-fragment%3E-Issues-tp22070264p22070264.html
> Sent from the Xml Beans - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: user-help@xmlbeans.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: user-help@xmlbeans.apache.org