C# Excel Add-in / XML / XPath Problem

  • Thread starter Thread starter Peter Smith
  • Start date Start date
P

Peter Smith

Hello,
I've a problem, and I'd appreciate any help you can offer.
I'm developing an Excel XP Add-In with C#.

The scenario is the following:

1. connect to a web service to get XML data (this works already)

2. how do I fill the cells with the XML data (there are Xpath
directives in the cells)
(and that is my problem


example
XML Data:

<data>
<value>1234</value>
</data>

excel cell formula "<abc:/data/value>"
(note I us e <abc:...> to distinguish between normal text and a
formula.


Thanks a lot
-Peter
 
Peter,

If you need to populate the cells, then what I would do is get all the
cells that need populating. Once you have that, you can get the XML content
from the dataset and place it into an XMLDocument instance. Once you have
that, you can then easily select the node that corresponds to the cell
formula and populate the value with what is in the XML from the dataset.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

XPath 3
Writing an easy xml 5
Error in Xpath 3
A couple of dumb c# / xml questions 4
Xpath in c# 9
C# - XPath, XMLDataSource and a DataGridView 5
LINQ to XML - Performance - Speed 7
What's wrong with my xpath? 3

Back
Top