hi everybody,
i got a problem with xpath. I want to import Data from an XML-Document into Excel.
This is how my XML-Document looks like :
My Problem is that the node "Person" and "Adresse" are in a "1 : n" relationship through the Value of PersNr and so i want to map all "adresse"-nodes to the "Person" it belongs too.
But all i have archived is to show all "person" and then all "adresse" elements via
string namespcace = "xmlns:mstns='http://AutorenDataSet.com'";
Excel.ListObject loHistory = ws.ListObjects.Add(Microsoft.Office.Interop.Excel.XlListObjectSourceType.xlSrcRange, rg.get_Offset(5, 0).get_Resize(2, 5), missing, Excel.XlYesNoGuess.xlGuess, missing);
loHistory.ListColumns[1].XPath.SetValue(xmlMap, "mstns:PersonenDataSet/mstns:Person/mstns:Vorname", namespcace, missing);
loHistory.ListColumns[2].XPath.SetValue(xmlMap, "mstns:PersonenDataSet/mstns:Adresse/mstns:Stadt", namespcace, missing);
...for the all compontents of "Person" and "Adresse" i want to show
i really would appreciate help
Edit : do u need more informations ? maybe the xsd schema ?
Bookmarks