This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Micro Frontends in Action and have Michael Geers on-line!
See this thread for details.
Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Mapping xmlschema to excel sheet using JAXB

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to map xml schema into excel sheet ?
 
Rancher
Posts: 43016
76
  • 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: 43016
76
  • 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: 43016
76
  • 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: 43016
76
  • 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.
 
You've gotta fight it! Don't give in! Read this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic