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

complex XPath help need Urgent help

I have XML Data:
<REQUEST>
<PARAMETERS>
<PPM Name="CCCS Filed Date" value="xxxx"></PPM>
</PARAMETERS>

<RECORD _FiledDate="12/15/2003"></RECORD>

</REQUEST>

I want to get data from @value {"xxxx"} if exist, otherwise get value
from @_FiledDate.

Please help me...
Nov 28 '07 #1
2 1754
Amar wrote:
I have XML Data:
<REQUEST>
<PARAMETERS>
<PPM Name="CCCS Filed Date" value="xxxx"></PPM>
</PARAMETERS>

<RECORD _FiledDate="12/15/2003"></RECORD>

</REQUEST>

I want to get data from @value {"xxxx"} if exist, otherwise get value
from @_FiledDate.
With XPath 2.0 you can do
if (/REQUEST/PARAMETERS/PPM/@value) then
/REQUEST/PARAMETERS/PPM/@value else /REQUEST/RECORD/@_FiledDate

With XPath 1.0 (and 2.0 of course) you can do
/REQUEST/PARAMETERS/PPM[@value]/@value |
/REQUEST[PARAMETERS/PPM[not(@value)]]/RECORD/@_FiledDate

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 29 '07 #2
... but the | works in XPath 1.

-- Richard
ah yes I had it in mind that it was an xpath2 thread but looking back I
see that's not really justified.

--
http://dpcarlisle.blogspot.com
Nov 30 '07 #3

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

Similar topics

0
by: Marc te Vruchte | last post by:
Over the past years i've been in contact with the same problem a number of times, creating a graphical user interface on complex XML documents. Personally these solutions have never been...
3
by: Pir8 | last post by:
I have a complex xml file, which contains stories within a magazine. The structure of the xml file is as follows: <?xml version="1.0" encoding="ISO-8859-1" ?> <magazine> <story>...
0
by: peterpeter | last post by:
Hi. There is a XML schema problem that I have with key/keyref: I have a complex type "AExtended" which inherits from a base type "ABase". Both are allowed to be instantiated under the "Root"...
4
by: tirumalab | last post by:
if i enter the value in my textbox(edit_mobileno) i want to search for the matching and i want to read all the xmlelements in that perticular<customer></customer> tag... see below for myxml...
0
by: ajayvaram | last post by:
Hi all, Im working with VB6.0 and XML here I need some Xpath Queries Example XML: <data> ... - <Account Id="01SBI" Type="A" Location="Hyd"> ----- <Content Source="Employee"...
0
by: ajayvaram | last post by:
Hi , Im working with VB6.0 and XML here I need some Xpath Queries Example XML: <data> ... - <Account Id="01SBI" Type="A" Location="Hyd"> ----- <Content Source="Employee" scaleBasis="Fixed"/>...
2
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Have a complex process where I need to Import a large amount of data then run some transformations on this data then import into DataBase. The transformation involves multiple fields and multiple...
5
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi I have a Container that is an an Array List of Class Each ArrayList element can be the class or a another ArrayList of Class So there the ArrayList could look like Element 1 - Class...
1
by: markla | last post by:
Hi, Can someone help me understand why for the code below, when added as a "FieldTemplate" in Dynamic Data, and rendered for a field, does not trigger the "test" function and hence update the...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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...
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...

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.