Is there a way to view the existing XML mapping after loading an existing Workbook? Primarily, I need to connect the DataConnection to the Table that the connection maps to.
Hi,
Thanks for your interest in Aspose.Cells.
Please provide us your sample excel file and explain what do you want to retrieve from it via some screenshots. It will help us investigate your issue and we will let you know if your requirements could be achieved using Aspose.Cells APIs.
In the attached spreadsheet sample.xlsx, there is a Workbook Connection named “Connection” that points to a URL for a web query. The data from that web query is XML data that maps to the sheet using the XML Map named “catalog_Map” to the table named “Table1”.
Hi,
Thanks for providing us the sample excel file clarifying your requirements and considering Aspose.Cells.
I have investigated this issue with the latest version: Aspose.Cells for .NET 8.6.3 using the following code and I think, it will suit your requirements. I have also attached the screenshot showing the quick watch values of the connection object. Also I have shown the console output of the code for your reference.
Once you have accessed the URL of your XML, you can retrieve it from internet using .NET Framework Networking APIs.
If it does not fit your requirements, could you please clarify it further so that we could look into your issue more closely and precisely. Thanks for your cooperation.
C#
string filePath = @“F:\Shak-Data-RW\Downloads\sample.xlsx”;
Workbook workbook = new Workbook(filePath);
WebQueryConnection con = workbook.DataConnections[0] as WebQueryConnection;
Console.WriteLine("URL: " + con.Url);
Console Output
URL: http://saluce-text-xml.azurewebsites.net/sample.xml
That’s only half the problem, though. First, I need a list of XML maps. In my sample spreadsheet, the XML Map is called catalog_Map (see screenshot). Next, I need to know what data connection id the xml map uses. Finally, I need to know the named table that the xml map actually maps to.
Hi,
Thanks for explaining everything clearly with your screenshot and considering Aspose.Cells.
We are able to understand your feature request. We have therefore logged this issue in our database for investigation. We will look into it and implement this feature. Once the feature is available or we have some other update for you, we will let you know asap.
This issue has been logged as
- CELLSNET-44150 - Ability to work with XML Maps
Hi,
Thanks for using Aspose.Cells.
This is to inform you that we have fixed your issue CELLSNET-44150 now. We will soon provide the fix after performing QA and including other enhancements and fixes.
Hi,
Please try our latest version/fix: Aspose.Cells for .NET v8.6.3.3 (attached)
See the following codes:
e.g
Sample code:
Workbook workbook = new Workbook();
workbook.ImportXml("http://saluce-text-xml.azurewebsites.net/sample.xml", "Sheet1", 0, 0);
Let us know your feedback.
Thank you.
The issues you have found earlier (filed as CELLSNET-44150;CELLSNET-43992) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.
Aspose.Cells and XML Map
Related Reply Quote FavoritesContact
Dear Madam od Sir,
Does Aspose.Cells support XML maps ?
I have an Excel file with attached xml schema and cells mapped to the schema.
Is it possible to import/export xml data in such excel using Aspose ?
I can do it in Excel from Developer tab using Import/Export buttons, but I want to do it programmatically, without starting Excel.
Best regards,
Darko
Hi,
Thanks for your posting and considering Aspose.Cells.
Yes, it now supports importing XML Map. Please download and use the latest version:
Aspose.Cells for .NET 8.7.0.
Please see the following documentation article that explains how to import xml map inside your workbook using Aspose.Cells.
Import XML to Excel workbook|Documentation
Hi Shakeel,
That’s great that Cells supports XML Maps now; we are also interested in this feature. However, it looks like this functionality is only available for the .NET libraries. Are there any plans on supporting this feature in Aspose.Cells for Java? There’s no mention of it in the Aspose.Cells for Java 8.7.0 announcement.
Thanks.
Hi,
Thanks for your posting and using Aspose.Cells.
Yes, it is also available in
Aspose.Cells for Java 8.7.0.
Please see this document for your reference. This is for Java version.
( Import XML Map inside a Workbook using Aspose.Cells|Documentation )
Hi,
I tried Aspose.Cells for importing XML Maps but unlike to Excel all the data are always imported even if we define an array with only some columns that are related to the xml map
Is there a way to fill only the columns that are defined in the array like Excel does when importing XML data ?
Regards
Hi,
Thanks for your description of the issue, screenshots and using Aspose.Cells.
It will be helpful if you could also provide us the xml files as you have shown in the screenshots as well as console application project containing your code.
We will then evaluate it and add it as a New Feature to support your needs. Thanks for your cooperation.
Hello,
Attached you will find a sample program and the xml files that show the requested behaviour.
I’ve also addeed a new word document that explain more precisely what we are doing now and the expected result when using Aspose.cells
Regards,
Judicaël.
Hi Judicaël,
Thanks for your further information and considering Aspose.Cells.
We have logged your requirement as a New Feature in our database for investigation and implementation. We will look into it and implement it if possible. Once there is some fix or other news for you, we will let you know asap.
This issue has been logged as
- CELLSNET-44374 - Import xml map by defining an array of only some columns that are related to the xml map
Hi again,
Hi,
Please try our latest version/fix: Aspose.Cells for .NET 9.0.1.0 against the issue logged earlier as “CELLSNET-44374”.
Please see the APIs:
Workbook.ImportXml(string url, string sheetName, int row, int col). If XmlMap doesn’t exist, it will import the whole xml data to sheet. If XmlMap exist, it will update the data of the xmlMap linked cells in workbook.
e.g
Sample code:
Workbook wb = new Workbook(TestAspose.xlsm);
wb.ImportXml(FullXMLImport.xml, "Cover sheet", 0, 0);
wb.Save(outFile.xlsx);
Thank you.
The issues you have found earlier (filed as CELLSNET-44374) have been fixed in this update.
This message was posted using Notification2Forum from Downloads module by Aspose Notifier.