wood burning stoves 2.0*
The moose likes XML and Related Technologies and the fly likes Mapping xmlschema to excel sheet using JAXB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Mapping xmlschema to excel sheet using JAXB" Watch "Mapping xmlschema to excel sheet using JAXB" New topic
Author

Mapping xmlschema to excel sheet using JAXB

jeya prabha
Greenhorn

Joined: Jun 03, 2008
Posts: 23
how to map xml schema into excel sheet ?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39551
    
  27
What does it mean to map an XML schema to an XLS file? Can you give a full example of what that should do?


Ping & DNS - updated with new look and Ping home screen widget
jeya prabha
Greenhorn

Joined: Jun 03, 2008
Posts: 23
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
Marshal

Joined: Mar 22, 2005
Posts: 39551
    
  27
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

Joined: Jun 03, 2008
Posts: 23
then tell me how to convert into XML ?
which API methods we can use?
jeya prabha
Greenhorn

Joined: Jun 03, 2008
Posts: 23
XLS file is nothing but ,it contains structre of the XML document.
we need to map schema and datas into xlsheet
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39551
    
  27
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

Joined: Jun 03, 2008
Posts: 23
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
Marshal

Joined: Mar 22, 2005
Posts: 39551
    
  27
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mapping xmlschema to excel sheet using JAXB
 
Similar Threads
writting to excel sheet through java
display of japanese characters in Excel report
handling excel sheet with java
Opening Excel sheet
WA #1.....word association