Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question Regarding Querystring parameters and XSL/XML

 
Michele Smith
Ranch Hand
Posts: 421
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, my XML file needs to include this variable which gets passed on the querystring of my application.

<xsl:variable name="parentId" select="substring-before(substring-after(concat($querystring, '&'), 'parentid='), '&')"/>

My xml needs to say this:

something like this, that does not mention the other numbers, for instance, ALL BUT the numbers: 23, 10, 192, 15, 169,189,230

<xsl:if test="@id="SelectReporting' and not($parentid='2,10,192,15,169,189,230')">
<xsl:attribute name="STYLE">display:none<xsl:attribute>

I KNOW MY CODE IS NOT CORRECT, Wonder what would be inclusive of all integers other than the ones listed above.
 
Paul Clapham
Sheriff
Pie
Posts: 20966
31
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works pretty much like any other programming language; testing to see whether an element is in a list and testing to see if two strings are equal are different operations in all languages that I know.

So not this:


because that tests to see if two strings are equal. Try this instead:


(I leave it to you to extend that to the whole list of magic numbers.

However... if you can get the list of magic numbers into an XSLT nodeset, then you can use the fact that asking if something is "equal to" that nodeset is equivalent to asking if that something is a member of the nodeset.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic