Controlling Element Tags using Nested Elements

When I use the below I get:
<?xml version = '1.0'?>
<FSAATLAS>
<STUDENT>
<OBJECT_NAME>ADDRESS_T</OBJECT_NAME>
<INNER_ELEMENT>
<INNER_ELEMENT_ROW num="1">
<DUMMY>X</DUMMY>
</INNER_ELEMENT_ROW>
</INNER_ELEMENT>
</STUDENT>
</FSAATLAS>
How do I get the INNER_ELEMENT_ROW and num="1" from
appearing in the NESTED ELEMENT!!!
Best Regards,
James Colestock
import java.sql.*;
import oracle.jdbc.OracleDriver;
import oracle.xml.sql.query.*;
import org.w3c.dom.*;
import oracle.xml.parser.v2.*;
public class XML {
public XML() {
private static final String QUERY = "select object_name, CURSOR(select dummy as dummy from dual) as INNER_ELEMENT from user_objects";
public static void main(String[] args) throws Throwable {
Connection c = getConnection();
OracleXMLQuery q = new OracleXMLQuery(c,QUERY);
q.setCollIdAttrName("");
q.setCollIdAttr("");
q.setRowIdAttrName("");
q.setRowIdColumn("");
q.setRowsetTag("FSAATLAS");
q.setRowTag("STUDENT");
q.useNullAttributeIndicator(false);
q.useTypeForCollElemTag(false);
String s = q.getXMLString();
System.out.println(s);
q.close();
/*q = new OracleXMLQuery(c,QUERY);
s = q.getXMLMetaData(OracleXMLQuery.SCHEMA,false);
System.out.println(s);
q.close();
q = new OracleXMLQuery(c,QUERY);
Document d = q.getXMLDOM(OracleXMLQuery.SCHEMA);
((XMLDocument)d).print(System.out);
q.close();
q = new OracleXMLQuery(c,QUERY);
s = q.getXMLString(OracleXMLQuery.SCHEMA);
System.out.println(s);*/
public static Connection getConnection() throws SQLException {
String username = " james";
String password = "masterjames";
String thinConn = "jdbc:oracle:thin:@localhost:1526:PORTLAND";
Driver d = new OracleDriver();
return DriverManager.getConnection(thinConn,username,password);
}

When I use the below I get:
<?xml version = '1.0'?>
<FSAATLAS>
<STUDENT>
<OBJECT_NAME>ADDRESS_T</OBJECT_NAME>
<INNER_ELEMENT>
<INNER_ELEMENT_ROW num="1">
<DUMMY>X</DUMMY>
</INNER_ELEMENT_ROW>
</INNER_ELEMENT>
</STUDENT>
</FSAATLAS>
How do I get the INNER_ELEMENT_ROW and num="1" from
appearing in the NESTED ELEMENT!!!
Best Regards,
James Colestock
import java.sql.*;
import oracle.jdbc.OracleDriver;
import oracle.xml.sql.query.*;
import org.w3c.dom.*;
import oracle.xml.parser.v2.*;
public class XML {
public XML() {
private static final String QUERY = "select object_name, CURSOR(select dummy as dummy from dual) as INNER_ELEMENT from user_objects";
public static void main(String[] args) throws Throwable {
Connection c = getConnection();
OracleXMLQuery q = new OracleXMLQuery(c,QUERY);
q.setCollIdAttrName("");
q.setCollIdAttr("");
q.setRowIdAttrName("");
q.setRowIdColumn("");
q.setRowsetTag("FSAATLAS");
q.setRowTag("STUDENT");
q.useNullAttributeIndicator(false);
q.useTypeForCollElemTag(false);
String s = q.getXMLString();
System.out.println(s);
q.close();
/*q = new OracleXMLQuery(c,QUERY);
s = q.getXMLMetaData(OracleXMLQuery.SCHEMA,false);
System.out.println(s);
q.close();
q = new OracleXMLQuery(c,QUERY);
Document d = q.getXMLDOM(OracleXMLQuery.SCHEMA);
((XMLDocument)d).print(System.out);
q.close();
q = new OracleXMLQuery(c,QUERY);
s = q.getXMLString(OracleXMLQuery.SCHEMA);
System.out.println(s);*/
public static Connection getConnection() throws SQLException {
String username = " james";
String password = "masterjames";
String thinConn = "jdbc:oracle:thin:@localhost:1526:PORTLAND";
Driver d = new OracleDriver();
return DriverManager.getConnection(thinConn,username,password);
}

Similar Messages

  • How to change the default element tag using dbms_xmlgen

    here is my code that generate output for purchase order data. I followed the syntax shown in xml db developer guide.
    I am getting the results but element tags are CAPS letters( As the coloumn names in the type defenitions are stored in CAPS in Oracle). but I need to show in small letters as per my requirement.
    can anyone help me how to change the default tag names for elements.
    ==================================HERE IS THE CODE==================
    DECLARE
    qryCtx DBMS_XMLGEN.ctxHandle;
    result CLOB;
    BEGIN
    qryCtx := DBMS_XMLGEN.newContext
    ('SELECT PODL_H_T
    ( CLOSEDDATETIME ,
    COMPANY ,
    CAST(MULTISET
    (SELECT LINENUMBER ,
    COMPANY ,
    PURCHASEORDERID ,
    ITEM ,
    QUANTITYUM ,
    TOTALQUANTITY
    FROM cpo_wms_podl_LINES
    WHERE PURCHASEORDERID = PH.PURCHASEORDERID) as PurchaseOrderDetailList
    FROM cpo_wms_podl_HEADERS PH ');
    -- now get the result
    DBMS_XMLGEN.setRowSetTag(qryCtx, 'Receipts' );
    DBMS_XMLGEN.setRowTag(qryCtx, 'PurchaseOrder' );
    result := DBMS_XMLGEN.getXML(qryCtx);
    INSERT INTO temp_clob_tab VALUES (result);
    DBMS_XMLGEN.closeContext(qryCtx);
    END;
    -- select * from temp_clob_tab
    ===========create type script=====================
    cpo_wms_podl_HEADERS
    CREATE or replace TYPE PurchaseOrderDetail AS OBJECT(
    LINENUMBER VARCHAR2(400 BYTE),
    COMPANY VARCHAR2(400 BYTE),
    PURCHASEORDERID VARCHAR2(400 BYTE),
    ITEM VARCHAR2(400 BYTE),
    QUANTITYUM VARCHAR2(400 BYTE),
    TOTALQUANTITY NUMBER
    create type PurchaseOrderDetailList as table of PurchaseOrderDetail
    create table temp_clob_tab(result CLOB)
    create type podl_HEADERS_list_t as table of podl_HEADERS_t
    CREATE or replace TYPE PODL_H_T AS OBJECT
    CLOSEDDATETIME DATE,
    COMPANY VARCHAR2(400 BYTE),
    CREATEDDATETIME DATE,
    PURCHASEORDERID VARCHAR2(400 BYTE),
    SHIP_TO VARCHAR2(400 BYTE),
    linelist PurchaseOrderDetailList
    )

    but I need to show in small letters as per my requirement.add alias column names in double quotes as in
    SQL> select dbms_xmlgen.getxmltype('select dname "DeptName", loc "Location" from dept') dept_xml from dual
    DEPT_XML                                                                       
    <ROWSET>                                                                       
      <ROW>                                                                        
        <DeptName>ACCOUNTING</DeptName>                                            
        <Location>NEW YORK</Location>                                              
      </ROW>                                                                       
      <ROW>                                                                        
        <DeptName>RESEARCH</DeptName>                                              
        <Location>DALLAS</Location>                                                
      </ROW>                                                                       
      <ROW>                                                                        
        <DeptName>SALES</DeptName>                                                 
        <Location>CHICAGO</Location>                                               
      </ROW>                                                                       
      <ROW>                                                                        
        <DeptName>OPERATIONS</DeptName>                                            
        <Location>BOSTON</Location>                                                
      </ROW>                                                                       
      <ROW>                                                                        
        <DeptName>SALES</DeptName>                                                 
        <Location>MUNICH</Location>                                                
      </ROW>                                                                       
    </ROWSET>                                                                      
    1 row selected.

  • How to use single element as both control as well as indicator in labview

    Hi All,
    I need to use single element for both control and as an indicator.
    I need not want to use its value property os shift register.

    Hi pmg,
                I think this thread will be helpful to you.
               http://forums.ni.com/t5/LabVIEW/Using-a-control-as-both-an-indicator-and-control/td-p/1113158 
    Thanks as kudos only

  • Photoshop and elements 13  Working in iPhoto Want to edit image using photoshop elements Did the following  IPhoto Preferences Advanced Edit Photos: In drop down menu chose in Photoshop Elements  Also control click and chose edit in external editor  Drop

    Photoshop and elements 13
    Working in iPhoto
    Want to edit image using photoshop elements
    Did the following
    IPhoto>Preferences>Advanced>Edit Photos: In drop down menu chose in Photoshop Elements
    Also control click and chose edit in external editor
    Drop down menu edit photos in external program>photoshop Elements
    Go to to the image I'm working on  --- selected the image, the clicked on edit. When nothing happened I double clicked the image. Still elements didn't open. Then I opened the Elements editor, went back to iphoto and tried the entire process again. the photo still didn't open on Elements 13 for editing.
    I have 3 Elements 13 books as well as looked on line--all my references say the exact same thing ---- iPhoto>Preferences>advanced>edit in external program>photoshop Elements
    I uninstalled and reinstalled both iPhoto as well as Elements.
    I spoke with application technical support.  There appears to be nothing wrong with my copy of iPhoto.  However there is no support from Adobe.  I waited for over 1.5 hours for chat support several days ago, and finally gave up.

    You are probably choosing the obvious file rather than the correct file as the PSE editor. The actual editor is hidden away inside the Support Files folder. The PSE file at the top level of the PSE folder in Applications is just an alias for the welcome screen and what you're describing is exactly what happens when you choose that. You want this one:

  • Question about xml schemas and the use of unqualified nested elements

    Hello,
    I have the following schema:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
        xmlns="http://xml.netbeans.org/examples/targetNS"
        targetNamespace="http://xml.netbeans.org/examples/targetNS"
        elementFormDefault="unqualified">
        <xsd:element name="name" type="xsd:string"/>
        <xsd:element name="age" type="xsd:int"/>
        <xsd:element name="person">
            <xsd:complexType>
                <xsd:sequence>
                    <xsd:element ref="name"/>
                    <xsd:element ref="age"/>
                   <xsd:element name="height" type="xsd:int"/>
                </xsd:sequence>
            </xsd:complexType>
        </xsd:element>
    </xsd:schema>I am just wondering why would someone have a nested element that is unqualified? here the "height" element.
    Can anyone explain this to me please?
    Thanks in advance,
    Julien.
    here is an instance xml document
    <?xml version="1.0" encoding="UTF-8"?>
    <person xmlns='http://xml.netbeans.org/examples/targetNS'
      xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
      xsi:schemaLocation='http://xml.netbeans.org/examples/targetNS file:/E:/dev/java/XML/WebApplicationXML/web/newXMLSchemaThree.xsd'>
    <name>toto</name>
    <age>40</age>
    <height>180</height>
    </person>

    Don't worry about it.
    There are two different styles of schemas. In one style, you define the elements, attributes, etc. at the top, and then use the "ref" form to refer to them. (I call this the "global" style.) The other style is to define elements inline where they are used. ("local" style)
    Within some bounds, they work the same and which you use is a choice of you and the tools that generate the schemas.
    A warning about the local style. It is possible to define an element in two different locations in the schema that are different. It will get past all schema validation, but it seems wrong to my sense of esthetics. With the global style, this will not happen.
    So, how did this happen? Probably one person did the schema when it only had a name and age. Then, someone else added the height element. They either used a different tool, or preferred the other style. I'm aware of no difference in the document you have described between the two styles.
    Dave Patterson

  • Create XML element without closing tag using Visual C++

    I know how to create xml element with closing tag (using WriteStartElement and WriteEndElement methods)
    <tag id="1234">
    </tag>
    but is there a way in Visual C++ to produce xml element like this
    <tag id="1234"/>
    i.e. without closing tag?

    Hi adamay,
    Please refer to this thread.
    http://stackoverflow.com/questions/8182245/create-xml-element-without-closing-tag-using-xslt
    I think you could try the way of write your own class derived from XmlWriter.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Step By step Procedure to control Pm orders Budget by using Wbs element

    HI,
    we need step by step procedure to control PM orders Budget By using WBS  Element, step by step means
    1. how to create wbs element
    2 how to assign budget to wbs element
    3 how to control this budget through orders
    Regards
    Ganesh

    Hi,
    Please verify this link:
    http://www.sap-img.com/ps006.htm
    Regards
    Keerthi

  • The Element tag for CSS - how to use it?

    Hi,
    I was watching this video and this guy was using Inspect Element in Chrome to identify things he wanted to change in a web page.  I remember him using this a lot:
    element.style {
    ...and then write in Dreamweaver the changes to his CSS.  I've not been able to figure out what that above element.style means though.  Can someone help explain what it is?  Do I need to use it every time I want to add a change to my existing CSS file?  Sorry this is a vague question but I just want to understand it better.  For some reason, I've gone to W3 school and still can't find anything.
    Thanks.

    At a guess
    element.style {
    is a generic term meaning exactly that.
    element is the element that is being referenced as in p, div, span, h2 etc, etc.
    .style is the class that has been assigned to the element for identification.
    If we wanted to change the colour of the text of a particular heading we would use
    h2.red {
         color: red;
    and our markup would look like
    <h2 class="red">This is my red heading</h2>

  • XML element tag problem

    Hi guys,
    I am facing a problem in parseing a XML file when the element is in <element/> tag format. Iam using "javax.xml.parsers.SAXParser" to parse the XML. Basically XML contains many fields that are mandatary in my XSD. my requirement is that if there is a SAXParseException, I should get the name of the element for which the error is comming.
    What I am doing is, I am storing the name of the element in startElement method, which I print it in the catch block of the error. This code is working fine for <element></element> type of tag. But when the element tag is <element/> this. it does not go in the startElement or endElement block. Hence I always get the name element which is previous to the error element.
    How can I get the element name in both form of the element tag. As I have no control over the XML, which is posted on my servlet.

    I'm not sure why you're having a problem - the SAXException tells you where in the input stream the error is, and SAX parsers may report a validation error at any time so long as it is before passing the invalid element to the content handler. So it's legal for the exception to occur immediately after the startDocument, and will not necessarily occur immediately after the callback for the preceding element.
    Eg, if the DTD says you have <!ELEMENT foo (a,b,c,d)> and you have <foo><a/><b/><x/><d/></foo>, then the parser may well report the error before the startElement() call for the foo element, as it is invalid. Such fail-fast parser validation means you can safely update a persistant resource on receipt of the events, rather than having to wait until the element is closed before you are sure it's valid.
    This works fine for <element/> tag. But now there is a problem with <element></element> tag.Post the code you have, show how you are mapping from the line no. in the exception to the source data, and state which parser you are using.
    Pete

  • Accessing element in a nested arraylist

    Hi,
    I have a LinkedHashMap that contains ArrayLists. Something like this:
    {color:#3366ff}
    ArrayList list = new ArrayList();
    ArrayList list2 = new ArrayList();
    LinkedHashMap<Integer, ArrayList> map = new LinkedHashMap<Integer, ArrayList>();
    list.add(0, "list1 row1");
    list.add(1, "list1 row2");
    list.add(2, "list1 row3");
    list2.add(0, "list2 row1");
    list2.add(1, "list2 row2");
    list2.add(2, "list2 row3");
    map.put(0, list);
    map.put(1, list2);{color}
    How can I iterate over the elements in the arrays in the map in a JSP page?
    Do I need to use the nested tag? Can anyone show me an example of how to print out e.g. "list1 row1"?
    Thanks.

    If you're using JSP 2.0, you can interate over nested lists using nested <c:forEach ....> tags.
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <%@ page import="java.util.*" %>
    <% // ugly scriptlet code that belongs somewhere else.
       // used here for demonstration purposes only.
      List rows = new ArrayList();
      request.setAttribute("rows", rows);
      for(int i = 1; i <=12; i++){
        List cols = new ArrayList();
        for(int j = 1; j <=12; j++){
          cols.add(String.valueOf(i * j));
        rows.add(cols);
    %>
    <html>
      <head>
        <title>nested forEach tags</title>
      </head>
      <body>
        <table border="1">
          <c:forEach var="row" items="${rows}">
            <tr>
              <c:forEach var="col" items="${row}">
                <td>${col}</td>
              </c:forEach>
            </tr>
          </c:forEach>
        </table>
      </body>
    </html>Edited by: ben_souther on Sep 13, 2007 2:57 PM

  • Why use Lightroom if I'm currently using Photoshop Elements?

    Have been using photoshop elements for a long time, but many (most?) nonprofessionals I know are using lightroom, sometimes in conjunction with photoshop suites.  Is there a reason to add lightroom to the arsenal?

    For me, and this is just my opinion, Lightroom has better cataloging and
    import options but both have strengths and weaknesses. You have a lot of
    power to catalog and edit your images using Lightroom/Photoshop but with
    that power comes complexity. Some people don't want to deal with moving
    their images from Lightroom, to Photoshop and back to Lightroom. However,
    if you need to be able to use a complex naming scheme for your images
    (dates, places & a sequence number) or nested keywords (tags) or you want
    to be able to adjust images on a tablet while away from your main catalog
    then Lightroom may be worth investigating. You can download and take it for
    a 30-day spin.

  • How do I set the thumbnail image of my videos that export to my computer?  I'm using Premiere Elements 11 on a windows 8.1 PC 64bit.

    How do I set the thumbnail image of my videos that export to my computer?  I'm using Premiere Elements 11 on a windows 8.1 PC 64bit.
    Or how does Premiere 11 determine where to set the image for the video it is exporting? 
    I already know how to use Freeze frame and save the image to my computer by Publish+Share/Computer/ Immage.
    Thanks,
    Mike

    Mike
    This is not Adobe. Rather user to user. We are all visitors here.
    Just a bit of history....back in the days of Premiere Elements 4, you could set a "poster frame" in what was called the Project area. You did this by right clicking a blank area there and, from the drop down menu that appeared, selecting View/Preview Area, and using the poster frame feature there.
    As I said, when a video imports into Premiere Elements, the thumbnail of the import has been presenting as the first frame of the video. With this Preview area "poster frame" option, you could set the video's thumbnail in the Project area so that the first frame was another frame in the video. But, this "perk" was restricted to thumbnails of the video in Project area.
    If you exported to file with the first frame modified video, the export's thumbnail in Windows Explorer would present with other than the real first frame or the poster frame as the first frame.
    Also, in more recent versions, I have observed that the export to file does not display the real first frame of the video in Windows Explorer. Seems random, but I have not kept track.
    And, remember, at the onset I wrote
    As far as I have ever seen, Premiere Elements Windows uses the first frame of the video for its thumbnail in the program.
    I know of no way within Premiere Elements to control what the program opts to do in this matter. In some compatibility
    issues, it opts to give no image but a generic one.
    I did not say that you can expect to have the Premiere Elements' export file's thumbnail in Windows displaying with its real first frame. And, the more you get into this, depending on the versions, more details need to be added to my comment about "...first frame of video for its thumbnail in the program..."
    I would have to look into all this further to get perspective on the contributing factors.
    ATR
    Add On...The Poster Frame feature appeared in versions 4, 7, 8, and 9 by my count.

  • How do I use Premiere Elements 9 to synch and mix 2 video feeds?

    I am trying to put together a wrestling television show using Premiere Elements 9. We use 2 different cameras, a stationary hard camera and a moving ring camera. In the past I have used an Avio system where I manually synched the 2 feeds and then I was able to drag and drop the ring camera feed on to the stationary hard camera.  How do I do this function using this software? Thanks!

    Welcome to the forum.
    Unfortunately, PrE does not have direct multi-cam functionality. PrPro does, allowing one to sync up to 4 cameras, and if you Nest Multi-camera Sequences, you can do more, though not quite so easily as with four.
    With PrE, it's probably easiest to place your main camera Clip(s) on Video Track 1, and edit that as needed. Then, bring in the second camera's Clip(s) onto Video Track 2, and reduce the Fixed Effect>Opacity to ~ 40 - 50%, so that you can "see through" them. Then, adjust those, Trimming, as desired, leaving gaps between them. When done, change the Effect>Opacity back to 100%. Transitions can then be applied, if desired, to the Head & Tail of each of those Video Track 2 Clips.
    So long as the footage from the two cameras is the same Frame Size, and also matches the Project's Preset Frame Size, nothing more needs to be done, as the footage on Video Track 2 will just visually replace any Frames on Video Track 1.
    If you do much multi-cam work, PrPro might be a great investment, as it's Multi-Camera feature will make life so very, very easy.
    Good luck,
    Hunt
    PS - it seems that a few months ago, there was another multi-cam question here, and that Steve Grisetti had a slightly different workflow, than the one that I described. I will post a link to that thread, if I can find it.

  • How can I access the sub elements of the Nested Cluster-2

    would like to know the label a sub element of a Nested Cluster. I have included the vi. I am trying to programmetically read the Text label of the data elements in Value N mode cluster (Max , Min Mode). I was looking into the Type descriptor document. It can tell me how many and what type of elements are in the cluster. But it does not gove me Refnum to those objects.
    Let me know if you have an solution to my question."
    Attachments:
    cluster_1.vi ‏24 KB

    Hi
    You need to do a recursion. If the reference you get from the array "controls[]" if of type cluster, then you have to loop through recursively.
    Openg toolkit has variant tools that might be of some help to you (www.openg.org).
    Good luck
    PJM
    Got EasyXML?
    JKI.VIPM.EasyXML.OpenG.LAVA.Builder.blog

  • When using Photoshop Elements 9 as external editor my iPhoto version does not update

    I am using Photoshop Elements 9 as an external editor in iPhoto V9.4.2
    My photo's are Raw and they open in Elements fine for me to edit. When I go to save or exit I have problems. I get options to choose from - I am assuming that saving them as JPEG now they are edited is the best choice. However it shows me a file location where it will be saved and this is not the iPhoto libary. Even so, I save them where PSE wants to and when I go back to them in iPhoto they are not shown as edited (either in preview thumbnail or full version and regardless of which folder I look at them from). I shut iPhoto down and re-open and still they are not changed. I have watched the Adobe lesson on this and it is identical right up to the point of 'saving'. I have read other question on this and followed some advice but not getting the desired result of showing up in iPhoto still.
    Thank you.

    Are you using PSE and saving the edit as described below?
    Using Photoshop or Photoshop Elements as Your Editor of Choice in iPhoto.
    1 - select Photoshop or Photoshop Elememts as your editor of choice in iPhoto's General Preference Section's under the "Edit photo:" menu.
    2 - double click on the thumbnail in iPhoto to open it in Photoshop.  When you're finished editing click on the Save button. If you immediately get the JPEG Options window make your selection (Baseline standard seems to be the most compatible jpeg format) and click on the OK button. Your done. 
    3 - however, if you get the navigation window
    that indicates that  PS wants to save it as a PS formatted file.  You'll need to either select JPEG from the menu and save (top image) or click on the desktop in the Navigation window (bottom image) and save it to the desktop for importing as a new photo.
    This method will let iPhoto know that the photo has been editied and will update the thumbnail file to reflect the edit..
    NOTE: With Photoshop Elements  the Saving File preferences should be configured as shown:
    I also suggest the Maximize PSD File Compatabilty be set to Always.  In PSE’s General preference pane set the Color Picker to Apple as shown:
    Note:  to switch between iPhoto and PS or PSE as the editor of choice Control (right)-click on the thumbnail and select either Edit in iPhoto or Edit in External Editor from the contextual menu. If you use iPhoto to edit more than PSE re-select iPhoto in the iPhoto General preference pane. Then iPhoto will be the default editor and you can use the contextual menu to select PSE for your editor when desired.
    OT

Maybe you are looking for