This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Question Regarding Querystring parameters and XSL/XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Question Regarding Querystring parameters and XSL/XML" Watch "Question Regarding Querystring parameters and XSL/XML" New topic

Question Regarding Querystring parameters and XSL/XML

Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
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

Joined: Oct 14, 2005
Posts: 19350

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.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Question Regarding Querystring parameters and XSL/XML