Solved

Read Childobject and specific ID - Xpath Command

Posted on 2013-01-15
2
342 Views
Last Modified: 2013-01-15
Hi Experts,

i'am reading with Xpath the attached XML File:

with this command i get all 3 ID's
//ChildObjects/ObjectType/ObjectList/Object/@*

Open in new window

This is the result:
id="1800"
id="2657"
id="2658"

I'am looking for a command with this result: id="1800".
As second i need a command with this result: id="2657" | id="2658" as resultset.

Do you have any ideas?
xpath.xml
0
Comment
Question by:bounty457
2 Comments
 
LVL 18

Accepted Solution

by:
zc2 earned 500 total points
ID: 38779196
That depends what exactly you want to achieve...

For an instance, this one
//Object[@id="124239"]/ChildObjects/ObjectType/ObjectList/Object/@*
givesyou 1800, and this one
//Object[@id="1800"]/ChildObjects/ObjectType/ObjectList/Object/@*
gives you 2657 and 2658
But there could be many more options.
0
 
LVL 1

Author Comment

by:bounty457
ID: 38779358
Thank you very much for the answer.

Clear, i overlooked the startingpoint:

//Archive/ObjectType/ObjectList/Object/@   ==> id="124239"

And now i get the following fields.


regards Bounty
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
jQuery or Javascript animation question 6 57
I starting with php 12 94
Examples of Web API, REST web services and SOA 7 119
Create XML 5 34
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now