473,769 Members | 6,208 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Text search using parameter

I just started looking at XSLT, so bare with me if I totally
misunderstood this.

I am passing a value to the xslt that i want to use to search in some
nodes. I have the following code for this (note the query parameter):

<?xml version='1.0'?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:output
media-type="text/xml"
method="html"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"
encoding="UTF-8"/>

<xsl:param name="query"/>

<xsl:template match="/">
<html>
<head>
<title>Search results</title>
</head>

<body>
<h1>Found <xsl:value-of
select="count(/airports/airport/country_name[starts-with(.,$query)])"/>
countries</h1>
</body>
</html>
</xsl:template>

</xsl:stylesheet>

Issue is that this doesn't work. If i "hardcode" a string it works. Do
I need to convert it to a string first?

Thank you for your help

Jul 20 '05 #1
2 1170


jo********@gmai l.com wrote:

<xsl:param name="query"/> <h1>Found <xsl:value-of
select="count(/airports/airport/country_name[starts-with(.,$query)])"/>
countries</h1> Issue is that this doesn't work. If i "hardcode" a string it works. Do
I need to convert it to a string first?


How an external parameter value is passed to an XSLT processor is highly
processor dependent so your "it doesn't work" experience can have many
reasons, you will need to tell us which processor you use, how you use
it (e.g. command line or perhaps from a certain programming language),
how you try to set the parameter. Of course if it is processor specific
it might be easier to find someone with experience on that topic on a
processor specific mailing list.
And what "doesn't work" mean exactly, does the stylesheet show "Found 0
countries", does the processor give an error?

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
Yes, i got 0 hits. And I just realized why. I was not thinking about
the case-sensivity in my search query...

Sorry for have wasted your time, but thanks for taking the time to
answer me.

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
3063
by: Mark | last post by:
I have a website with an increasing amount of articles and news reports and so I am thinking of moving away from storing each article as a seperate page to having a single page and storing articles in a databasewhich are retrieved using a GET parameter. I see the advantage to me in using this approach as being making use of MySQL's fulltext search capability and less work needed when updating the design of the page. I'm not sure of a few...
5
8594
by: adrian | last post by:
hi all this is my first post to this group, so pls bear with me while i try to make some sense. i am trying to create a sproc which uses dynamic sql to target a particuar table eg. '.' and perform some actions. i am using @tableID as a passes parameter for the sproc.
5
9930
by: Amit | last post by:
I am facing a problem while using SQL Server with VB application. Implicit conversion from datatype text to nvarchar is not allowed. Use the convert function to run this query. When i see the trace file, i see one stored procedure called but no lines of code get executed, and immediately after that the ROLLBACK TRANSACTION occurs and the applications fails. But to my surprise i am able to do the same thing on a different
2
2686
by: charlie_M | last post by:
I have the following code: <script type=text/javascript> function hide_tooltip(){ var hp = document.getElementById("tooltipper"); hp.style.left=0; hp.style.top=0; hp.style.width=1; hp.style.height=1; hp.style.padding=0;
2
2961
by: Zeya | last post by:
I have an application where I am required to run a full text query. My database is MySQL and code in C#. The way all queries are SELECT * FROM table WHERE firstname = ? and using command parameter the value of ? is added. But, how would I do the same in case of full text search. SELECT *, ROUND( MATCH(title, comments) AGAINST (? IN BOOLEAN MODE ) * 10, 2 ) AS score FROM table WHERE MATCH(title,comments) AGAINST (? IN
10
3202
by: Michael B. Trausch | last post by:
Alright... I am attempting to find a way to parse ANSI text from a telnet application. However, I am experiencing a bit of trouble. What I want to do is have all ANSI sequences _removed_ from the output, save for those that manage color codes or text presentation (in short, the ones that are ESChttp://fd0man.theunixplace.com/Tmud.tar which contains the code in question. In short, the information is coming in over a TCP/IP socket that...
0
2070
by: Savvas | last post by:
Hi, I am using VB.Net 2005 for a windows application. The application was actually upgraded from vb.net 2003. I have a search field which is used as a parameter to search all datagrid columns. According to this parameter, the dataset and datagrid shows only the columns where the search parameter applies. The code is
12
13274
by: vbnewbie | last post by:
I am having problems accessing properties of dynamically generated objects in VB2005. Can someone please help? In a nutshell: My app creates an equal number of checkboxes and labels that share the same Tag number. (I thought it might help) The checkboxes name is a concatenation of "chkCancel" and a number that represents the order in which they were created: chkCancel0 (Tag = 0) chkCancel1 (Tag = 1)
6
4666
by: shantanu | last post by:
Hi All, I have a requirement to develop a search engine based on some search criteria that will search for the string or statement in all the documents uploaded in the website. The search result will be displayed same as the Google Group search, with highlighted texts. I have few questions: 1. What will be the logic to implement? 2. The documents that will be uploaded in the website will be saved in the datbase or not?
0
10211
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9863
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8870
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5298
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3958
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3561
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.