Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

the .xsd file, and the xml document  RSS feed

 
jite eghagha
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm learning to use xmlBeans.
does each document i return require it's own .xsd? Yes or NO ?

Can i, should i, define both their .xsd files in one xsd file?


Take a look at two very different xml documents my service returns:

1.
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://BasisPlus/">
<soapenv:Body>
<ns1:getProjectRecordByIDXMLResponse>
<return><?xml version="1.0" encoding="UTF-8"?>
<BASIS>
<PROJECT>
<ProjectChief>
<Name>#####, #####.</Name>
</ProjectChief>
<ProjectTitle>
<Title>Office of Director Support</Title>
</ProjectTitle>
<CostCenter>
<Name>OFFICE OF THE DIRECTOR</Name>
</CostCenter>
<TASK>
<Title>OOD ####### Default</Title>
<Title>OOD Payroll Default</Title>
<Title>OOD Rent</Title>
<Title>Operations & Maintenance Costs</Title>
<Title>DO Credit Account</Title>
<Title>DO Income Account</Title>
</TASK>
</PROJECT>
</BASIS>
</return>
</ns1:getProjectRecordByIDXMLResponse>
</soapenv:Body>
</soapenv:Envelope>


2.
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://BasisPlus/">
<soapenv:Body>
<ns1:getProjectChiefInformationByIDXMLResponse>
<return><?xml version="1.0" encoding="UTF-8"?>
<BASIS>
<PROJECT>
<ChiefInformation>
<Name>### %%^&&*.</Name>
<Email>psk@aol.com</Email>
<Mail>#######, #####, ## ######</Mail>
</ChiefInformation>
</PROJECT>
</BASIS>
</return>
</ns1:getProjectChiefInformationByIDXMLResponse>
</soapenv:Body>
</soapenv:Envelope>
 
jite eghagha
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got it. thanks anyway.

http://www.onjava.com/pub/a/onjava/2004/07/28/XMLBeans.html?page=2
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!