Cannot get attributes from different child elements...

Hi,
I have an Xpath expression which happily gives me all the 'element' elements when I put in the the step variable(1, 2 or 3), see below....
"/remove[@step < "+step+"]/element"
<remove step="1">
     <element path="epg.schedule.programme.longName" />
     <element path="epg.schedule.scope" />
</remove>
<remove step="2">
     <element path="epg.schedule.programme.mediaDescription" />
</remove>
<remove step="3">
     <element path="epg.schedule.programme.genre" />
     <element path="epg.schedule.programme.memberOf" />
     <element path="epg.schedule.programme" />
</remove>
But when I ask for each elements attribute 'path' it only every returns the paths for step 1...
"/remove[@step="+step+"]/element/@path"
Any ideas greatly appreciated.
Thanks.
Paul.

If the xpath expression
"/remove[@step["+step+"]/element/@path"is selected with a selectSingleNode method the first <element/> in the <remove/> element gets selected.
If the xpath expression is selected with with selectNodes method a node list of elements is returned.
To select an element specify the xpath expression:
"/remove[@step[3]/element[1]/@path"seelcts the path attribute for the first element in the third remove element

Similar Messages

  • Xpath: get attributes from first child node

    Hi,
    I have some problems by getting the attributes from the first child node, if i try to get child elements everything works fine, but whenever i need the elementvalue from a node with attributes i doesn't return anything.
    The xpath expression works fine if i want to get the element value from all childs, but not when i just want from one of them.
    This one works,
    XPathFactory factory1 = XPathFactory.newInstance();
        XPath xpath = factory1.newXPath();
        xpath.setNamespaceContext(new PersonalNamespaceContext());
        XPathExpression expr
         = xpath.compile("//default:DeviceExchange[1]/default:Status/text()");
       // gets the value of the node picked out
        Object result = expr.evaluate(doc, XPathConstants.NODESET);
        NodeList nodes = (NodeList) result;
        for (int i = 0; i < nodes.getLength(); i++) {
          names[i] = nodes.item(i).getNodeValue();
          String a = names;
    // checks if status is exchanged, if it is sets status to 1
    if (a.length() == 9){
    names[i] = "1"; }
    else{  names[i] = "0";}
    System.out.println(names[i]);This doesn'tXPathFactory factory2 = XPathFactory.newInstance();
    XPath xpath2 = factory2.newXPath();
    xpath2.setNamespaceContext(new PersonalNamespaceContext());
    XPathExpression expr2 = xpath2.compile("//default:DeviceExchange[1]/default:Field[@names='MLPKTID']/text()");
    Object result2 = expr2.evaluate(doc, XPathConstants.NODESET);
    NodeList nodes2 = (NodeList) result2;
    for (int i = 0; i < nodes2.getLength(); i++) {
    names2[i] = nodes2.item(i).getNodeValue();
    System.out.println(names2[i]);}Does anyone have any ideas? I will apreciate all help!
    Edited by: fusen on Oct 25, 2007 1:12 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Sorry, solved myself. Just � typo that that i couldn't detect.

  • XML element,if not including any attributes and/or child elements then

    XML element in SQLX,if not including any attributes and/or child elements then the tag should not appear, how to achive this?
    ex:Consider for <enumeration> tag where it is having some value.
    <attribute>
    <name>Ethernet Access</name>
    <enumeration>
    <StringValue>Bandwidth</StringValue>
    </enumeration>
    </attribute>
    When <enumeration> tag is not have any Value in this, then output should be as follows.
    <attribute>
    <name>Ethernet Access</name>
    </attribute>
    But what i am getting is
    <attribute>
    <name>Ethernet Access</name>
    </enumeration>
    </attribute>
    Please suggest me the solution for this.
    I tried , but when xmlelement() is not having data it will display empty tag ie </enumeration>, If xmlforest() are null it wont show tag, But i have to use xmlelement only. how can that be achived using xmlelement .

    Use a SQL case - when - else end construct to only execute the xmlelement if data is present. The SQL/XML standard is very clear, xmlElement will generate an empty element if no data is present. xmlforest will not.

  • I cannot get images to download to elements 9.

    I cannot get images to download with Elements 9 (Windows) the past two days.  I have degfragmented the computer 2X and downloaded Elements 9 2X...  Still will not download,  However, organizer opens as normal...

    From a storage card...  Have done this many times in the past...
    Date: Mon, 25 Mar 2013 12:53:48 -0700
    From: [email protected]
    To: [email protected]
    Subject: I cannot get images to download to elements 9.
        Re: I cannot get images to download to elements 9.
        created by 99jon in Photoshop Elements - View the full discussion
    Are you attempting to download from camera or storage card? Try copying the files to your hard drive and then use the Organizer menu: File >> Get Photos & Videos >> from Files & Folders
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5177741#5177741
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5177741#5177741
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5177741#5177741. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Photoshop Elements by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How to use attributes from different context nodes in one view?

    I am VERY new to the concept of CRM and currently working on creating an alternate version of the BP_HEAD_SEARCH. With help from SAPPRESSs book 'SAP CRM Web Client' i was ble to create my own simple Z-component.
    However after going back and forth the book and the forum (including this [article|https://wiki.sdn.sap.com/wiki/display/CRM/Howtoaddanexistingfieldtoasearchpageofadifferent+component]) i was not able to find a solution to my problem. My current search uses BuilHeaderAdvancedSearch as context node for searching. But the search should also be able to use attributes from BuilActivity, which is directly related to BuilHeader. I can't seem to find a way to get attributes from BuilActivity into the search window of my component without having to change SAP-Standard.
    Is this really the only way? Please advise on possible code and insertion point.

    Any suggestions?

  • I have installed Mountain Lion 10.8.2 but still cannot get email from my work exchange account. I'd appreciate any help.  Thank you.

    I have installed Mountain Lion 10.8.2 but still cannot get email from my work exchange account. I'd appreciate any help.  Thank you.

    You can go to the Apple online store and purcahse a copy of Mountain Lion.  This will give you a redemption code, which you can use to download Mountain Lion from the App Store.  Unfortuantely, I'm not aware of any other way to legally purchase it.  I have never seen Apple release Muontain Lion on DVD.
    In terms of Apple Service, they just need the serial number of the machine to check the purcahse date.  It is usually correct, to within a few weeks.  A quick Google search should give you the correct number to dial.
    I hope this helps.

  • I have installed Mountain Lion 10.8.1 but still cannot get email from my work exchange account. I'd appreciate any help.  Thank you.

    I have installed Mountain Lion 10.8.1 but still cannot get email from my work exchange account. I'd appreciate any help.  Thank you.

    I would delete the account and try to re-enter it. Also, you have to let your firm's IT department know that you want to sync work email on your personal devices before they actually work.

  • Open script cannot get connection from the brower helper after 15 seconds.

    Error:
    ===
    Open script cannot get connection from the brower helper after 15 seconds. Do you want to continue waiting for the browser to load?
    Please Note:
    ========
    1. I have tried this only on IE
    2. I am running OATS on a Remote desktop
    Situation:
    ======
    Trying to stop the recording
    Try to get xpath of an object using Inspect Path
    Setup details
    ========
    Windows XP 5.1 Service Pack 3, x86
    OpenScript 12.1.0.1.383
    Internet Explorer 8.0.6001.18702
    FireFox 13.0.1
    Mitigation steps done till now:
    ==================
    1. Disabled windows firewall
    2. Disable XSS filter setting
    3. Restarted the ATS services (3 of them)
    4. Run the Open Script Diagnosis Tool (PS: There are 3 errros even after running it. The 3 errros are listed in the workspace_log log file snippet below...)
    Error in worspace_log:
    =============
    To Change setting:
    Go to Tools > Internet Options and Choose Security Tab
    Select the Zone to modify and Press Custom level
    Find Enable XSS filter Setting - Select Disable and click Ok
    !ENTRY oracle.oats.scripting.diagnosisTool.api.DiagnosisExecutor 4 0 2012-07-09 17:08:52.594
    !MESSAGE Failure found when diagnosing Oracle EBS/Forms Load Testing Forms LT Diagnoser
    !ENTRY oracle.oats.scripting.diagnosisTool.api.DiagnosisExecutor 4 0 2012-07-09 17:08:52.594
    !MESSAGE Did not auto-fix the problem.
    !ENTRY oracle.oats.scripting.diagnosisTool.api.DiagnosisExecutor 4 0 2012-07-09 17:08:52.594
    !MESSAGE Suggestion for fixing: Please change your Java proxy setting to Use Browser Settings
    Aprreciate help on this.

    To resolve this, you need to reconfigure the "Oracle Application Testing Suite Helper Service" (OATSHelperSvr) to start as a user who has privledges to run open script tests rather than the default SYSTEM user.
    Reconfiguring the OATSHelperSvr Service:
    1. Open the services panel (Start > Run > services.msc)
    2. Find the Oracle Application Testing Suite Helper Service
    3. Right Click > Properties then select the Log On Tab
    4. Specify an interactive user that has rights to run OpenScript (test by logging in as that user and running tests):
    5. Click OK
    6. Restart the service after dialogs are closed by Right Click > Restart
    7. You should now repeat this process for the "Oracle Application Testing Suite Agent Service" (eLoadAgentMon) Service (Two services in
    total)
    You should now retry running the test in Oracle Test Manager

  • Light weight AP cannot Get IP from windows DHCP server

    Hi all :
    We user WISM ver.5.0.148.2 , All AP is 1230 Series and Use Windows 2003 DHCP server.All AP cannot get IP after upgraded Lightweight from Autonomous IOS.
    But I found the DHCP is work if i use my notebook connect the same switch port and my notebook can get IP from DHCP server.
    Anyone can tell me why MY Lightweight AP cannot get IP from DHCP server ???
    thx any idea .
    I confirm the AP DHCP setting enabled and the config as below :
    AP000d.bc41.4392#show ip inter bri
    Interface IP-Address OK? Method Status Protocol
    FastEthernet0 unassigned YES DHCP up up

    hi fella5:
    yes , it's done , the WLC already have the SSC Code and i verify the SCC code is correctly.
    the Switchport configured that vlan 99 access port and the Global Vlan ID set the IP helper to the DHCP already.I can ping to the DHCP , DNS and WLC.

  • Single query to get data from different databases

    i need to capture certain fields from certain tables in database 1 and certain fields from certain tables in database 2 into one file using a single SQL statement.
    i tried searching on the net
    i found that dblinks can help
    but iam not sure if ill be able to create dblinks in my situation which is:
    i need to get data from oracle to be copied to mysql
    this is not a replication acitivity, but i need certain fields from one database and certain from the other
    so what iwas thinking is, if i use an sql query to get all the fields (i need around 40) from the different oracle databases and create a singlefile with one insert per select, i can then read that file into mysql
    instead of creating multiple sql queries for each table and creating separate files and eventually separate tables in mysql.
    can anyone help me here?
    or maybe suggest another approach.
    thanks

    Hi,
    I think dblink is the only option available to get data from different databases. It will work for your case too.
    CREATE DATABASE LINK db_link CONNECT TO user_name IDENTIFIED BY  password USING 'instance_name'you must have the system privilege 'create database link' to create db links. This way you can get the required data and put it in a table in oracle. But i dont know how to put this data from oracle table to Mysql.
    HTH
    Muneer

  • How to get Time from Different Work Station on the Network

    Hi,
    How do I get time from different work station on the network using its ip:port etc.
    Lets say, my main server-side Java application is running on a work station 123.12.123.1:1527,
    the client-side applications are accessing it using above IP.
    what I wanna do is, use the time of 123.12.123.1 machine throughout the application, not client local time.
    Appreciated..

    Ok, this network service on IP:Port is working for me, I hope this is the best way of doing it.
    In server application, I have this
    package RenameItToYourOwnPackage;
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.net.ServerSocket;
    import java.net.Socket;
    import java.text.SimpleDateFormat;
    public class ServerSocketExample implements Runnable {
        private ServerSocket server;
        private int port = 7777;
        Socket socket;
        public void run() {
            try {
                System.out.println("Waiting for client message");
                server = new ServerSocket(port);
                while (true) {
                    socket = server.accept();
                    // Read a message sent by client application
                    ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
                    String clientMessage = (String) ois.readObject();
                    System.out.println("Message sent by client: " + clientMessage);
                    // send current datetime to client
                    ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
                    oos.writeObject(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date()));
                    ois.close();
                    oos.close();
                    socket.close();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
    }In the client application I have
    package RenameItToYourOwnPackage;
    import java.io.IOException;
    import java.io.ObjectInputStream;
    import java.io.ObjectOutputStream;
    import java.net.InetAddress;
    import java.net.Socket;
    import java.net.UnknownHostException;
    public class ClientSocketExample {
        static String dateTimeString;
        public ClientSocketExample() {
        public static String getServerDateString() {
            try {
                // Create a connection to the server socket on the server application
                InetAddress host = InetAddress.getByName("127.0.0.1");
                Socket socket = new Socket(host.getHostName(), 7777);
                // Send a message to the server application
                 ObjectOutputStream oos = new ObjectOutputStream(socket.getOutputStream());
                 oos.writeObject("Send me today's timestamp as string");
                // Read the response by server application
                ObjectInputStream ois = new ObjectInputStream(socket.getInputStream());
                dateTimeString = (String) ois.readObject();
                //System.out.println("Message sent by server: " + message);
                ois.close();
                oos.close();
            } catch (UnknownHostException e) {
                e.printStackTrace();
            } catch (IOException e) {
                e.printStackTrace();
            } catch (ClassNotFoundException e) {
                e.printStackTrace();
            return dateTimeString;
    }And I run the service on the server-side with
            new Thread(new ServerSocketExample()).start();On the client-side I receive the date with
            System.out.println("DateTime on Server : " + ClientSocketExample.getServerDateString());Edited by: nkamir on Sep 13, 2010 2:53 PM

  • I cannot get "Notes" from IPhone 5.0 to upload or sync with the ICloud

    I cannot get "Notes" from IPhone 5.0 to upload or sync with the ICloud?

    Hi there PGMiller,
    You may find the information in the article below helpful.
    iCloud: Notes overview
    http://support.apple.com/kb/PH12081
    iCloud Notes uses your @icloud.com email account to store your notes. If you don’t have an @icloud.com email address, you can create one by turning on Notes in iCloud preferences on your Mac or in iCloud settings on your iOS device.
    -Griff W. 

  • After upgrade to IOS 5, cannot get photos from camera roll to my computer, Why?

    Don't know why I cannot get photos from camera roll to my computer after upgrade to IOS 5.
    I could find an external driver to get photos before.
    and I cannot sync the website bookmarks to my computer.
    What can I do to solve this problem...??
    HELP pls!!
    Iphone 4

    Try disabling Norton and syning.  If that doesn't help try uninstalling iTunes and all of its components by following this guide: Windows XP or Windows Vista/7, then reinstall iTunes.  You must follow this guide exactly or it will not be successful.  Note: uninstalling iTunes will only remove the application; it will not touch your iTunes library or data.
    If you continue to have trouble you can use an app like PhotoSync to wirelessly transfer your photos to your computer while you continue to try to troubleshoot this.

  • I cannot get pages from iWork's to share.  Do I need a new version of pages for Mountain Lion?

    I cannot get pages from iworks to share on Mountain Lion.  Do I need a new version of pages for Mountain Lion instead of iworks?

    You need Pages 09 (Version 4) to take advantage of Mountain Lion's iCloud features. You don't say what version you have.
    Jerry

  • Author       "javax.sound.midi.InvalidMidiDataException: cannot get soundbank from stream" after java update

    Not sure where to post this issue.
    I am noticing this error since I did the Mac update. The Mac update included the java update. Right now the java version is 1.6.0_31. My Mac OS X version is 10.7.3. I am seeing the problem for all the soundfont files that I am trying to load. The error i get is.
    javax.sound.midi.InvalidMidiDataException: cannot get soundbank from stream
         at javax.sound.midi.MidiSystem.getSoundbank(MidiSystem.java:565)
         at myPackage.MyMusicApp.main(MyMusicApp.java:14)
    Below is a small program I built that shows the code.
    package myPackage;
    import java.io.File;
    import javax.sound.midi.*;
    public class MyMusicApp {
        public static void main(String[] args) {
            try {
                Synthesizer synth = MidiSystem.getSynthesizer(); synth.open();
                File f =  new File("/Users/poorav/eclipseGIT/myApp/soundbanks/1247_KitDRY.sf2");
                Soundbank soundbank = MidiSystem.getSoundbank( f);
                synth.loadAllInstruments(soundbank);
            } catch (Exception e)
                e.printStackTrace();
    I am not sure what the previous build of java I was on, but i know that it was a 1.6 version. Any ideas of what could have caused this?
    thanks

    No satisfactory progress!
    I submitted a bug for this using the Apple bug reporter on 9th April (#11208868) and despite asking for an update, it has been completely ignored (even now). I'm not impressed.
    I then issued a (paid for) Developer Technical Support issue which was credited back to my account a few days later with no explanation. When I asked why, I eventually got: "At this time DTS does not provide code-level support for Java"!
    So, Apple are assuming to responsibility for this problem. I realise that Oracle is mostly responsible for Java but Apple took this crippled version (how much testing did they do?) and updated our customers' machines with it. This has effectively disabled a key feature of our product and has cost us damage to our company's reputation. Still Apple don't care and they rely on the fact that we are too small to sue them. You can see I'm not happy! I naively thought Apple would make some attempt to assist their developers.

Maybe you are looking for