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

How do I write an XPath expression to retrieve data for this xml?


How do I write an XPath expression to read the color range node from the following xml file. I.e. where attribute = "All
Red Colors"? The final file will have many more nodes in it.

I realize this is probably very easy but the examples I have seen only indicate how to get a match for red, blueMax etc.

Thanks,

Steve

<?xml version="1.0" encoding="utf-8" ?>
<swatches>
<swatch id="GeneralRgb">
<colors>
<colorRange rangeType="rgb"
red="128"
green="0"
blue="0"
redMin="0"
greenMin="0"
blueMin="0"
redMax="255"
greenMax="0"
blueMax="0">
All Red Colors
</colorRange>
</colors>
</swatch>
</swatches>
Nov 12 '05 #1
2 3706
Have a look here: http://www.w3schools.com/xpath/xpath_syntax.asp

"steve bull" <bu****@comcast.net> wrote in message
news:gr********************************@4ax.com...

How do I write an XPath expression to read the color range node from the
following xml file. I.e. where attribute = "All
Red Colors"? The final file will have many more nodes in it.

I realize this is probably very easy but the examples I have seen only
indicate how to get a match for red, blueMax etc.

Thanks,

Steve

<?xml version="1.0" encoding="utf-8" ?>
<swatches>
<swatch id="GeneralRgb">
<colors>
<colorRange rangeType="rgb"
red="128"
green="0"
blue="0"
redMin="0"
greenMin="0"
blueMin="0"
redMax="255"
greenMax="0"
blueMax="0">
All Red Colors
</colorRange>
</colors>
</swatch>
</swatches>

Nov 12 '05 #2

thanks. got it now.

Steve
On Tue, 14 Jun 2005 00:56:28 +0200, "Claus Konrad" <no@spam.thanks> wrote:
Have a look here: http://www.w3schools.com/xpath/xpath_syntax.asp

"steve bull" <bu****@comcast.net> wrote in message
news:gr********************************@4ax.com.. .

How do I write an XPath expression to read the color range node from the
following xml file. I.e. where attribute = "All
Red Colors"? The final file will have many more nodes in it.

I realize this is probably very easy but the examples I have seen only
indicate how to get a match for red, blueMax etc.

Thanks,

Steve

<?xml version="1.0" encoding="utf-8" ?>
<swatches>
<swatch id="GeneralRgb">
<colors>
<colorRange rangeType="rgb"
red="128"
green="0"
blue="0"
redMin="0"
greenMin="0"
blueMin="0"
redMax="255"
greenMax="0"
blueMax="0">
All Red Colors
</colorRange>
</colors>
</swatch>
</swatches>


Nov 12 '05 #3

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

Similar topics

4
by: Xenia | last post by:
Hello! Is anyone can help me to figure out how to write some xml into huge xml file into speceific location??? Say, i have a file about 139 Mb and i need to write some data (xml) into it, but...
14
by: inquirydog | last post by:
Hi- One frusterating thing for me with xsl is that I don't know how to make xslt throw some sort of exception when a value-of path does not exist. For instance, suppose I have the following...
2
by: Steve Jorgensen | last post by:
Working with the DOM (specifically, the MSXML DOM), I'm wondering if there's an efficient way to check whether it would be matched by a given XPath expression. I've made it work to just run the...
1
by: rustyfancy | last post by:
I have a textBox that contains a string values. I need to take this string and use it as criteria for an XPath Expression. Here's what I have. Why isn't it working??? string s =...
6
by: Chua Wen Ching | last post by:
Hi there, I had this xml file with me (not yet consider implementing xml namespaces yet). <?xml version='1.0'?> <Object> <Windows> <EID>1</EID> <EDesc>Error 1</EDesc> </Windows>
4
by: syed.akhlaq | last post by:
Hi, Does anyone know how can I validate XPath expressions using xsd schema? Thanks
2
by: Werner Sammer | last post by:
I would like to load an XML document from say D:\mytask\mydoc.xml into a CSharp and to retrieve from the resulting XML node tree a certain node/element by specifing an XPath expression. Does...
2
by: A. W. Dunstan | last post by:
I'm trying to figure out how XPath expressions work, and how I can use them to extract data into a particular format. I can extract the data I want using an XPath expression, but not with an XSLT...
6
by: Phantom | last post by:
I totally need the help of the XML experts up here, I can't figure this one out, I've been working on it for hours today, googling my brains out. I need to write an xpath query string that...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
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...

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.