Hi I am looking for help with an xsl transform of an xml file. The problem is with <xsl:with-param>.

The following is what I have:

<xsl:param name="paramTest">$LINKNUM$</xsl:param>

<key name="$LINKNUM$">SELECT count(1) from applications</key>

<xsl:choose>
      <xsl:when test="$paramTest = '0' ">
            do this........
      </xsl:when>

      <xsl:otherwise>
            do this.........
      </xsl:otherwise>
</xsl:choose>

This select count returns 0 which is what I want but it never actually goes into the xsl:when part, it always falls into xsl:otherwise. Don't worry about the order of the tags etc I've just cut them out of the file

Recommended Answers

All 9 Replies

okey first thing first..

is that query is working..cos we guys use FOR XML AUTO

have u checked the query on live server / Testing server you have..?

i understood what exactly u require but i need to have look at ur aspx page & code behind page code...

there are many ways to transform your xsl code...i need to know wot is approach..?

may be i can help...

Yeh the statement works correctly against the database. My code behind is in C# and it uses the folllowing to transform it:

XslTransform transform = new XslTransform();

transform.Load(dir + @"\" + GetConfig("xsltDir",strTransformFileName));

XPathDocument xpathDoc = new XPathDocument(transform.Transform(xmlDocument, null));
SELECT count(1) from applications

this is database query...i don;t think u can write direct query in the xsl file...

well as far as i've learned ....all i know is query get fired from C#..

we store XML output and then we create xsl file and do processing like loading a data..

but in u r case...u r trying to write query directly in the xsl file...

which is i'm very sure....don;t make sense...

or is there anything else u have in u r mind...

please let me know...!

Sorry I should have mentioned, the SQL parts are evaluated in the C# code, so it just gets passed as values rather than select statements..

okey great..

now when you run that query you get the xml response...

can i have a look at the output...

i think i'm very close to u r solution...

your output would be something like...

<user_information>5</user_information>

if yes then hit me back....

now in ur xsl file use....count(user_information)

it will work..

if it does not work then send me your code...

may be i can fix it...

dude if problem is resolved then mark it as solved....;)

dude if problem is resolved then mark it as solved....;)

thnx for resolving..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.