473,654 Members | 3,011 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filename wildcard match

My XML looks like:

<role type="Joker">
<Profile id="13">ABC_Org anization</Profile>
</role>

My XSL looks like:

<xsl:variable name="prefix">p rofile_joker_</xsl:variable>
<xsl:variable name="vid"><xsl :value-of select="Profile/@id"/></xsl:variable>
<xsl:variable name="vname"><x sl:value-of select="Profile "/></xsl:variable>
<xsl:variable name="suffix">. xml</xsl:variable>
<xsl:variable name="tmp1"><xs l:value-of
select="concat( $prefix,$vid)"/></xsl:variable>
<xsl:variable name="tmp2"><xs l:value-of
select="concat( $tmp1,'.')"/></xsl:variable>
<xsl:variable name="tmp3"><xs l:value-of
select="concat( $tmp2,$vname)"/></xsl:variable>
<xsl:variable name="tmp4"><xs l:value-of
select="concat( $tmp3,$suffix)"/></xsl:variable>

<b>Entity: </b><a><xsl:attri bute name="href"><xs l:value-of
select="$tmp4"/></xsl:attribute>
<xsl:value-of select="." /></a><br/>
What I am trying to do is to generate a filename from the element values
(the id Profile attribute and the Profile name) and then create a
hyperlink to that filename. The various files are uniquely identified by
the 'id'. The names of the files look like

profile_joker_< ProfileID>.<Pro fileName>.xml

the problem is that the ProfileName may have aliases so if Bill and
William are aliases then

profile_joker_5 .Bill.xml and profile_joker_5 _William.xml

refer to the same file. However I have only the file
profile_joker_5 .Bill.xml in my directory. So if I try to create a link
to profile_joker_5 _William.xml it fails as there is no such file in the
directory (though the target really exists and is profile_joker_5 _Bill.xml)

I am wondering if there is someway to find the filename in the current
directory which starts with profile_joker_5 and create a hyperlink to
that filename regardless of the profilename (i.e. base the target of the
link only on the ProfileID and make the Profilename a wildcard).

I am not sure how to proceed. Any suggestions will be highly welcome.

Thank you.



Jul 20 '05 #1
1 3427
In article <bo**********@p rometheus.acsu. buffalo.edu>,
Ravi <rg**@cse.buffa lo.edu> wrote:

% <xsl:variable name="tmp1"><xs l:value-of
% select="concat( $prefix,$vid)"/></xsl:variable>
% <xsl:variable name="tmp2"><xs l:value-of
% select="concat( $tmp1,'.')"/></xsl:variable>
% <xsl:variable name="tmp3"><xs l:value-of
% select="concat( $tmp2,$vname)"/></xsl:variable>
% <xsl:variable name="tmp4"><xs l:value-of
% select="concat( $tmp3,$suffix)"/></xsl:variable>

You might be interested to know that concat can more than two
arguments. This could be done as

concat($prefix, $vid, '.', $vname, $suffix)

[...]

% I am wondering if there is someway to find the filename in the current
% directory which starts with profile_joker_5 and create a hyperlink to

Not with pure XSL. Depending on your XSLT processor, you might be
able to create an extension function which sorts it out for you.

My suggestion is to throw out the part of the name that's causing
trouble. i.e., rename the file on the server to profile_joker_5 .xml
before you invoke XSLT. If that's not possible, my other suggestion
is to create links to all the possible names for the file, so you
don't have to deal with it in the XSLT file.

--

Patrick TJ McPhee
East York Canada
pt**@interlog.c om
Jul 20 '05 #2

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

Similar topics

5
7418
by: Robert Brown | last post by:
I have researched newsgroups and the web very thoroughly and unsuccessfully for a solution to what I believe is a very common problem. I know it's easy to do wildcard match against data in DB (using LIKE and "%" and "?"). But is it possible to match a concrete string against a database of wildcarded data? ("%" and LIKE do not work). For example: CREATE TABLE blacklist (
12
10265
by: Niall Porter | last post by:
Right this has to be a Micro$oft mess-up surely...? I'm running SQL 2k standard with SP3. I have a table which I'm trying to query using a LIKE operator on a varchar field as follows .... WHERE dbo.tbl_pm_projects.SeniorManagerID LIKE '%' .... In actual fact the % is passed in by the application when the user
2
13357
by: Dave Smithz | last post by:
Hello there, Summary: How far can you go with SQL Select queries using like clauses with wildcard characters. Can you apply anything like regular expressions? Full details: On a Intranet website, I request a code from a user which is then compared with a code in an ADO access database.
1
7263
by: deko | last post by:
I have a form where users can enter a string with asterisks to perform a wildcard search. Currently, the string entered by the user looks like this: *somestring* The purpose is to match any database field containing "somestring". Is there a way to avoid the need for the asterisks? This would make it easier for the users and also I wouldn't have to explain that asterisks are required when performing a wildcard search.
2
4172
by: deko | last post by:
I'm trying to use a textbox to search and display records as each letter is typed in - similar to the behavior of a combo box. But for some reason I can't seem to get the wildcard search character to work in my query. In the example below, I have several records in tblEntity that begin with "m" and "mi" and one record with the company name "microsoft". I get a match only when I type in the full string "microsoft". Why no match before...
10
37840
by: Hughes | last post by:
Hi, I would like to get the filename from a folder by using C language. For example, in path /Users/abc/Desktop/xyz/ there is a file named "test.s" (file "test.s" is inside folder "xyz"). How should I write a routine in C to get the file name "test.s" ? Thanks a lot.
78
4582
by: wkehowski | last post by:
The python code below generates a cartesian product subject to any logical combination of wildcard exclusions. For example, suppose I want to generate a cartesian product S^n, n>=3, of that excludes '*a*b*' and '*c*d*a*'. See below for details. CHALLENGE: generate an equivalent in ruby, lisp, haskell, ocaml, or in a CAS like maple or mathematica. #------------------------------------------------------------------------------- # Short...
1
1435
by: Bruce Lawson | last post by:
Hi, I am confused about Microsofts description of this Transact SQL reference; (Wildcard - Character(s) to Match. The description says "Matches any single character within the specified range or set that is specified inside the square brackets". For example, in the TransactSQL statement "UPDATE tblUsers SET = stringUserPassword WHERE UserId = 2" , what do the brackets signify about the database record in column Password being updated? ...
11
22322
by: google | last post by:
I need a simple wildcard pattern matching function written in JS. I have wrestled with regular expresions but frankly am struggling to come up with anything less than an epic function of many lines of code ... Any help much appreciated! Sample string : "the cat sat on the mat" matches : "the cat*" , "*cat*" , "*the mat"
0
8375
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8707
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...
1
8482
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5622
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4149
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
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2714
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
1
1916
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1593
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.