• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mapping xmlschema to excel sheet using JAXB

 
jeya prabha
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to map xml schema into excel sheet ?
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does it mean to map an XML schema to an XLS file? Can you give a full example of what that should do?
 
jeya prabha
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for example
<xs:element name="Employee">
<xs:complexType>
<xs:sequence>
<xs:element name="Name" type="xs:string"/>
<xs:element name="Emp_ID" type="xs:string"/>
<xs:element name="Designation" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>

and am having the datas for like ,Name,Emp_ID,Designation
i need to map schemas into xl sheet .
then i need to produce xml output
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you need to convert an XLS file to an XML file that conforms to a specific schema? JAXB maps POJO objects to XML, but I don't see how it would help with an XLS file.
 
jeya prabha
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
then tell me how to convert into XML ?
which API methods we can use?
 
jeya prabha
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
XLS file is nothing but ,it contains structre of the XML document.
we need to map schema and datas into xlsheet
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For reading XLS files I recommend Apache POI; it comes with extensive sample code. The easiest way to create XML files may be to simply write directly to a file using the java.io classes. You can also use any of the DOM APIs (straight DOM, JDOM, XOM, dom4j, ...) to create an in-memory representation and then use the API to serialize it to disk. But for simple XML I'd go with the direct-to-file approach.

There's no API (to my knowledge) that can map XML to XLS; you'll need to make that part of your code.
[ September 17, 2008: Message edited by: Ulf Dittmer ]
 
jeya prabha
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
am using apachePOi for reading xls data and displaying data.
how to convert xml and how to validate using schema?
please help me out.
thanks.
 
Ulf Dittmer
Rancher
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you looked at any of the libraries I mentioned? Have you considered using straight file I/O for writing out XML?

You seem to be looking for some ready-made XLS->XML conversion, and that simply doesn't exist.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic