Click here to Skip to main content
15,890,882 members
Home / Discussions / C#
   

C#

 
GeneralRe: how do I map a network drive in C# Pin
laptop_016-Feb-04 7:24
laptop_016-Feb-04 7:24 
GeneralProblem setting enum field value using Remoting Pin
claughlin6-Feb-04 6:18
claughlin6-Feb-04 6:18 
GeneralRe: Problem setting enum field value using Remoting Pin
Heath Stewart7-Feb-04 19:39
protectorHeath Stewart7-Feb-04 19:39 
GeneralRe: Problem setting enum field value using Remoting Pin
ClarkLaughlin8-Feb-04 9:03
ClarkLaughlin8-Feb-04 9:03 
GeneralDate Difference Pin
hxxbin6-Feb-04 6:17
hxxbin6-Feb-04 6:17 
GeneralRe: Date Difference Pin
Mazdak6-Feb-04 7:26
Mazdak6-Feb-04 7:26 
GeneralRe: Date Difference Pin
Heath Stewart7-Feb-04 19:40
protectorHeath Stewart7-Feb-04 19:40 
GeneralAn XML newbie's problem Pin
cemlouis6-Feb-04 5:50
cemlouis6-Feb-04 5:50 
Hi, I am not sure this is the right place to post my problem but I think
there are some people out there who can solve my newbie problem. I am
posting my source xml and the code file.

////////////////XML File///////////////
<?xml version="1.0"?>
<!-- a fragment of a book store inventory database -->
<bookstore xmlns:bk="urn:samples">
<book genre="novel" publicationdate="1992" bk:ISBN="1-861001-57-8">
<title>Pride And Prejudice</title>
<author>
<first-name>Jane</first-name>
<last-name>Austen</last-name>
</author>
<price>24.95</price>
</book>
<book genre="novel" publicationdate="1992" bk:ISBN="1-861002-30-1">
<title>The Handmaid's Tale</title>
<author>
<first-name>Margaret</first-name>
<last-name>Atwood</last-name>
</author>
<price>29.95</price>
</book>
<book genre="novel" publicationdate="1991" bk:ISBN="1-861001-57-6">
<title>Emma</title>
<author>
<first-name>Jane</first-name>
<last-name>Austen</last-name>
</author>
<price>19.95</price>
</book>
<book genre="novel" publicationdate="1982" bk:ISBN="1-861001-45-3">
<title>Sense and Sensibility</title>
<author>
<first-name>Jane</first-name>
<last-name>Austen</last-name>
</author>
<price>19.95</price>
</book>
</bookstore>

////////////////Code File/////////////////
using System;
using System.IO;
using System.Xml;
using System.Xml.XPath;

public class Sample
{
public static void Main()
{

XPathDocument doc = new XPathDocument("booksort2.xml");
XPathNavigator nav = doc.CreateNavigator();

//Select all books by Jane Austen.
XPathExpression expr;
expr = nav.Compile("descendant::book[@publicationdate='1992']");

//Sort the selected books by title.
expr.AddSort("@ISBN", XmlSortOrder.Ascending, XmlCaseOrder.None, "", XmlDataType.Text);

//Display the selection.
XPathNodeIterator iterator = nav.Select(expr);
while (iterator.MoveNext())
{
XPathNavigator nav2 = iterator.Current.Clone();
nav2.MoveToFirstChild();
Console.WriteLine("Book ISBN: {0}", nav2.Value);
}
}

}

/*
I want an output like this:
//////////////////////////////////
Book ISBN: 1-861001-57-8
Book ISBN: 1-861002-30-1
//////////////////////////////////

But I get this???
//////////////////////////////////
Book ISBN: Pride And Prejudice
Book ISBN: The Handmaid's Tale
//////////////////////////////////
*/

Any help will be appreciated, Thanx
GeneralRe: An XML newbie's problem Pin
Kentamanos6-Feb-04 8:50
Kentamanos6-Feb-04 8:50 
GeneralRe: An XML newbie's problem Pin
cemlouis8-Feb-04 8:59
cemlouis8-Feb-04 8:59 
GeneralResources files in VS.NET with CSharp. Pin
NeoAsimov6-Feb-04 5:50
NeoAsimov6-Feb-04 5:50 
GeneralRe: Resources files in VS.NET with CSharp. Pin
Kentamanos6-Feb-04 9:07
Kentamanos6-Feb-04 9:07 
GeneralRe: Resources files in VS.NET with CSharp. Pin
NeoAsimov6-Feb-04 9:28
NeoAsimov6-Feb-04 9:28 
GeneralAdding an event to prepackaged control Pin
dgroves6-Feb-04 5:01
dgroves6-Feb-04 5:01 
GeneralRe: Adding an event to prepackaged control Pin
Heath Stewart7-Feb-04 19:43
protectorHeath Stewart7-Feb-04 19:43 
GeneralRe: Adding an event to prepackaged control Pin
dgroves9-Feb-04 4:42
dgroves9-Feb-04 4:42 
GeneralPrivate Assembly in same Solution Pin
Anonymous6-Feb-04 4:52
Anonymous6-Feb-04 4:52 
GeneralRe: Private Assembly in same Solution Pin
Heath Stewart7-Feb-04 19:47
protectorHeath Stewart7-Feb-04 19:47 
GeneralObject reference not set to an instance of an object. Pin
cdwaddell6-Feb-04 4:06
cdwaddell6-Feb-04 4:06 
GeneralRe: Object reference not set to an instance of an object. Pin
Douglas Troy6-Feb-04 4:15
Douglas Troy6-Feb-04 4:15 
GeneralRe: Object reference not set to an instance of an object. Pin
cdwaddell6-Feb-04 4:22
cdwaddell6-Feb-04 4:22 
GeneralRe: Object reference not set to an instance of an object. Pin
Douglas Troy6-Feb-04 4:35
Douglas Troy6-Feb-04 4:35 
Generalsetting install location for merge module Pin
godzooky6-Feb-04 3:58
godzooky6-Feb-04 3:58 
GeneralRe: setting install location for merge module Pin
Douglas Troy6-Feb-04 4:04
Douglas Troy6-Feb-04 4:04 
GeneralRe: setting install location for merge module Pin
godzooky6-Feb-04 4:37
godzooky6-Feb-04 4:37 

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.