Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with creating an XPath

Status
Not open for further replies.

tperri

Programmer
Apr 8, 2006
728
US
Here is my XML file

Code:
<?xml version="1.0" encoding="utf-8" ?>
<Settings>
	<Hotels>
		<Hotel ID="1" Name="Hotel1" WingType="V"/>
		<Hotel ID="2" Name="Hotel2" WingType="P"/>
	</Hotels>
	<ColorSchemes>
		<Scheme ID="1" HotelID="1" Weekday="true">
			<Color>#DOA256</Color>
		</Scheme>
		<Scheme ID="2" HotelID="1" Weekday="true">
			<Color>#FF9933</Color>
		</Scheme>
		<Scheme ID="3" HotelID="1" Weekend="true">
			<Color>#FFCC99</Color>
		</Scheme>
		<Scheme ID="4" HotelID="1" Weekend="true">
			<Color>#CC6600</Color>
		</Scheme>
	</ColorSchemes>
</Settings>

I need help figuring out how to pick the <Color> when Scheme HotelId=1 and Weekday=true. I can only find sample for checking one attribute. Any help is greatly appreciated!

Thanks!
 
Heres an example for checking two attributes:
Code:
/Settings/Hotels/ColorSchemes/Scheme[@HotelID='1' and @Weekday='true']/Color

Tom Morrison
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top