How-to build a NodeList of ALL nodes in an XMLDocument

Hello List,
I am trying to write a method which takes in an XMLDocument and iterates over each element in the XMLDocument, extracting the value of an attribute, key, and using key to access a HashMap and add an important bit of data to the element.
I am trying to use NodeList as the collection of elements but am having trouble getting either XMLNode.selectNodes(String pattern) or XMLNode.getChildNodes(String pattern) to return a NodeList containing ALL the nodes in the XMLDocument.
Instead it is returning sibling nodes in its list, but not finding the children which these sibling nodes contain.
Am I misuing the API? Is there another way to accomplish this?
Any tips, suggestions, reponses, answers welcome.
TIA,
Alex Reuter

Ok, here is how I am doing it.
I am settling for a nodelist of all nodes which have attributes named key.
XMLNode nodey = othernode;
NodeList list = nodey.selectNodes("descendant::*/@key");
just for posterity..
alex

Similar Messages

  • How to make the times of all nodes similar

    Hi,
    i have a 3 node 10.2.0.4 64Bit Cluster database on
    HP Itanium with OS RHEL-4.6.
    we donot have any NTP Server integrated with these.
    Three nodes are running with three different Time with significant differences.
    More over 2 of the Nodes run well ahead of real Actual time and One run behind actual time.
    For Example at 11:34 AM the nodes return their times as follows::
    HOST_NAME DATETIME
    Node-1 11-JUL-2012 11:56:38
    HOST_NAME DATETIME
    Node-1 11-JUL-2012 11:18:12
    HOST_NAME DATETIME
    Node-3 11-JUL-2012 11:44:26
    the real time difference is 16 Min Minus and 22 Min Plus.
    And difference of Times does have an adverse business impact.
    if syncronization without NTP is possible -- that would be great.
    if not, how can we bring all the server nodes close to the real time.
    Your suggestion and workaround will be appreciated to synchronize the times of three instances
    as much possible with out hampering the Cluster Services.

    onedbguru wrote:
    I forget the name of it, but there is an executable that is used in Exadata clusters to do the same thing. Two standerd bash scripts I deploy to all RAC servers are called rac (for running a "RAC command" on all nodes) and raccp (for distributing a local file to all other RAC servers).
    Uses ssh and scp and are quite useful. Want to see uptime for example? rac uptime. Want to distribute the updated ntp config? raccp /etc/ntp.conf.
    Sadly though - no Exadata. There are 2 Exadata DB Machines in the corporate, but despite having one of the busiest databases on a self-build 12 node 3-yer old RAC, crunching data 24x7 for our corporate clients, no Exadata for us... Kind of like this Dilbert situation - total incompetence and requesting many millions are required.

  • How to remove all nodes (except root node)from a Jtree?

    How to remove all nodes (except the root node)from a Jtree?

    Either:
    - remove all children of root.
    - save the root node, throws away the tree model, build a new TreeModel with the saved root, set the new TreeModel in the JTree.
    - implement your own TreeModel, which would support an emptyExceptRoot() method.
    IMHO, using the DefautlTreeModel and DefaultMutableTreeNode does lead to all sorts of small problems when the app evolves, and implementing your own TreeNode and TreeModel is not that hard and much more efficient.

  • How to build a form that traps all the IP adresses of the systems connected

    HELLO EVERYBODY,
    This is Paritosh Sharma,Actually I wanna know How to build a form that traps all the IP adresses of the systems connected.It's really Urgent

    6i on the web or client server? Webutil is not certified against 6i so if it's web I'm not sure, but I think it's in D2KWUtil for client-server.

  • How to make all nodes in a detailed navigation tree open automatically??

    Dear All,
    I have added some iViews to two folders and add these two folders to a workset "Time" and then add "Time" to the role of Employee portal user.
    How to make all nodes expanded automatically when this workset is clicked in EP??
    thanks,
    Zita

    Not surprising...it does not work even if you follow the exact way...
    Role ->
             Workset 1
                          -> Page 1
                          -> Workset 2
                                           -> Page 2
                          -> Workset 3
                                           -> Page 3
    When the user clicks on Role which is the Entry Point, I want the user to see Page1 (works alright) and want the tree node Workset 2 open (doesn't work)...I want tree node Workset 3 closed (which is what happens...)
    The thing is Workset 2 has to be open...
    This is what I've done...I've made the Initial State of Navigation Panel set to "Open"...
    What else is to be done????
    Thanks a lot.
    JP

  • How to check that data was propagated to all nodes in cluster?

    Hi.
    We are using Weblogic 10.3.5 and Coherence 3.6. Both applications work in cluster mode and we are using replicated mode as a Coherence topology. Also the NameCache use to store and retreive data from Coherence cluster. Now I have a task to calculate a time that take data propagation to all nodes. So, from my sight of view coherence should raise some kind of event when each node in cluster will fulfield with the same data. Or may be there is a standard coherence(weblogic?) listener that provide such an information.
    I will be appreciate for help how to solve my task.

    Jonathan.Knight wrote:
    Hi,
    If you are using a replicated cache then the time taken to replicate the data is the time taken to do a put. Coherence will not return from a put method call on a NamedCache until the data has reached all the nodes. That is why replicated caches are a bad idea for clusters with a lot of nodes where there are frequent updates as they are slow.
    JKHi JK,
    actually, AFAIK, it is not 100% correct.
    From what I remember from an earlier discussion or email, replication in a replicated cache is synchronous to one other member (the lease owner), and asynchronous thereafter. The synchronous part of the protocol involves the mutating member and the entry lease owner (which may be the same). As I understand the lease owner orders the operations and resolves races between multiple mutators, and drives the asynchronous part of the replication to all other members.
    In short, total network cost is linear with nodes, but latency wise you do not need to wait until all updates actually took place on all other nodes (that would be a really sad scenario when some nodes are communicating slowly).
    Best regards,
    Robert

  • Tree2 : How to collpase all nodes

    Hi all.
    In my class i build the tree data with an ExtendedTreeNode (extends TreeNodeBase).
    What i want is to collapse all nodes at once.
    Any suggestions?
    Thanks a lot

    ..........

  • How to build an ObjectName pattern to list all objs of type=ServerConnector

    Hi,
    I would like to list all the MX objects of type=ServerConnector. How to build the pattern?
    The example below doesn't work (with pattern: resin:type=ServerConnector").
    It works when I want to list all objects and use pattern ("resin:*") or when I choose a specific ("resin:type=ServerConnector,name=b");
    Thanks for any advice,
    Ala
    {code}
    Object Name pattern = new ObjectName("resin:type=ServerConnector");
    MBeanServer mBeanServer = Jmx.getGlobalMBeanServer();
    Set poolNames = mBeanServer.queryNames(pattern, null);
    {code}
    And here all listed MX objects:
    resin:type=SessionManager,Host=default,WebApp=/
    resin:type=ServerConnector,name=i
    resin:type=ServerConnector,name=h
    resin:type=ServerConnector,name=b
    resin:type=Resin
    resin:type=ServerConnector,name=j
    resin:type=ProxyCache
    resin:type=Host,name=default
    resin:type=ServerConnector,name=c
    resin:type=ServerConnector,name=e
    resin:type=Port,name=192.68.1.50-6802
    resin:type=ServerConnector,name=g
    resin:type=ServerConnector,name=a
    resin:type=ThreadPool
    resin:type=WebApp,Host=default,name=/
    resin:type=WebApp,Host=default,name=/mya
    resin:type=ConnectionPool,Host=default,WebApp=/mya,name=jdbc/mya
    resin:type=ServerConnector,name=f
    resin:type=Cluster,name=cluster1
    resin:type=ServerConnector,name=d
    resin:type=SessionManager,Host=default,WebApp=/mya
    resin:type=Server

    You need to add a comma and asterisk to your pattern:
    Object Name pattern = new ObjectName("resin:type=ServerConnector,*");The pattern you are using will only match a single MBean with that exact name. There has to be an asterisk in the string in order for it to match like-named MBeans which have key/value pairs other than those in the string.
    For more on this, search in this javadoc for the string "property pattern":
    http://java.sun.com/j2se/1.5.0/docs/api/javax/management/ObjectName.html

  • How to find out the IP@s of all nodes in a cluster?

    Is there any way to retrieve the IP addresses of all nodes in a cluster?
    The problem is the following. We intend to write an administration program
    that administers all nodes of a cluster using rmi (e.g. tell all singletons
    in the cluster to reload configuration values etc.). My understanding is
    that rmi only talks to a single node in a cluster. It would be a convenient
    feature if the administration program could figure out all nodes in a
    cluster by itself and then administers each node sequentially. So far we're
    planning to pass all IP addresses to the administration program e.g. as
    command line arguments but what if a node gets left out due to human error?
    Thanks for your help.
    Bernie

    There is no public interface to inquire about the IP addresses of the servers in a cluster. If you use WLS 6.0, there is an administrative console that uses JMX to manage the cluster. Perhaps that would be of use to you?
    Bernhard Lenz wrote:
    Is there any way to retrieve the IP addresses of all nodes in a cluster?
    The problem is the following. We intend to write an administration program
    that administers all nodes of a cluster using rmi (e.g. tell all singletons
    in the cluster to reload configuration values etc.). My understanding is
    that rmi only talks to a single node in a cluster. It would be a convenient
    feature if the administration program could figure out all nodes in a
    cluster by itself and then administers each node sequentially. So far we're
    planning to pass all IP addresses to the administration program e.g. as
    command line arguments but what if a node gets left out due to human error?
    Thanks for your help.
    Bernie

  • How to completely shutdown the entire crs stack in all nodes ?

    Grid version: 11.2.0.4
    Platform : OEL 6.4
    To shutdown the entire crs stack, I ran crsctl stop cluster -all from one node. After the command execution,  the below mentioned processes were still running on all nodes.
    [root@intsmdp01 ~]# ps -ef | grep d.bin
    root     38562 33228  0 19:12 pts/2    00:00:00 grep d.bin
    root     80820     1  0 Nov09 ?        00:20:56 /crs/product/11.2.0/bin/ohasd.bin reboot
    grid     81448     1  0 Nov09 ?        00:01:22 /crs/product/11.2.0/bin/mdnsd.bin
    grid     81459     1  0 Nov09 ?        00:01:55 /crs/product/11.2.0/bin/gpnpd.bin
    grid     81473     1  0 Nov09 ?        00:17:26 /crs/product/11.2.0/bin/gipcd.bin
    root     81484     1 20 Nov09 ?        09:10:27 /crs/product/11.2.0/bin/osysmond.bin
    So , I had to manually run crsctl stop crs on all nodes.
    [root@intsmdp01 ~]# /crs/product/11.2.0/bin/crsctl stop crs
    CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'intsmdp01'
    CRS-2673: Attempting to stop 'ora.crf' on 'intsmdp01'
    CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'intsmdp01'
    CRS-2673: Attempting to stop 'ora.mdnsd' on 'intsmdp01'
    CRS-2677: Stop of 'ora.crf' on 'intsmdp01' succeeded
    CRS-2673: Attempting to stop 'ora.gipcd' on 'intsmdp01'
    CRS-2677: Stop of 'ora.mdnsd' on 'intsmdp01' succeeded
    CRS-2677: Stop of 'ora.drivers.acfs' on 'intsmdp01' succeeded
    CRS-2677: Stop of 'ora.gipcd' on 'intsmdp01' succeeded
    CRS-2673: Attempting to stop 'ora.gpnpd' on 'intsmdp01'
    CRS-2677: Stop of 'ora.gpnpd' on 'intsmdp01' succeeded
    CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'intsmdp01' has completed
    CRS-4133: Oracle High Availability Services has been stopped.
    [root@intsmdp01 ~]#
    Is there a way to bring down the entire crs stack in all the nodes in the cluster from one node ?

    Far as I know DSH exist by default in AIX env, but you can create it on Linux\Unix env.
    Creating DSH in a Linux Env.
    1 - Configure passwordless SSH between Nodes using root user.
    2 - Create a file /etc/dsh.conf with all hostsname separated with space in a line ( ex. node1 node2 node3)
    3-  Create a script "/usr/local/scripts/dsh" as follow:
    #!/bin/bash
    COMANDO=$*
    NODES=`cat /etc/dsh.conf`
         for NODE in $NODES
         do
         echo $NODE:
    ssh $NODE $COMANDO
         done
    exit 0
    4 - Change permission of file /usr/local/scripts/dsh to 775
    Just run
    # /usr/local/scripts/dsh date
    or
    # /usr/local/scripts/dsh /u01/app/grid/bin/crsctl stop crs

  • How to read the content in one node of XML in Java? Pls help

    My dear brothers,
    I am a newbie of XML, I have a exercise which is creating a Tree View from XML file. But the trouble is I do not know how to read the content in one node of XML file. I decide to use the algorithm as following:
    1. Create a GUI form which gives the ability for user to choose a XML file (ok)
    2. Load XML and return the file (ok)
    3. Read the file from node to node to create the node in Tree View (?!)
    Please help me, and if you are enough kind, please give me an small example to easy understand. Thanks in advance.
    Hoang Yen Binh

    I hope this one helps you.
         <ABC Type="ProductBased" ProdName="One" Location="India">
              <CEO>Raj</CEO>
              <Finance>Vikram</Finance>
              <HR>Karthik</HR>
              <Technical>Satish</Technical>
         </ABC>
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.NamedNodeMap;
    import org.w3c.dom.Attr;
    import org.w3c.dom.NodeList;
    import org.w3c.dom.Node;
    import org.w3c.dom.DOMException;
    import javax.xml.parsers.ParserConfigurationException;
    import org.xml.sax.SAXException;
    import java.io.File;
    import java.io.IOException;
    public class XmlReading {
         Document doc;
         Element element;
         public static void main(String[] args) throws Exception{
              XmlReading xr = new XmlReading();
              xr.getXmlParser(args);
         public void getXmlParser(String[] args) {
              DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                   if(args.length != 1) {
                        System.err.println("Argument Required");
              try {
                   DocumentBuilder builder = factory.newDocumentBuilder();
                   doc = builder.parse(new File(args[0]));
              }catch(ParserConfigurationException e1) {
              }catch(SAXException e2) {
              }catch(IOException e3) {
              getAttributes();
         public void getAttributes() {
              // Retrive the entire Document from the Dom Tree
              element = doc.getDocumentElement();
    //          System.out.println(element);
              NamedNodeMap attrs = element.getAttributes();
              // Get number of attributes in the element
         int numAttrs = attrs.getLength();
         // Process each attribute
              for (int i=0; i<numAttrs; i++) {
                   Node node = attrs.item(i);
                   // Get attribute name and value
                   String attrName = node.getNodeName();
                   String attrValue = node.getNodeValue();
                   System.out.println(attrName + ": " + attrValue);
              String s1 = element.getTagName();
              System.out.println(s1);
              // To get all the elements in a DOM Tree
              NodeList nl1 = element.getElementsByTagName("*");
              int i2 = nl1.getLength();
              System.out.println(i2);
              for(int i=0; i<i2; i++) {
                   System.out.println(nl1.item(i) + "\n");
    }

  • How to build a array with high sampling rates 1K

    Hi All:
    Now I am trying to develop a project with CRio.
    But I am not sure how to build a array with high sampling rates signal, like >1K. (Sigle-point data)
    Before, I would like to use "Build Arrary" and "Shift Register" to build a arrary, but I found it is not working for high sampling rates.
    Is there anyother good way to build a data arrary for high sampling rates??
    Thanks
    Attachments:
    Building_Array_high_rates.JPG ‏120 KB

    Can't give a sample of the FPGA right now but here is a sample bit of RT code I recently used. I am acquiring data at 51,200 samples every second. I put the data in a FIFO on the FPGA side, then I read from that FIFO on the RT side and insert the data into a pre-initialized array using "Replace Array subset" NOT "Insert into array". I keep a count of the data I have read/inserted, and once I am at 51,200 samples, I know I have 1 full second of data. At this point, I add it to a queue which sends it to another loop to be processed. Also, I don't use the new index terminal in my subVI because I know I am always adding 6400 elements so I can just multiply my counter by 6400, but if you use the method described further down below , you will want to use the "new index" to return a value because you may not always read the same number of elements using that method.
    The reason I use a timeout of 0 and a wait until next ms multiple is because if you use a timeout wired to the FIFO read node, it spins a loop in the background that polls for data, which rails your processor. Depending on what type of acquisition you are doing, you can also use the method of reading 0 elements, then using the "elements remaining" variable, to wire up another node as is shown below. This was not an option for me because of my programs architecture and needing chunks of 1 second data. Had I used this method it would have overcomplicated things if I read more elements then I had available in my 51,200 buffer.
    Let me knwo if you have more qeustions
    CLA, LabVIEW Versions 2010-2013
    Attachments:
    RT.PNG ‏36 KB
    FIFO read.PNG ‏4 KB

  • New Howto guide available: HOW to INSTALL and CONFIGURE A TWO-NODE CLUSTER

    Hi,
    I am not sure that this has been posted or not. But for all of us who are too lazy (like myself) to read the full set of documentation, or who have not enough time, please have a look at this short document with screen shots that explains how to setup a simple two-node cluster.
    http://www.sun.com/software/solaris/howtoguides/twonodecluster.jsp
    I still recommend to browse through the "Sun Cluster Concepts Guide for Solaris OS" http://docs.sun.com/app/docs/doc/819-0421
    Have fun
    Hartmut

    I am afraid there is no such document. But I can try to give you some hints.
    N+1 can be seen as two things:
    - the phsical setup of the cluster and
    - the logical configuration of services
    A physical N+1 setup would mean, that you have one server that is connected to all shared storage, but the other N nodes are only connected to the shared storage they need.
    This configuration would also need the logical N+1 setup, namely that all HA services could only run on 2 nodes, their primary node and as a backup this one dedicated node that is connected to all shared storage.
    If you do not have the physical N+1 setup, you could easily have a logical N+1 setup, by having a N*N topology, j.e. all nodes connected to all storage, but logically each service again would have only 2 nodes on its nodelist.
    It seems that the second option is the one that is used more often, as ift offers you the ability to reconfigure things in case of failures.
    With regards to asymmetric and symmetric I am not quite sure what you mean: And I do not think that these terms are used in the SC docs.
    What I can think of is, that asymmetric means that you have one node being active with 1 or more HA services and have one inactive secondary node as a backup.
    Regards
    Hartmut

  • Pin dbms_cube.build parallel jobs to specific node on RAC

    Is there a way to Pin dbms_cube.build parallel jobs to specific node on RAC.Currently the job with say parallelism of 10 spans over all nodes of RAC.
    IS there a way to control it so the child jobs runs on subset of nodes. Unable to see how we can tie job classes and services with dbms_cube.build .
    Any suggestions will be hugely appreciated.

    Used undocumented JOB_CLASS and it seems to working fine.
    SQL> desc sys.dbms_cube.build
    Parameter Type Mode Default?
    SCRIPT VARCHAR2 IN
    METHOD VARCHAR2 IN Y
    REFRESH_AFTER_ERRORS BOOLEAN IN Y
    PARALLELISM BINARY_INTEGER IN Y
    ATOMIC_REFRESH BOOLEAN IN Y
    AUTOMATIC_ORDER BOOLEAN IN Y
    ADD_DIMENSIONS BOOLEAN IN Y
    SCHEDULER_JOB VARCHAR2 IN Y
    MASTER_BUILD_ID BINARY_INTEGER IN Y
    REBUILD_FREEPOOLS BOOLEAN IN Y
    NESTED BOOLEAN IN Y
    JOB_CLASS VARCHAR2 IN Y

  • Hello, My iCal don't synchronize older events than two or three month ago. How can I do to synchronize all my schedule? In iTunes it's all right in Calendars. I don't put a cross in "synchronize event older than ....... days". Thanks for answer.

    Hello, My iCal don't synchronize older events than two or three month ago. How can I do to synchronize all my schedule? In iTunes it's all right in Calendars. I don't put a cross in "synchronize event older than ....... days". Thanks for answer.

    Just saw your post. Better late than never. You may want to
    consider GameBrix.com, where you can create Flash based, casual
    games using your web browser. No downloads are required. You can
    create a game from scratch using a library of images, sounds and
    game mechanics. You can also upload your own. The online script
    editor will allow you to view and edit the ActionScripts associated
    with each game mechanic. In short, a great way to ramp up on game
    design and build your own game without investing a lot of $
    upfront.
    BTW I am associated with GameBrix so any feedback is
    appreciated.

Maybe you are looking for

  • Can anyone help with my Mini 210 Bios Password

    Can anyone help with my Mini 210 Bios Password master password after enter 3x comes CNU9491VLG Thanks in advance

  • Showing image instead of flash for mobiles?

    I am just wondering if it is possible to show an image instead of flash content for mobiles? I want to allow the adobe sniffer to do its thing when it is people using pc and mac browsers and direct them to the plug in page to download the flash playe

  • Call Centre???

    Hi, I have been asked to suggest an SAP solution to this: Log calls/requests to HR from employee's (e.g. leavers, absence, Leave, transfers....normal HR processes). Basically, the requirement is a call centre and the SAP Solution would be CRM but we

  • Earphones not working properly

    Hey, The earphones on my iPod Nano don't seem to be working well anymore. The left one is a lot quieter then the right one. Would I get new ones if I go back to the store? Or not? My iPod is still under warranty. Thanks.

  • Can't change notification sounds

    I can't seem to change the sounds used for notifications; the setting changes, but the notification still plays the default sound. I have an iPod Touch 5g 32 GB running iOS 7.1.2. As of right now, I've only noticed the iOS mail app doing this, but I