473,407 Members | 2,598 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,407 software developers and data experts.

selection issue

this is my xml:

</ROOT>
<Item Segment="COMFIN" Dept="Blackberry" Category1="Active Directory" Category2="Password Reset" Code="Reset" />
<Item Segment="GEHC" Dept="Remote Support" Category1="Hardware" Category2="Cable" Code="Replace" />
<Item Segment="Plastics" Dept="Blackberry" Category1="Software" Category2="Casing" Code="Install" />
<Item Segment="Plastics" Dept="Remote Support" Category1="Hardware" Category2="Casing" Code="Repair" />
<Item Segment="Plastics" Dept="Site Support" Category1="Hardware" Category2="Parts &amp; Vendor 5.0" Code="Replace" />
</ROOT>

this is my query:

"/ROOT/Item[@Dept='Site Support' and not(@Category1=preceding::Item/@Category1)]/@Category1"
returns nothing

for those of you that it isn't plain to see, i'm attempting to select all Item nodes that have a attrib of Dept/with value of Site Support, and also, the preceding nodes must not have duplicate category1 values.
then the query gets the category1 attribute nodes from the Item nodes.

This does not work correctly on this expression, but it does here:

"/ROOT/Item[@Dept='Blackberry' and not(@Category1=preceding::Item/@Category1)]/@Category1"
returns active directory, and software

my assumption is that the reason that i get no results on the first query is that there is only one dept attribute with the site support value, and because of the way that i've formatted my query string, it removes the nodes that it finds in the first expression when it test's the second expression. that's my guess though..

any help? please?
Aug 21 '08 #1
2 1184
Dormilich
8,658 Expert Mod 8TB
As I understand it you want to select:
<item dept="site support" category1=".." ...> where 'category1' is not the same as in the preceding item?

if yes, there's no result in your example xml (you have only one item with 'site support' but the category1 attributes are equal, therefore no match)
Aug 22 '08 #2
got help with the issue here:

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/XML/XPath/Q_23668679.html

works now..
Aug 23 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: rikesh | last post by:
Hi I'm sure this is a very trivial problem! I have a combo bound to a recordset. I was wondering how I can show the value on the page, what the user has selected? The code that I'm using is...
2
by: Mark Szlazak | last post by:
The following code fails in Firefox to get at selected text in the right-side textarea. Any help would be appreciated. <html> <head> <script> var agt = navigator.userAgent.toLowerCase();...
5
by: Jim Cobban | last post by:
I am trying to create a web page in which the contents of one selection list depends upon which element in another selection list is chosen, but where the information to populate the first...
7
by: damjanu | last post by:
Hi All; I need little help. I have a datasheet form. I allow user to do 'filter by selection'. My form contains a column with values. As user changes selections, I want to calculate totals....
1
by: Tom G | last post by:
Hello, I need some advice on which way to resolve the following. On a form, the user will make a selection from a combo box, after the selection several different fields need to be updated on...
10
by: Carlos | last post by:
Hi all, I have a form with an input radio control in a template field. When the user selects an option, and press a button the selection disappears.. I would like the selection to persist after...
4
by: HKS | last post by:
Hi everybody I have a javascript to select and deselect items in a listbox depending on checkbox selection The problem now i have is, i am calling the javascript from server side What...
5
by: Jure Bogataj | last post by:
Hi all! I have a problem (performance issue) with listview. I have implemented an ItemSelectionChange on my listview and put some code in it (I build some toolbar based on selection and update...
1
by: HarishAdea | last post by:
Hi, I am trying to run the JAVA pgm, but it is giving error as "selection does not contain a main type". The filename is "ScoreLeadSummary.java" when i try to run it or debug,it gives the pop...
2
by: vanditnagar | last post by:
Hi, I am facing the difficulty in the selecting a text on the browser . And highlighting the text. I am using the window.getSelection() to get the object and after...
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: 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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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
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,...
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...

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.