473,396 Members | 1,918 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,396 software developers and data experts.

Querying attributes

Is it possible to have a XPath query that returns all elements where any of
its attributes begins with the specified string?

TIA,

Richard Rosenheim
Nov 12 '05 #1
2 1420
"Richard L Rosenheim" <ri*****@rlr.com> wrote in message news:uM**************@TK2MSFTNGP09.phx.gbl...
Is it possible to have a XPath query that returns all elements where any of
its attributes begins with the specified string?


//@*[starts-with(local-name(),'yourString']/..

This gets all attributes, filters them down to only those that have a local name
starting with the text "yourString" (matches attributes named yourStringAttr,
yourString, but does not match attributes named your or myString), and then
walks back up to the parent element(s) using ".." at the end.
Derek Harmon
Nov 12 '05 #2
Thanks.

Richard Rosenheim
"Derek Harmon" <lo*******@msn.com> wrote in message
news:Os**************@TK2MSFTNGP11.phx.gbl...
"Richard L Rosenheim" <ri*****@rlr.com> wrote in message news:uM**************@TK2MSFTNGP09.phx.gbl...
Is it possible to have a XPath query that returns all elements where any of its attributes begins with the specified string?


//@*[starts-with(local-name(),'yourString']/..

This gets all attributes, filters them down to only those that have a

local name starting with the text "yourString" (matches attributes named yourStringAttr, yourString, but does not match attributes named your or myString), and then walks back up to the parent element(s) using ".." at the end.
Derek Harmon

Nov 12 '05 #3

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

Similar topics

3
by: C. Hughes | last post by:
I have a simple application that uses an XML file to store it's data. That means I don't have a seperate database. In order to read the data I created a DataSet that reads my XML file with the...
6
by: Greg | last post by:
I am working on a project that will have about 500,000 records in an XML document. This document will need to be queried with XPath, and records will need to be updated. I was thinking about...
5
by: Shane | last post by:
I wonder if someone has any ideas about the following. I am currently producing some reports for a manufacturing company who work with metal. A finished part can contain multiple sub-parts to...
1
by: KK | last post by:
Hi, I apply a custom Attribute to several properties in a class. There are about 15 of those. I want to know how I can programatically get ONLY those properties that I have applied my...
3
by: Mikolaj Machowski | last post by:
Hello, I am looking for tool to query Schema/RNG files to find: - all elements of current dialect - allowed children of given element - allowed attributes of given element - values of that...
3
by: Lisa C. | last post by:
I'm using Visual Web Developer 2005 Express Edition with SQL Express and I'm a beginner. I'm developing pages for my churches website which allow users to select attributes for a class (e.g....
4
by: Nestor01 | last post by:
Is there a way to determine whether another record has been pulled up in a form in edit mode PRIOR to allowing that record to be used/opened in the same form? I've described a similar question about...
2
by: RajSharma | last post by:
Hi, I am facing a problem regarding querying thru a large table having millions of rows....... Its hanging in between while querying for all those rows Can anybody suggest me a query regarding :...
8
by: Sven | last post by:
Dear all, I'm trying to extract data from HTML using XPath in Java. Unfortunately the text contents of nodes may contain <br/tags which are not correctly interpreted, at least not for me ;) A...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
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,...

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.