Click here to Skip to main content
15,914,016 members
Home / Discussions / C#
   

C#

 
GeneralRe: Ethical Coding Style Pin
Christian Graus14-Jan-05 9:07
protectorChristian Graus14-Jan-05 9:07 
GeneralRe: Ethical Coding Style Pin
Wayne Phipps14-Jan-05 23:12
Wayne Phipps14-Jan-05 23:12 
GeneralRe: Ethical Coding Style Pin
Christian Graus15-Jan-05 9:45
protectorChristian Graus15-Jan-05 9:45 
GeneralAngle between 2 vectors Pin
flipper8614-Jan-05 7:30
flipper8614-Jan-05 7:30 
GeneralRe: Angle between 2 vectors Pin
Dave Kreskowiak14-Jan-05 7:49
mveDave Kreskowiak14-Jan-05 7:49 
QuestionHow do you determine MSAccess version? Pin
Hostia14-Jan-05 5:12
Hostia14-Jan-05 5:12 
AnswerRe: How do you determine MSAccess version? Pin
Rob Graham14-Jan-05 11:50
Rob Graham14-Jan-05 11:50 
GeneralProblems reading through XML file with XPathNavigator and XPathNodeIterator Pin
huckfinn14-Jan-05 4:57
huckfinn14-Jan-05 4:57 
Hi!

I have some problems reading an XML file with the following code:

--------------
XPathDocument oDoc = new XPathDocument(sXmlFilePath);
XPathNavigator oNavigator = oDoc.CreateNavigator();
XPathNodeIterator oIterator = oNavigator.Select("/pages/page");
if(oIterator.Count == 0)
return;

while(oIterator.MoveNext()) {
//read through the pages
}
-------------

The code works with the following XML:

<?xml version="1.0" encoding="utf-8" ?>
<pages>
<page name-fr="Niveaux" name-en="Levels">
...
</page>
</pages>

But fails with:

<?xml version="1.0" encoding="utf-8" ?>
<pages xmlns="http://tempuri.org/ConfigStructure2.xsd">
<page name-fr="Niveaux" name-en="Levels">
...
</page>
</pages>


Because of the xmlns.

What is the syntax in my "Select" to make sure I don't care about what the xmlns is and go directly to iterate though the pages? Is there another way to skip directly to the "page" nodes?


Thanks!

GeneralRe: Problems reading through XML file with XPathNavigator and XPathNodeIterator Pin
leppie14-Jan-05 5:55
leppie14-Jan-05 5:55 
GeneralCOM in C# (regarding MSMQ) Pin
Esmo200014-Jan-05 4:44
Esmo200014-Jan-05 4:44 
GeneralExtracting Data From Text Files Pin
lizim14-Jan-05 3:52
lizim14-Jan-05 3:52 
GeneralRe: Extracting Data From Text Files Pin
Nick Parker14-Jan-05 4:09
protectorNick Parker14-Jan-05 4:09 
GeneralRe: Extracting Data From Text Files Pin
lizim14-Jan-05 4:17
lizim14-Jan-05 4:17 
GeneralRe: Extracting Data From Text Files Pin
Wayne Phipps14-Jan-05 22:59
Wayne Phipps14-Jan-05 22:59 
Generalmetafiles - physical dimensions in mm Pin
jadamcrain14-Jan-05 3:47
jadamcrain14-Jan-05 3:47 
GeneralDistribute separate forms Pin
Jassim Rahma14-Jan-05 3:34
Jassim Rahma14-Jan-05 3:34 
GeneralRe: Distribute separate forms Pin
Nick Parker14-Jan-05 4:04
protectorNick Parker14-Jan-05 4:04 
GeneralUSB Printer Pin
Peter Beedell14-Jan-05 1:13
Peter Beedell14-Jan-05 1:13 
GeneralRe: USB Printer Pin
Dave Kreskowiak14-Jan-05 4:49
mveDave Kreskowiak14-Jan-05 4:49 
GeneralMulti Column TreeView Pin
orlyg14-Jan-05 0:23
orlyg14-Jan-05 0:23 
GeneralRe: Multi Column TreeView Pin
Robert Rohde14-Jan-05 1:02
Robert Rohde14-Jan-05 1:02 
GeneralOleDbException (exclusive access) Pin
Serge Lobko-Lobanovsky14-Jan-05 0:13
Serge Lobko-Lobanovsky14-Jan-05 0:13 
GeneralRe: OleDbException (exclusive access) Pin
Mike Dimmick14-Jan-05 0:48
Mike Dimmick14-Jan-05 0:48 
GeneralRe: OleDbException (exclusive access) Pin
Serge Lobko-Lobanovsky14-Jan-05 0:56
Serge Lobko-Lobanovsky14-Jan-05 0:56 
GeneralCalling CDialog C++ code from C# Pin
gabnicu13-Jan-05 23:50
gabnicu13-Jan-05 23:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.