• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Bear Bibeault
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • salvin francis
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Frits Walraven
Bartenders:
  • Jj Roberts
  • Carey Brown
  • Scott Selikoff

Open XML in excel file

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
requirement is to open xml in excel format
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do you mean by "xml in excel format"? What do you have so far, and where are you stuck making progress?
 
prabh singh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am attaching xml in email and requirement is on opening it (double clicking) it should be open in excel file
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know that anyone would want to configure their computers to open a spreadsheet application upon double-clicking an XML file; you may want to reconsider that approach.

Why do you not want to send a spreadsheet data file instead, like XLS or XLSX?
 
lowercase baba
Posts: 12965
66
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The extension on a file name is really meaningless, except by convention. You could name a text file as a .exe, or an excel file with a .zip extension.

Now, there are two problems:

1) HUMANS assign meaning to them. If I see a file with ".xml" on the end, I assume it is an XML file. If I see a file that ends with ".zip", I assume I need to unzip it before I can read/use it.

2) Computers - and specifically Windows - assign meaning to them. Windows sets up "associations" between file extensions and applications. So, on my windows machine, when I double click on a file with a .doc extension, Windows says "Oh...i need to open that file. It has the '.doc' extension, and I know the user wants me to use MS Word to open those file". Any .xml file is opened with XML Spy. If I doubleclick on a file with an extension there is no association for, my computer asks me "What do you want to open this file with?", and further says "Should I do this for EVERY file with that extension from now on?"

So..the upshot here is that you cannot FORCE someone to open a XML file with excel - the USER gets to decide what to use. After all, what if they don't even HAVE Excel? I personally use OpenOffice for my spreadsheets.

 
prabh singh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks fred and Ulf
Actually I have seen sample of xml which on double click open in excel (even in open office ) but many attributes are added to it just for one row in excel almost one page of attributes are added (for style and proper format ) so i thought if any one have done this before can help
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm still curious about this:

Why do you not want to send a spreadsheet data file instead, like XLS or XLSX?

 
fred rosenberger
lowercase baba
Posts: 12965
66
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

prabh singh wrote:Actually I have seen sample of xml which on double click open in excel (even in open office )


yes. It CAN happen, if the user associates Excel with .xml extensions. I've not really dug into these pages, but they look like they might explain it better:

one
two

The upshot being - You cannot send someone a file and FORCE them to use a specific program on double-click. THEY get to determine what program opens what files.
 
prabh singh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ok thanks i will see these and Ulf Dittmer actually i want to send xml as it can be readable by other application
 
prabh singh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i am following this link but want to this automatically
http://www.excel-easy.com/examples/xml.html
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What kind of application? XML is a format not many apps will be able to make use of, as opposed to TXT or CSS, both of which are readily exported from a spreadsheet app.

I think meaningfully importing XML into a spreadsheet will be a challenge, too, assuming you can get the user to map double-clicking an XML file to a spreadsheet, which as I said is unlikely.
 
prabh singh
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ulf Dittmer yes but it was client requirement
finally done that
<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Worksheet ss:Name="Report">
<Table>
<Row>
<Cell><Data ss:Type="String">a1</Data></Cell>
<Cell><Data ss:Type="String">b1</Data></Cell>
</Row>
<Row>
<Cell><Data ss:Type="String">a2</Data></Cell>
<Cell><Data ss:Type="String">b2</Data></Cell>
</Row>
</Table>
</Worksheet>
</Workbook>
 
Stop it! You're embarassing me! And you are embarrassing 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