trenttorkelson | 21 Aug 2008 22:19
Picon

selecting 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[ <at> Dept='Site Support' and
not( <at> Category1=preceding::Item/ <at> Category1)]/ <at> 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[ <at> Dept='Blackberry' and
(Continue reading)

trenttorkelson | 23 Aug 2008 15:48
Picon

Re: selecting issue


i already fixed this in a question to expert-exchange:

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

trenttorkelson wrote:
> 
> 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[ <at> Dept='Site Support' and
> not( <at> Category1=preceding::Item/ <at> Category1)]/ <at> 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
(Continue reading)


Gmane