Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to access XSL Vaiable in c#? Pin
Abubakarsb22-Feb-07 4:51
Abubakarsb22-Feb-07 4:51 
GeneralRe: How to access XSL Vaiable in c#? Pin
Pete O'Hanlon22-Feb-07 5:05
mvePete O'Hanlon22-Feb-07 5:05 
GeneralRe: How to access XSL Vaiable in c#? Pin
Abubakarsb22-Feb-07 10:21
Abubakarsb22-Feb-07 10:21 
GeneralRe: How to access XSL Vaiable in c#? Pin
Pete O'Hanlon22-Feb-07 22:41
mvePete O'Hanlon22-Feb-07 22:41 
GeneralRe: How to access XSL Vaiable in c#? Pin
Abubakarsb22-Feb-07 23:53
Abubakarsb22-Feb-07 23:53 
GeneralRe: How to access XSL Vaiable in c#? Pin
Pete O'Hanlon23-Feb-07 0:23
mvePete O'Hanlon23-Feb-07 0:23 
GeneralRe: How to access XSL Vaiable in c#? Pin
Abubakarsb23-Feb-07 2:35
Abubakarsb23-Feb-07 2:35 
GeneralRe: How to access XSL Vaiable in c#? Pin
Pete O'Hanlon23-Feb-07 4:01
mvePete O'Hanlon23-Feb-07 4:01 
What is setting $subtitle?

You have an XML document which you are processing the xslt against, then you can apply the XPath query that is in the select statement against the xml, passing in the relevant item for $subtitle. This is the quickest and easiest way to get the value out. I already intimated that the XPath would be a better approach for this problem.

The following XPath solves your problem:

private int GetValue(string xmlFile, string title)
{
  XPathDocument doc = new XPathDocument(xmlFile);
  XPathNavigator nav = doc.CreateNavigator();
  XPathExpression expr = nav.Compile(string.Format(
    "ceiling(count(//Category[Title='{0}']/Category1/MetaData))", title);
  object obj = nav.Evaluate(expr);
  int output = 0;
  if (obj != null)
  {
    output = Convert.ToInt32(obj);
  }
  return output;
}



the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer

Deja View - the feeling that you've seen this post before.

GeneralRe: How to access XSL Vaiable in c#? Pin
Pete O'Hanlon26-Feb-07 4:47
mvePete O'Hanlon26-Feb-07 4:47 
GeneralRe: How to access XSL Vaiable in c#? Pin
Abubakarsb26-Feb-07 21:24
Abubakarsb26-Feb-07 21:24 
GeneralRe: How to access XSL Vaiable in c#? Pin
Abubakarsb28-Feb-07 10:13
Abubakarsb28-Feb-07 10:13 
GeneralRe: How to access XSL Vaiable in c#? Pin
Pete O'Hanlon28-Feb-07 10:52
mvePete O'Hanlon28-Feb-07 10:52 
GeneralRe: How to access XSL Vaiable in c#? Pin
Abubakarsb1-Mar-07 2:08
Abubakarsb1-Mar-07 2:08 
GeneralRe: How to access XSL Vaiable in c#? Pin
Pete O'Hanlon1-Mar-07 2:56
mvePete O'Hanlon1-Mar-07 2:56 
GeneralRe: How to access XSL Vaiable in c#? Pin
Abubakarsb1-Mar-07 3:09
Abubakarsb1-Mar-07 3:09 
GeneralRe: How to access XSL Vaiable in c#? Pin
Pete O'Hanlon1-Mar-07 4:01
mvePete O'Hanlon1-Mar-07 4:01 
GeneralRe: How to access XSL Vaiable in c#? Pin
Abubakarsb1-Mar-07 4:14
Abubakarsb1-Mar-07 4:14 
GeneralRe: How to access XSL Vaiable in c#? Pin
Abubakarsb4-Mar-07 9:49
Abubakarsb4-Mar-07 9:49 
GeneralRe: How to access XSL Vaiable in c#? Pin
Pete O'Hanlon8-Mar-07 2:31
mvePete O'Hanlon8-Mar-07 2:31 
GeneralRe: How to access XSL Vaiable in c#? Pin
Abubakarsb8-Mar-07 9:53
Abubakarsb8-Mar-07 9:53 
Questionwaveform generator compnenet needed! Plz help Pin
pashitech22-Feb-07 3:43
pashitech22-Feb-07 3:43 
AnswerRe: waveform generator compnenet needed! Plz help Pin
Pete O'Hanlon22-Feb-07 4:48
mvePete O'Hanlon22-Feb-07 4:48 
GeneralRe: waveform generator compnenet needed! Plz help Pin
pashitech22-Feb-07 19:40
pashitech22-Feb-07 19:40 
GeneralRe: waveform generator compnenet needed! Plz help Pin
Pete O'Hanlon22-Feb-07 22:38
mvePete O'Hanlon22-Feb-07 22:38 
GeneralRe: waveform generator compnenet needed! Plz help Pin
pashitech23-Feb-07 5:38
pashitech23-Feb-07 5:38 

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.