473,382 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

DOM XPath pattern matching

I have an XML document that has this structure:

<applications>
<application>
<app_name>ABC</app_name>
</application>
<application>
<app_name>DEF</app_name>
</application>
</applications>

I'm wondering if there's a way using XPath and some pattern to find
case *insensitive* matches for a particular app_name??

For example, if I have app_name 'ABC' and I want to determine if there
are any existing nodes that have app_names like 'ABC', or 'Abc', or
'abc', or 'aBC', etc. Is there some version of 'selectSingleNode' with
a pattern that can do that? AFAICT there aren't any case
(in)sensitivity functions in XSL or XPath.

TIA.

Hardy Merrill
Jul 20 '05 #1
1 2112


Hardy Merrill wrote:
I have an XML document that has this structure:

<applications>
<application>
<app_name>ABC</app_name>
</application>
<application>
<app_name>DEF</app_name>
</application>
</applications>

I'm wondering if there's a way using XPath and some pattern to find
case *insensitive* matches for a particular app_name??

For example, if I have app_name 'ABC' and I want to determine if there
are any existing nodes that have app_names like 'ABC', or 'Abc', or
'abc', or 'aBC', etc. Is there some version of 'selectSingleNode' with
a pattern that can do that? AFAICT there aren't any case
(in)sensitivity functions in XSL or XPath.

Use translate(element, 'ABCDEDFHIJKLMNOPQRESTUFWXYZ',
'abcdefghijklmnopqrestuvwxyz')
e.g.

/applications/application['abc' = translate(app_name, 'ABC', 'abc')]
--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

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

Similar topics

1
by: bdinmstig | last post by:
I refined my attempt a little further, and the following code does seem to work, however it has 2 major problems: 1. Very limited support for XPath features Basic paths are supported for...
176
by: Thomas Reichelt | last post by:
Moin, short question: is there any language combining the syntax, flexibility and great programming experience of Python with static typing? Is there a project to add static typing to Python? ...
9
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # Matching string patterns # # Sometimes you want to know if a string is of # particular pattern. Let's say in your website # you have converted all images...
2
by: ahogue at theory dot lcs dot mit dot edu | last post by:
Hello - Is there any way to match complex subtree patterns with XPath? The functions I see all seem to match along a single path from root to leaf. I would like to match full subtrees. For...
1
by: Xuejun Li \(SH/RDC\) | last post by:
Hi, How do I select a value that starts with a certain prefix? For example I want all <author> elements that contain a <last-name> element with a value that begins with the letter Mi. Will this...
1
by: malc | last post by:
How do I do pattern matching with xpath? Say I want to match <b> It is cold <b/> I have tried match="htm:b[contains(text(),'is') But it doesn't seem to work. Can anyone help?
5
by: olaufr | last post by:
Hi, I'd need to perform simple pattern matching within a string using a list of possible patterns. For example, I want to know if the substring starting at position n matches any of the string I...
4
by: duduch_1er | last post by:
Hello i tried this code in my stylesheet : xsl:variable name="items" select="xsl-usexsl:getElementsBySplitString(.,'i')" /> whith the java function getElementsBySplitString here the code : ...
3
by: werD | last post by:
Hello I have an xml document that im currently using a forward only .net repeater on and using some xpath queries to display the data The xml is quite simple <?xml version="1.0"...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.