Click here to Skip to main content
15,913,685 members
Home / Discussions / C#
   

C#

 
QuestionPrintPreviewControl without installed printers Pin
Luis Alonso Ramos31-Oct-05 5:17
Luis Alonso Ramos31-Oct-05 5:17 
AnswerRe: PrintPreviewControl without installed printers Pin
Dan Neely31-Oct-05 5:51
Dan Neely31-Oct-05 5:51 
GeneralRe: PrintPreviewControl without installed printers Pin
Luis Alonso Ramos31-Oct-05 6:24
Luis Alonso Ramos31-Oct-05 6:24 
Questionc#.net excel add-in problem Pin
mack scynox31-Oct-05 3:57
mack scynox31-Oct-05 3:57 
AnswerRe: c#.net excel add-in problem Pin
Dan Neely31-Oct-05 4:36
Dan Neely31-Oct-05 4:36 
QuestionUnloading an Assembly loaded via reflection. Pin
Tristan Rhodes31-Oct-05 3:45
Tristan Rhodes31-Oct-05 3:45 
AnswerRe: Unloading an Assembly loaded via reflection. Pin
Febret31-Oct-05 4:43
Febret31-Oct-05 4:43 
QuestionProblems with XPath... Pin
Carl Mercier31-Oct-05 3:22
Carl Mercier31-Oct-05 3:22 
Hi!

I'm trying to retrieve a value from a XML using XPath. However, I get this exception:

Namespace Manager or XsltContext needed. This query has a prefix, variable, or user-defined function. 


My code is as following:

XPath Query: /rdf:RDF/geo:Point/geo:lat/text()

C# Code:
		public static string GetValue(XPathDocument doc, string query) <br />
		{<br />
			XPathNavigator nav = doc.CreateNavigator();	<br />
			XPathNodeIterator iter = nav.Select(query);<br />
<br />
			if (iter.MoveNext()) <br />
				return iter.Current.Value;<br />
			else<br />
				return null;<br />
		}


XML:
<rdf:RDF xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<geo:Point>
<geo:long>-0.15</geo:long>
<geo:lat>50.8333333</geo:lat>
</geo:Point>
</rdf:RDF>



Anyone has an idea of what's going on? It must be pretty simple but I couldn't find much on Google.

Thanks!
AnswerRe: Problems with XPath... Pin
leppie31-Oct-05 6:10
leppie31-Oct-05 6:10 
QuestionDisplaying italicized text on a dialog Pin
Dan Neely31-Oct-05 3:22
Dan Neely31-Oct-05 3:22 
AnswerRe: Displaying italicized text on a dialog Pin
Febret31-Oct-05 4:57
Febret31-Oct-05 4:57 
GeneralRe: Displaying italicized text on a dialog Pin
Dan Neely31-Oct-05 5:37
Dan Neely31-Oct-05 5:37 
Questionhow can get an embedded source? Pin
Sasuko31-Oct-05 2:23
Sasuko31-Oct-05 2:23 
AnswerRe: how can get an embedded source? Pin
Rob Philpott31-Oct-05 2:47
Rob Philpott31-Oct-05 2:47 
GeneralRe: how can get an embedded source? Pin
Sasuko31-Oct-05 4:51
Sasuko31-Oct-05 4:51 
GeneralRe: how can get an embedded source? Pin
Dan Neely31-Oct-05 4:58
Dan Neely31-Oct-05 4:58 
GeneralRe: how can get an embedded source? Pin
Rob Philpott31-Oct-05 5:05
Rob Philpott31-Oct-05 5:05 
GeneralRe: how can get an embedded source? Pin
Sasuko31-Oct-05 7:04
Sasuko31-Oct-05 7:04 
GeneralRe: how can get an embedded source? Pin
Joe Woodbury31-Oct-05 8:55
professionalJoe Woodbury31-Oct-05 8:55 
Questionc# compiler -&gt; vb.net compiler problem ?? Pin
Tee+31-Oct-05 1:52
Tee+31-Oct-05 1:52 
AnswerRe: c# compiler -&amp;gt; vb.net compiler problem ?? Pin
leppie31-Oct-05 6:07
leppie31-Oct-05 6:07 
GeneralRe: c# compiler -&amp;amp;gt; vb.net compiler problem ?? Pin
Tee+31-Oct-05 18:10
Tee+31-Oct-05 18:10 
QuestionCultureInfo question... Pin
e-laj31-Oct-05 1:51
e-laj31-Oct-05 1:51 
QuestionTreeView Getting the node the user rightclicked on Pin
tcss31-Oct-05 1:04
tcss31-Oct-05 1:04 
AnswerRe: TreeView Getting the node the user rightclicked on Pin
Robert Rohde31-Oct-05 1:30
Robert Rohde31-Oct-05 1:30 

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.