Click here to Skip to main content
15,914,905 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: bind xml datagrid Pin
jphuphilly11-Jul-03 7:53
jphuphilly11-Jul-03 7:53 
General.NET DataSet -> Xml + XSLT -> HTML Pin
dratti9-Jul-03 5:28
dratti9-Jul-03 5:28 
GeneralRe: .NET DataSet -> Xml + XSLT -> HTML Pin
Philip Fitzsimons9-Jul-03 6:56
Philip Fitzsimons9-Jul-03 6:56 
GeneralRe: .NET DataSet -> Xml + XSLT -> HTML Pin
dratti9-Jul-03 9:42
dratti9-Jul-03 9:42 
GeneralRe: .NET DataSet -> Xml + XSLT -> HTML Pin
Philip Fitzsimons10-Jul-03 2:47
Philip Fitzsimons10-Jul-03 2:47 
GeneralRe: .NET DataSet -> Xml + XSLT -> HTML Pin
dratti10-Jul-03 4:21
dratti10-Jul-03 4:21 
GeneralXML DOM get current position Node Pin
Anonymous9-Jul-03 0:18
Anonymous9-Jul-03 0:18 
GeneralRe: XML DOM get current position Node Pin
Philip Fitzsimons9-Jul-03 7:10
Philip Fitzsimons9-Jul-03 7:10 
by position I presume you mean name - you could use:
XmlNodeList results = document.SelectNodes(""//root/bla");<br />
foreach (XmlNode result in rtesults)<br />
{<br />
  Console.Write("found {0} value = '{1}'", GetNodeName(result), result.value);<br />
}<br />
<br />
string GetNodeName(XmlNode node)<br />
{<br />
  string result = node.LocalName;<br />
<br />
  if (node.Parent != null)<br />
    result = GetNodeName(node.Parent) + "/" + result;<br />
<br />
  return result;<br />
}


if you want the position then just change the above function to count previousSiblings:
<br />
string GetNodePosition(XmlNode node)<br />
{<br />
  int previousSiblings = 0; <br />
  for (XmlNode previous_node = node.PreviousSibling; previous_node != null; previous_node = previous_node.PreviousSibling)<br />
    previousSiblings++;<br />
  string result = previousSiblings.ToString();<br />
<br />
  if (node.Parent != null)<br />
    result = GetNodeName(node.Parent) + "/" + result;<br />
<br />
  return result;<br />
}


hope this helps




"When the only tool you have is a hammer, a sore thumb you will have."

GeneralRe: XML DOM get current position Node Pin
Anonymous10-Jul-03 2:08
Anonymous10-Jul-03 2:08 
GeneralXML Schema Import Pin
Jason Weibel8-Jul-03 8:46
Jason Weibel8-Jul-03 8:46 
GeneralRe: XML Schema Import Pin
Retsof Nawor8-Jul-03 10:14
Retsof Nawor8-Jul-03 10:14 
GeneralRe: XML Schema Import Pin
Jason Weibel8-Jul-03 10:24
Jason Weibel8-Jul-03 10:24 
GeneralRe: XML Schema Import Pin
Jason Weibel8-Jul-03 10:36
Jason Weibel8-Jul-03 10:36 
GeneralRe: XML Schema Import Pin
Retsof Nawor8-Jul-03 10:50
Retsof Nawor8-Jul-03 10:50 
Generalrss file Pin
jphuphilly8-Jul-03 3:52
jphuphilly8-Jul-03 3:52 
Generalchildnodes.length Pin
xaphod5-Jul-03 10:45
xaphod5-Jul-03 10:45 
General&#163; sign in XSL output Pin
autographics4-Jul-03 20:46
autographics4-Jul-03 20:46 
GeneralRe: £ sign in XSL output Pin
Paul Watson6-Jul-03 8:42
sitebuilderPaul Watson6-Jul-03 8:42 
GeneralRe: &#163; sign in XSL output Pin
Philip Fitzsimons7-Jul-03 2:57
Philip Fitzsimons7-Jul-03 2:57 
GeneralXSL Question Please Help Sorry I'm still learning Pin
Gerry Long3-Jul-03 5:47
sussGerry Long3-Jul-03 5:47 
GeneralRe: XSL Question Please Help Sorry I'm still learning Pin
Not Active3-Jul-03 9:58
mentorNot Active3-Jul-03 9:58 
GeneralWeb Service Problem... Pin
Jason Weibel3-Jul-03 5:42
Jason Weibel3-Jul-03 5:42 
GeneralRe: Web Service Problem... Pin
Jason Weibel8-Jul-03 8:39
Jason Weibel8-Jul-03 8:39 
GeneralSearch Xml Pin
jphuphilly3-Jul-03 3:03
jphuphilly3-Jul-03 3:03 
GeneralRe: Search Xml Pin
Not Active3-Jul-03 3:16
mentorNot Active3-Jul-03 3:16 

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.