GetXMLString(Node) Question

Hi,
I'm trying to create one document that will contain the results of multiple queries. For example
<MY_ROOT>
<QUERY1_RESULT ID=1>
<FIELD1>stuff</FIELD1>
<FIELD2>more stuff</FIELD2>
</QUERY1_RESULTS>
<QUERY1_RESULT ID=2>
<FIELD1>stuff2</FIELD1>
<FIELD2>more stuff2</FIELD2>
</QUERY1_RESULTS>
<QUERY2_RESULT ID=1>
<FIELD>hello</FIELD>
</QUERY2_RESULTS>
</MY_ROOT>
I'm assumming that I need to use the OracleXMLQuery.getXMLString() method for the first query results and use the OracleXMLQuery.getXMLString(Node) method for the second query results. But how do I obtain the Node from the first query results?
Thanks for your help in advance.
- N.

import java.sql.*;
import oracle.xml.parser.v2.*;
import oracle.xml.sql.query.*;
class Demo {
public static void main (String arg[]) throws Exception {
// Get a JDBC Connection
Connection cn = ConnectionHelper.getConnection();
// Two XMLSQL Query objects
OracleXMLQuery q1 = new OracleXMLQuery(cn,"SELECT 1 one from dual");
OracleXMLQuery q2 = new OracleXMLQuery(cn,"SELECT 2 two from dual");
// Create a new document to "house" the two results
XMLDocument d = new XMLDocument();
// Create a root element otherwise result won't be valid XML
XMLElement e = (XMLElement)d.createElement("page");
d.appendChild(e);
// Show one technique for the first results
q1.getXMLDOM(e);
// Show another technique
XMLDocumentFragment df = (XMLDocumentFragment)d.createDocumentFragment();
q2.getXMLDOM(df);
e.appendChild(df);
d.print(System.out);
cn.close();
}

Similar Messages

  • EA 3.1 - Data Node Questions

    I have the following questions regarding the Data and Model Nodes
    1. Is it possible to define one table/view to be used in building the model(s) and a different table/view for testing the model.
    2. If we use the same table/view for the build and testing, can we see what data is being used for the build and what data is used for the testing
    3. For question 2, can we extact the data into another table etc

    Hi Brendan,
    See answers below.
    Thanks, Mark
    1. Is it possible to define one table/view to be used in building the model(s) and a different table/view for testing the model.
    Answer:
    Yes. Just connect another data source to the Classification or Regression Build Node.
    The second DS node has a link labeled as Test. If you want to swap the build and test data source, then select the Build Node, right click to bring up the node context menu and select "Swap Data Sources".
    2. If we use the same table/view for the build and testing, can we see what data is being used for the build and what data is used for the testing.
    Answer:
    No. The split data are temporary views. If you want to control exactly what data is used, then use your own test and build data source nodes.
    3. For question 2, can we extact the data into another table etc
    Answer:
    See answer to question 2.

  • G4 and Xgrid node question

    I am currently running Logic on a G4 and thinking of the most effective way to expand my capabilities in order to work on film scoring. I was thinking of buying a mini mac and running and xgrid to utilize both computers for processing (with the node app in logic). I wanted to know if anyone has tried this or if it is compatible. If not, are there any other suggestions for ways to increase my processing power, or perhaps it isn't necessary? Thanks

    From the API for JTree
    public int getMinSelectionRow()
    Gets the first selected row.
    Returns:
    an integer designating the first selected row, where 0 is the first row in the display
    But I think this is based on how many rows are displayed at the present time and might change if the tree is opened above it.

  • Another PPC/Intel node question!!!

    Hi MacAddicts,
    I've searched the forum but didn't get an answer about this. I want to connect a PowerBook(host)to an Intel Mac mini as the node(the poor man's HD setup!!). I'm on LP 7.1.1 on Panther. Can i install the node app. from 7.1.1 on the intel mac or do i need the node app. from 7.2 on the intel? That's the part i didn't see anywhere!!! Thanks for any response.

    You need the node app on the MacIntel to be the 7.2 version.
    It's simple - anything that runs on Intel chips needs to be a Universal Binary, otherwise it either won't work or the performance will be horrible horrible horrible.
    7.2 is the first version of Logic that is a UB.

  • Node question

    I'm thinking of purchasing a Mac mini to use as a node computer for Logic Pro 8. Before I can do that, however, I need to install the Logic node on the mac mini and put this in the startup items so the node loads automatically when the Mac mini boots. The problem is I have to set up the Mac mini for this function in the first place and I'm wondering if there is a way to do this using the iMac display and keyboard. Thanks,

    Are you running Leopard on your imac? The mini will be. You'll only need access to a keyboard, mouse, and monitor to do the initial setup on the mini. From then on, you can use screen sharing to remote control your mini. Works great.

  • A Compositing / RotoShape Node question

    I'm a very new Shake user, and having some trouble getting my mind around Chapter 6: Rotoscoping, in the User Manual.
    If I have a guy walking across a room and I want to make the top half of his body disappear, can that be done with a Rotoshape?
    My two video clips are: #1 -- a clean plate, a shot of the room with nothing in it, the camera locked off on a tripod. #2 -- the same locked-off shot with the guy walking across the room.
    I thought it would be easy to draw a rotoshape on top of clip #2 that would cover the top half of the guy's body, a black shape that would create transparency where the guy's body was. Then I would composite the clean plate clip #1 underneath clip #2 to "fill in" the missing body with the rest of the room.
    But I must not be setting up my node tree properly. When I connect a rotoshape node to Clip #2, and load the rotoshape node into the viewer to draw the shape, I am not sure where to draw it, because I cannot see the clip that shows the position of the guy's body. And beyond that, if I did draw the rotoshape in the correct place, would it serve as an alpha channel for Clip #2, knocking out the top half of the body?
    Am I conceptualizing this in the most efficient way? Any tips on setting up the nodes would be greatly appreciated!
    Jim

    Thanks much, Jon and Captain! Your comments are enlightening. I tried both methods, and Jon's worked a little better for me. Using Captain's main clip to switchmatte and rotoshape to switchmatte, I got a weird dark outline around the rotoshape I drew that I did not get when I went rotoshape directly into the mask channel of the foreground clip, and then from there main clip and cleanplate into an over node. But other than that dark outline (and it may have been operator error of some kind) the compositing theory worked.
    On Captain's comment -- "Plus, adding multiple masks becomes easier, less messy and more practical. How do you add a second mask?" -- I was under the impression that you could have more than one mask, or rotoshape, on a rotoshape node. Page 157 in the user manual, Volume II: Compositing, says "To create another shape, click the Add Shapes button again." That seemed to work for me. I was able to add a second mask, if I am using the terminology right. Or maybe what I was adding was a "rotoshape," but I thought of it as a mask because I inverted it to black to make something in my foreground image "disappear" and let the cleanplate show through to fill in the missing section of the foreground clip.
    In any case, as a Shake user of just a few days now, it gives me an idea that there are multiple ways to get to the same destination.
    Thanks again, Jon and Captain, for the advice.
    Jim

  • JTree and selected node question

    Hello
    Is it possible to convert the selected node to an int?
    I guess I'm looking for something llike this.
    int nodeNumber = node.getSelectedIndex();
    There is nothing like that in the API, and it would help greatly if I could find a way do this.
    Thanks
    Have a good holiday
    Jim

    From the API for JTree
    public int getMinSelectionRow()
    Gets the first selected row.
    Returns:
    an integer designating the first selected row, where 0 is the first row in the display
    But I think this is based on how many rows are displayed at the present time and might change if the tree is opened above it.

  • Placeholder Content Node Question

    Hi,
    I'm trying to find a way to get the node a placeholder query returns either from a standard query or a campaign query. I need the node Object instead of the straight HTML code. I've tried using the PlaceholderService interface but that only seems to return HTML as a string. Any ideas on what else I could try?
    Thanks,
    Greg

    I don't believe it is possible to get out anything else than the HTML. The
    PlaceholderService API is rather stupid is this sense.
    I have been forced build own jsp wrapper tag around <ph:placeholder> -tag in
    order to do some changes to the HTML code it returns from the CMS
    repository.
    If you could hide the object-id (or such) to the HTML-content, then you
    could do something with it. Complicated indeed!
    Regards,
    Juha
    <Greg Loyd> wrote in message news:[email protected]..
    Hi,
    I'm trying to find a way to get the node a placeholder query returns either
    from a standard query or a campaign query. I need the node Object instead
    of the straight HTML code. I've tried using the PlaceholderService
    interface but that only seems to return HTML as a string. Any ideas on what
    else I could try?
    Thanks,
    Greg

  • Visable Property Node Question

    I need to make different controls on my front panel appear and disapper with depending on what is being done is there an easy way to make a lot of different things appear and disappear without creating a property node for each individual one. Its slowing me down a bit during execution and its also making my primary VI huge.
    Solved!
    Go to Solution.

    Phil_ wrote:
    If you are dealing with more than just a few controls/indicators, I would recommend setting Defer Front Panel Updates before the FOR loop and clear it after.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    Make buttons visible.png ‏18 KB

  • Quad node question

    If you run a Quad core G5 as a node-based processor on another system (like a MacBook Pro), will it efficiently use all four cores?
    Thanks!

    Any ideas on this?

  • RAC and Node question from Developer view point

    Hi ,
    I am not able to understand as to how , if an Oracle database is in RAC cluster having many nodes or having data guard ,effect the oracle developer's developement ?
    This features are more to do with DBA's tasks
    Please can someone shed some light
    Edited by: va**** on Sep 29, 2012 6:39 AM

    I mean ,some oracle developers claim to have worked in cluster environments.
    Since now a days many companies work in cluster environments ,this is common.
    makes me wonder as to what feature of RAC are they using in pl/sql developement .?
    Is there some designing table/view/trigger creation etc concept using RAC feature ?
    Is there any smart pl/sql programming wihch makes pl/sql code more efficient ? If yes please could you point me a link ?
    Thanks
    V

  • Oracle VM 2.2 :: Oracle Clusterware/Oracle 11gR2 {Single RAC node} Question

    1. Is it recommended to use physical disks everywher for ORAHOME, base operating system root, OCR / Vote disks and ASM disks? At this point of time in my vm.cfg only the ASM disks are physical while the OCR / Vote disks and ORAHOME and operating system is on an image file using tap:aio (blktap) driver.
    Current vm.cfg disk directive
    disk = ['tap:aio:/var/ovs/mount/1FB2E6B36D21418792A1DD30B62C689F/running_pool/16_oeldb1/System.img,xvda,w',
    'tap:aio:/var/ovs/mount/1FB2E6B36D21418792A1DD30B62C689F/running_pool/16_oeldb1/oracle.img,xvdb,w',
    'tap:aio:/var/ovs/mount/1FB2E6B36D21418792A1DD30B62C689F/sharedDisk/oracle_oeldb2.img,xvdc,w!',
    'tap:aio:/var/ovs/mount/1FB2E6B36D21418792A1DD30B62C689F/sharedDisk/asm_vote01.img,xvdd,w!',
    'tap:aio:/var/ovs/mount/1FB2E6B36D21418792A1DD30B62C689F/sharedDisk/asm_vote02.img,xvde,w!',
    'tap:aio:/var/ovs/mount/1FB2E6B36D21418792A1DD30B62C689F/sharedDisk/asm_vote03.img,xvdf,w!',
    'tap:aio:/var/ovs/mount/1FB2E6B36D21418792A1DD30B62C689F/sharedDisk/asm_vote04.img,xvdg,w!',
    'tap:aio:/var/ovs/mount/1FB2E6B36D21418792A1DD30B62C689F/sharedDisk/asm_vote05.img,xvdh,w!',
    'tap:aio:/var/ovs/mount/1FB2E6B36D21418792A1DD30B62C689F/sharedDisk/db_disk_01.img,xvdi,w!',
    'tap:aio:/var/ovs/mount/1FB2E6B36D21418792A1DD30B62C689F/sharedDisk/db_disk_02.img,xvdj,w!',
    'tap:aio:/var/ovs/mount/1FB2E6B36D21418792A1DD30B62C689F/sharedDisk/db_disk_03.img,xvdk,w!',
    'tap:aio:/var/ovs/mount/1FB2E6B36D21418792A1DD30B62C689F/sharedDisk/db_disk_04.img,xvdl,w!',
    'tap:aio:/var/ovs/mount/1FB2E6B36D21418792A1DD30B62C689F/sharedDisk/oeldb_ocfs2.img,xvdm,w!',
    'tap:aio:/var/ovs/mount/1FB2E6B36D21418792A1DD30B62C689F/sharedDisk/temp.img,xvdn,w!',
    'phy:/dev/sdf,xvdo,w!',
    'phy:/dev/sdg,xvdp,w!',
    'phy:/dev/sdh,xvdq,w!',
    'phy:/dev/sdi,xvdr,w!',
    2. is it recommended to use OCFS2 base partitioned disks be used to create ASM disks. I want to use these disks for ASM. (OR should i destroy the filesystem at the hypervisor and just present raw disk)
    [root@oeldb1 ~]# mounted.ocfs2 -d
    Device FS UUID Label
    /dev/xvdo ocfs2 67728d4c-f26d-4ec7-9ca1-4b25be453ec8 phydb1
    /dev/xvdp ocfs2 6901ffd5-33cb-46f7-99bb-74fc712ea4db phydb2
    /dev/xvdq ocfs2 95ed1075-f772-4c69-9ae0-9078b54bc8b5 phydb3
    /dev/xvdr ocfs2 6b3c313e-cec0-4967-a670-8856d38b0cd1 phydb4
    [root@oeldb1 ~]#

    Sebastian : Thanks. I did come across this white paper & now I have converted they ASM disks to physical. When you say just direcly pass LUNs from storage, its still going to be a virtual block device off the RAW lun to OVS, is that what you meant? .. ie RAW disk to OVS --> use phy: directive to present and xvd"n" to vm (PV block driver)
    ssolbach wrote:
    Hi,
    1.) It is recommended to use physical disks for all ASM disks (also for OCR and Vote). If you use 11.2. then OCR/Vote are on ASM anyway.
    See also: http://www.oracle.com/technetwork/database/clustering/oracle-rac-in-oracle-vm-environment-131948.pdf
    2.) Just present RAW disks. Best is to directly pass the LUNs provided from the storage.
    Regards
    SebastianAvi : hdparam and dd tests do not say so. I have seen better performances with blktap driver. Even iostat run within ASM showed better response times. I serched on white paper and documents within metalink on blktap or file driver, but couldnt find any. (I did find some ex Oracle SE's journals recommending blktap driver for better performance). Are you referring to significant improvements in 3.0.2 ? because, in 2.2 the file: driver is poor performing.
    Avi Miller wrote:
    Also note that you should be using the file: driver with Oracle VM, not tap:aio -- all of the Oracle performance improvements went into the loopback driver that uses the file method.Edited by: Abhijit on Dec 8, 2011 7:14 AM
    Edited by: Abhijit on Dec 8, 2011 7:15 AM
    Edited by: Abhijit on Dec 8, 2011 7:18 AM
    Edited by: Abhijit on Dec 8, 2011 7:19 AM

  • JTree node lazy loading + icons problem

    Hi all,
    I need to build a large tree (10000 nodes). Since this is large to load all at once, i want to load the last level dynamically using the 'treeWillExpand'
    Level 1
    --Level 2
    ---Lever 3
    ----Node loaded dynamically 4.1
    ----Node loaded dynamically 4.2
    ----Node loaded dynamically 4.3
    What i do is, i load all nodes in level 1,2,3 when application is initially loaded. In the Level 3 node, I add 1 dummy child node. I call it 'Waiting ...'. This I do because I want to display the 'handle' next to Level 3 node. Later on, when i click on the Level 3 'handle', I use this 'treeWillExpand' code:
    private void TreeWillExpand(javax.swing.event.TreeExpansionEvent evt) throws javax.swing.tree.ExpandVetoException {
            path = evt.getPath();
            //3 - Level 3
            if (path.getPathCount() == 3) {
                //here I get rid of the 'Waiting ...' node
                computerNode.removeAllChildren();
                //here I add all level 4 nodes
                Iterator it = ArrayList.iterator();
                while (it.hasNext()) {
                   .. here i load all Level 4 nodes
    Questions:
    1.
    Is the approach above a good approach, how to load children 'lazilly'?
    2.
    I also use custom renderer to display different icons for every "tree" level. When I initially expand the 4th level, everything works fine !!! Then I collapse the 4th level and expand it again and here my problem starts:
    - my 4th level icon is set to 'root level icon' instead of '4th level' icon. This does not happen, if computerNode.removeAllChildren(); method is removed from listening above
    My custom renderer:
    class MyTreeRenderer extends DefaultTreeCellRenderer {
        Icon rootIcon;
        Icon siteIcon;
        Icon computerIcon;
        Icon computerUnscannedIcon;
        Icon softwareIcon;
        public MyTreeRenderer(Icon rootIc, Icon siteIc, Icon computerIc, Icon computerUnscannedIc, Icon softwareIc) {
            rootIcon = rootIc;
            siteIcon = siteIc;
            computerIcon = computerIc;
            softwareIcon = softwareIc;
            computerUnscannedIcon = computerUnscannedIc;
        public Component getTreeCellRendererComponent(
                JTree tree,
                Object value,
                boolean sel,
                boolean expanded,
                boolean leaf,
                int row,
                boolean hasFocus) {
            super.getTreeCellRendererComponent(
                    tree, value, sel,
                    expanded, leaf, row,
                    hasFocus);
            //we can draw 4 icon types here
            DefaultMutableTreeNode node = (DefaultMutableTreeNode) value;
            String nodeType = (String) node.getUserObject();
            int level = node.getLevel();
            if (level == 0) {
                setIcon(rootIcon);
            } else if (level == 1) {
                setIcon(siteIcon);
            } else if (level == 2) {
                //make difference between scanned and unscanned computer
                if (node.getDepth() > 0) {
                    setIcon(computerIcon);
                } else {
                    setIcon(computerUnscannedIcon);
            } else if (level == 3) {
                setIcon(softwareIcon);
            return this;
    }Any idea, what am i doing wrong?

    durino13 wrote:
    1. Is the approach above a good approach, how to load children 'lazilly'?Sounds pretty reasonable to me.
    2. I also use custom renderer to display different icons for every "tree" level. When I initially expand the 4th level, everything works fine !!! Then I collapse the 4th level and expand it again and here my problem starts: my 4th level icon is set to 'root level icon' instead of '4th level' icon. This does not happen, if computerNode.removeAllChildren(); method is removed from listening above
    Any idea, what am i doing wrong?Ummmm... Load the model the first time (only) the node is expanded... Putz!
    And I suggest you listen deeply to Mr Jacobs... He really does know what he's talking about ;-)
    ... and not this time, but in future: Swing questions are best asked in [THE Swing Forum|http://forums.sun.com/forum.jspa?forumID=57].
    Cheers. Keith.

  • Property Node

    Hi Devchander:
    I have a question I would like to ask. I have a property node question. For some reason. I could not send the vi file. I make a word document.
    The one that is on the left is the property node I created from waveform graph.  You can see there is no Plot Interp after ActPlot. The orginal one inside the For Loop contains those parameter. Why? How can I make the one like inside the For Loop.
    What I am trying to do is to select another nice waveform graph on the front panel to see if it work, but the propery node can not be created the one inside the For Loop.
    The attached file vi is actually a niScope EX Multi Record.vi
    Regards,
    John
    Attachments:
    Property Node.doc ‏99 KB

    Here is the link to the same question in your other thread.  http://forums.ni.com/ni/board/message?board.id=150&message.id=1058&jump=true

  • BindSelectedKey Question

    I have the below context structure and am trying to create DropDown UI objects and lists dynmically.  Further below is the code I have
    thus far; most of it taken from the example.  I think I understand what is happening up to this point however I don't undstand
    what to pass to the bindSelectedKey to get the "response_text" shown in the picklist but have the "response_value" stored as the
    selected option.
    Any help would be much appreciated.
    /Greg
    C_Quest_Resp (0..n, s=true)
    - question_text
    + Responses (0..n, s=true)
        - response_text
        - response_value     
    // Multiple questions each having an element (Responses) which contains list of applicable responses.
    if (firstTime) {
              IC_quest_respElement qNode;
              int noQuestions = wdContext.nodeC_quest_resp().size();
              for ( int i = 0; i < noQuestions; i++ ) {
                   qNode = wdContext.nodeC_quest_resp().getC_quest_respElementAt(i);
                   IWDDropDownByKey dropDown = (IWDDropDownByKey)view.createElement(IWDDropDownByKey.class,
                                                                                    "inp" + i );
                   /** Trying to understand how I will handling binding. **/                                                       
                   // dropDown.bindSelectedKey()

    I think you are on the wrong track.
    You want to display the list of possible responses for a question in a dropdown list, right?
    Change your context structure into something like this:
    Questions (node, card=0:N)
    - Text (attribute, string)
    - Responses (node, card=0:N, singleton=false)
    -- Text (attribute, string)
    Now, to create questions and responses, you can use code like:
    IQuestionsElement q1 = wdContext.createAndAddQuestionsElement();
    q1.setText("First question");
    IResponsesElement r11 = q1.nodeResponses().createAndAddResponsesElement();
    r11.setText("First response to first question");
    IResponsesElement r12 = q1.nodeResponses().createAndAddResponsesElement();
    r12.setText("Second response to first question");
    Now you can use a dropdown list for selecting a question and a second dropdown list for selecting a response by code like this (or better, create them in the IDE):
    IWDDropDownByIndex questionSelector = (IWDDropDownByIndex) view.createElement(IWDDropDownByIndex.class, "QuestionSelector");
    questionSelector.bindTexts("Questions.Text");
    IWDDropDownByIndex responseSelector = (IWDDropDownByIndex) view.createElement(IWDDropDownByIndex.class, "ResponseSelector");
    responseSelector.bindTexts("Questions.Responses.Text");
    Additionally, assign an action to the "onSelect" event of the question selector to trigger a server roundtrip when the selection changes. This leads to a change of the lead selection in node "Questions" which in turn leads to filling the second dropdown list with the responses for the selected question.
    Armin

Maybe you are looking for

  • Vendor posted checks configuration

    hi, can any bodey help me out in doing config settings for vendor post dated checks issuing with regards, jaya prakash

  • Where do I see what recent purchases are made on my account?

    How do I find out what recent purchases are made to my account? I had an old email attached to it so I did not get the email receipt.  I have no idea what recent charges are for. I can't see anywhere that it lets me review all my purchases.  They may

  • ITunes movies won't play after backing up library

    I recently ran out of hard drive space on my macbook pro so I decided to move my iTunes library to an external hard drive to make space. Since doing so the movies that I bought on Itunes won't play. Everything else is fine. The music plays but the TV

  • Ordered Lenovo G780 recovery CD's

    Hello everybody, Since my Lenovo G780 (modelnr. 2182) crashed and I had to do a reinstall, it doesn't function properly anymore. My networkadapters don't seem to pick up any wireless network at all. Now I ordered a recovery disk package to completely

  • Firefox is viewing oddly.

    For some reason, Firefox's appearance is unusual. Instead of a fullscreen webpage between the bookmarks and status bars, there is a black ground and an inset with the webpage in it. It only works on one tab.