Append Child symbols from XML and more

Hello,
I am trying to dynamically create set of symbols and change their contents from an XML
I've managed to get the XML part and creating the Div dynamically.
What I didn't got is how to apply data from XML to inner symbol divs
such as <name>something</name> from the XML to text div in EDGE
is there a way to control/access the newly created Symbols?
Attaching the project so far.
http://www.elijahu.net/download/append.zip
Thanks for your Help.
Elijahu.

==> Positioning a Dynamically Created Symbol
Well,
To change the entire instance, you use: .getSymbolElement().css(...)
To change an instance element, you use: .$("elementName").css(...)
$(xml).find('listing').each( function(){
                var itemRenderer = sym.createChildSymbol("itemRenderer", "xmlContainer");
                itemRenderer.getSymbolElement().css("display": "inline-block");
                itemRenderer.$('name').html($(this).find('name').text());
                itemRenderer.$('textBox').html($(this).find('text').text()).css("color","white");

Similar Messages

  • How to extract data from xml and insert into Oracle table

    Hi,
    I have a large xml file. which will have hundreds of the following transaction tags having column names and there values.
    There is a table one of the schema with coulums "actualCostRate","billRate"....etc.
    I need to extract the values of these columns and insert into the table
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuUK" chargeCode="LCOCD1" externalID="L-RESCODE_UK1-PROJ_UK_CNT_GBP-37289-8" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-12" transactionType="L" units="11" taskID="5017601" inputTypeCode="SALES" groupId="123" voucherNumber="ABCVDD" transactionClass="ABCD"/>
    <Transaction actualCostRate="0" billRate="0" chargeable="1" clientID="NikuEU" chargeCode="LCOCD1" externalID="L-RESCODE_US1-PROJ_EU_STD2-37291-4" importStatus="N" projectID="TESTPROJ" resourceID="admin" transactionDate="2002-02-04" transactionType="L" units="4" taskID="5017601" inputTypeCode="SALES" groupId="124" voucherNumber="EEE222" transactionClass="DEFG"/>

    Re: Insert from XML to relational table
    http://www.google.ae/search?hl=ar&q=extract+data+from+xml+and+insert+into+Oracle+table+&btnG=%D8%A8%D8%AD%D8%AB+Google&meta=

  • How to fetch data from XML and store it in internal table

    Hi All,
    Can anyone help me out, in fetching data from xml and store it in an internal table. Is there any standard function module is there?
    Regards,
    Karthick

    to do this you can either develop a XSLT program and use it with CALL TRNSFORMATION key word to tranform the XML into itab .
    (search the ABAP General forum, i have posted few samples)
    or simply use the following FM which converts your XML into a itab of name value pair (name would holw the element name and value would hold the value of the element) which you can then loop and read it to your itb.
    data:             xmldata type xstring .
    data: result_xml type standard table of smum_xmltb .
    data: return type standard table of bapiret2 .
    CALL FUNCTION 'SMUM_XML_PARSE'
      EXPORTING
        xml_input       = xmldata
      TABLES
        xml_table       = result_xml
        return          = return .
    Regards
    Raja

  • Why does my mrs phone keep getting my contacts from iCloud and more importantly how do i stop it!?

    Hey guys an gals sorry if this has been asked 100's times before but...
    Why does my mrs phone keep getting my contacts from iCloud and more importantly how do i stop it!?
    Thanks for your help :-)

    Thanks for you reply, she already has her own account and wants to back her own contacts up to the cloud, we have tried turning both contacts off in icloud settings, also deleting from phone when prompted, then, we also deleted all her icloud backups to start a fresh. However soon as she turns contacts back on.. Bam they re appear. We also have ipad in the mix so we did the same to that, turned off and deleted contacts on there also to no avail. Somehow they are linked to my acount just cant work out how or where?

  • Generate HTML from XML and XSLT

    Hi,
    I have asked in different forum but did not get my answer so asking here again
    i want to generate a HTML file from XML and XSLT in a temp folder and then read it into a java.lang.String, so can email it or write to a database file.
    how can i do it, is there any engine which will merger XML and XSLT and give a HTML file or a String as output
    Ashish

    Hi,
    Follow the simple steps.
    1) Create XML Document (I hope u have it)
    2) Create XSL Stylesheet for your XML document
    3) Put both files in one directory some where in your local system or web server upto u
    4) Invoke the XML document from webbrowser and you are done.
    http://localhost/test/Catalog.xml OR C:\XXXXDIR\test\Catalog.xml
    For Ex: XML File Content, Catalog.xml
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <?xml-stylesheet type="text/xsl" href="Catalog.xsl"?>
    <catalog>
    <cd>
    <title>Empire Burlesque</title>
    <artist>Bob Dylan</artist>
    <country>USA</country>
    <company>Columbia</company>
    <price>10.90</price>
    <year>1985</year>
    </cd>
    </catalog>
    XSL File Content: Catalog.xsl
    <?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="/">
    <html>
    <body>
    <h2>My CD Collection</h2>
    <table border="1">
    <tr bgcolor="#9acd32">
    <th align="left">Title</th>
    <th align="left">Artist</th>
    </tr>
    <xsl:for-each select="catalog/cd">
    <tr>
    <td><xsl:value-of select="title"/></td>
    <td><xsl:value-of select="artist"/></td>
    </tr>
    </xsl:for-each>
    </table>
    </body>
    </html>
    </xsl:template></xsl:stylesheet>

  • Delete child symbol from stage

    Hi All,
    I need help deleting a symbol from the stage.  I have a list of symbols that are called to the stage at some point in a simulation. When the user leaves one symbol, it is supposed to delete itself and call up another (specific) symol.  For example.  I called the symbol “AR-HistAims” to the stage using
    var mySymbolObject = sym.createChildSymbol("AR-HistAims", "Stage");
                mySymbolObject.getSymbolElement().css({'position':'absolute','left': (mouseX - offset.left)/sx , 'top': (mouseY - offset.top)/sy});
                mySymbolObject.play();
    This works fine.  I place an invisible button in the symbols timeline and when it is clicked I want it to do two things. 
    call up “AR-percPass” (using the same code as above with a percPass in place of HistAims)
    remove “AR-HistAims” from the stage. 
    I can’t seem to get #2 to work.  I’ve tried codes below and above the code for #1.  When placed above, it deletes the current symbol, but doesn’t call up the new one.  When placed below, the new symbol appears on top of the old one.  The codes I've used are:
                var childSymbols=sym.getComposition().getSymbols("AR-HistAims");
                for(var i=0; i<childSymbols.length; i++)
                childSymbols[i].deleteSymbol();
    //and
                var mySymbolObject = sym.getParentSymbol().getSymbol("mySymbol").getVariable("AR-HistAims");
                stage.deleteSymbol();
    //and
    sym.getParentSymbol().deleteSymbol();
    Any advice would be appreciated.
    Thanks
    Randy

    Hi Randy,
    There are a few corrections you need to make in index_edgeAction.js file like as follows:
    1. In click handler, you don't have access to  mouseX, offset, sx, sy etc.
         mySymbolObject.getSymbolElement().css({'position':'absolute','left': (mouseX - offset.left)/sx , 'top': (mouseY - offset.top)/sy});
         So, make it like this:
         mySymbolObject.getSymbolElement().css({'position':'absolute','left': 0 , 'top': 0});
         Make these kind of changes for every click handler where you have used mouseX, offset, sx, sy etc, with appropriate left and top values.
    2. Just search for sym.getSymbolElement().deleteSymbol(); and replace it with sym.deleteSymbol();
    3. Comment out line#1366  having statement sym.deleteSymbol ();
    4. Search for sym.getSymbol(home).deleteSymbol(); and replace all such occurences with sym.getSymbol("home").deleteSymbol();
    With the above changes, things will work.
    hth,
    Vivekuma

  • Loading settings from xml and applying

    Hi,
    I've got an xml where im writing certain settings of a application. This is what the xml looks like;
    <?xml version="1.0" encoding="UTF-8" ?>
    - <PTMViewProfile>
    - <viewProfile>
      <testSequences />
      <projectName tag="default" />
    - <tsFrames>
      <tsFrame tag="bvcbvc" maximised="true" />
      <tsFrame tag="bvbv" maximised="true" />
      </tsFrames><projectName tag="default" /> - This is the project name
    - <tsFrames> - These are the JInternalFrames (Instance of tsFrames) for that specific project.
    <tsFrame tag="bvcbvc" maximised="true" />
    <tsFrame tag="bvbv" maximised="true" />
    </tsFrames>
    The project is stored in a directory containing all the tsFrames.
    From the xml i have the code to read and write. But, i want to apply those settings so that when the application is reopened it looks at the xml and opens project and the tsFrames by looking at the xml.
    Can someone please help me with wrting a method that applies those settings and loads the application.

    Hi,
    Thanks for replying!
    I am new to java and i have created the read and write method by using examples from existing code.
    what i want to do is store the elements its reading into an array so that i can use it in another method to do things with it.
    The code below is reading element from xml
    List frame = XMLManager.getListOfNamedChildren(tsFrames, xmlFrameTag);
                   Iterator iterator = frame.iterator();
                   while (iterator.hasNext()) {
                        Element tsFrameElement = (Element) iterator.next();
                        String tag = XMLManager.getAttributeValue(tsFrameElement, "tag");
                        String maximised = XMLManager.getAttributeValue(tsFrameElement, "maximised");
                        storeTsFrame.add(new TSFrameSettings(tag, maximised));I want to use a for each loop to read each line in the xmlFrametag by replacing the while
    can someone help me with this please!

  • How to extract a single column from XML and load in Oracle

    Hi
    below I have a structure of xml files , I just need to extarct <RecordReference>PQPMID:7358</RecordReference>
    from file and load in to oracle ..
    Please let me know how to do ..??
    file content below
    HoldingsRecord>
    <RecordReference>PQPMID:7358</RecordReference>
    <NotificationType>00</NotificationType>
    <SerialVersion>
    <SerialVersionIdentifier>
    <SerialVersionIDType>07</SerialVersionIDType>
    <IDValue>1068624X</IDValue>
    </SerialVersionIdentifier>
    <SerialVersionIdentifier>
    <SerialVersionIDType>01</SerialVersionIDType>
    <IDTypeName>PMID</IDTypeName>
    <IDValue>7358</IDValue>
    </SerialVersionIdentifier>
    <Title>
    <TitleType>02</TitleType>
    <TitleText>Pittsburgh Post - Gazette</TitleText>
    </Title>
    <Publisher>
    <PublishingRole>01</PublishingRole>
    <PublisherName>Post Gazette Publishing Company</PublisherName>
    </Publisher>
    <OnlinePackage>
    <OnlineServiceName>ProQuest</OnlineServiceName>
    <Website>
    <WebsiteRole>03</WebsiteRole>
    <WebsiteLink>http://proquest.umi.com/pqdweb</WebsiteLink>
    </Website>
    <HoldingsDetail>
    <JournalIssue>
    <JournalIssueRole>04</JournalIssueRole>
    <JournalIssueDate>
    <DateFormat>00</DateFormat>
    <Date>19930118</Date>
    </JournalIssueDate>
    </JournalIssue>
    <JournalIssue>
    <JournalIssueRole>06</JournalIssueRole>
    <JournalIssueDate>
    <DateFormat>00</DateFormat>
    <Date>20080915</Date>
    </JournalIssueDate>
    </JournalIssue>
    <EpubFormat>10</EpubFormat>
    </HoldingsDetail>
    </OnlinePackage>
    </SerialVersion>
    </HoldingsRecord>

    My mistake - thought you're looking for a general idea. Here's the working example:
    CREATE OR REPLACE PROCEDURE import_test (i_result_file IN XMLTYPE DEFAULT XMLTYPE(bfilename('XMLDIR','my_test.xml'),nls_charset_id('ALT32UTF8')))
    IS
    xml_rec XMLTYPE;
    v_index PLS_INTEGER;
    v_rec_ref VARCHAR2(30);
    BEGIN
    v_index := 1;
    WHILE i_result_file.Existsnode('/rec/HoldingsRecord['||To_Char(v_index)||']') > 0
    LOOP
    BEGIN
    --- Get the line
    xml_rec := i_result_file.Extract('/rec/HoldingsRecord['||To_Char(v_index)||']');
    CASE WHEN i_result_file.Existsnode('rec/HoldingsRecord['||To_Char(v_index)||']/RecordReference') > 0
    THEN v_rec_ref := xml_rec.extract('HoldingsRecord/RecordReference/text()').getStringVal();
    DBMS_OUTPUT.put_line('v_rec_ref: '||v_rec_ref);
    END CASE;
    EXCEPTION WHEN OTHERS THEN
    DBMS_OUTPUT.put_line('My Message: '||v_index||' '||SQLERRM);
    END;
    v_index := v_index + 1;
    END LOOP;
    END import_test;
    and here is my_test.xml I have used:
    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    <rec>
    <HoldingsRecord>
    <RecordReference>PQPMID:7358</RecordReference>
    <NotificationType>00</NotificationType>
    <SerialVersion>
    <SerialVersionIdentifier>
    <SerialVersionIDType>07</SerialVersionIDType>
    <IDValue>1068624X</IDValue>
    </SerialVersionIdentifier>
    <SerialVersionIdentifier>
    <SerialVersionIDType>01</SerialVersionIDType>
    <IDTypeName>PMID</IDTypeName>
    <IDValue>7358</IDValue>
    </SerialVersionIdentifier>
    <Title>
    <TitleType>02</TitleType>
    <TitleText>Pittsburgh Post - Gazette</TitleText>
    </Title>
    <Publisher>
    <PublishingRole>01</PublishingRole>
    <PublisherName>Post Gazette Publishing Company</PublisherName>
    </Publisher>
    <OnlinePackage>
    <OnlineServiceName>ProQuest</OnlineServiceName>
    <Website>
    <WebsiteRole>03</WebsiteRole>
    <WebsiteLink>http://proquest.umi.com/pqdweb</WebsiteLink>
    </Website>
    <HoldingsDetail>
    <JournalIssue>
    <JournalIssueRole>04</JournalIssueRole>
    <JournalIssueDate>
    <DateFormat>00</DateFormat>
    <Date>19930118</Date>
    </JournalIssueDate>
    </JournalIssue>
    <JournalIssue>
    <JournalIssueRole>06</JournalIssueRole>
    <JournalIssueDate>
    <DateFormat>00</DateFormat>
    <Date>20080915</Date>
    </JournalIssueDate>
    </JournalIssue>
    <EpubFormat>10</EpubFormat>
    </HoldingsDetail>
    </OnlinePackage>
    </SerialVersion>
    </HoldingsRecord>
    <HoldingsRecord>
    <RecordReference>PQPMID:9875</RecordReference>
    <NotificationType>00</NotificationType>
    <SerialVersion>
    <SerialVersionIdentifier>
    <SerialVersionIDType>07</SerialVersionIDType>
    <IDValue>1068624X</IDValue>
    </SerialVersionIdentifier>
    <SerialVersionIdentifier>
    <SerialVersionIDType>01</SerialVersionIDType>
    <IDTypeName>PMID</IDTypeName>
    <IDValue>7358</IDValue>
    </SerialVersionIdentifier>
    <Title>
    <TitleType>02</TitleType>
    <TitleText>Pittsburgh Post - Gazette</TitleText>
    </Title>
    <Publisher>
    <PublishingRole>01</PublishingRole>
    <PublisherName>Post Gazette Publishing Company</PublisherName>
    </Publisher>
    <OnlinePackage>
    <OnlineServiceName>ProQuest</OnlineServiceName>
    <Website>
    <WebsiteRole>03</WebsiteRole>
    <WebsiteLink>http://proquest.umi.com/pqdweb</WebsiteLink>
    </Website>
    <HoldingsDetail>
    <JournalIssue>
    <JournalIssueRole>04</JournalIssueRole>
    <JournalIssueDate>
    <DateFormat>00</DateFormat>
    <Date>19930118</Date>
    </JournalIssueDate>
    </JournalIssue>
    <JournalIssue>
    <JournalIssueRole>06</JournalIssueRole>
    <JournalIssueDate>
    <DateFormat>00</DateFormat>
    <Date>20080915</Date>
    </JournalIssueDate>
    </JournalIssue>
    <EpubFormat>10</EpubFormat>
    </HoldingsDetail>
    </OnlinePackage>
    </SerialVersion>
    </HoldingsRecord>
    </rec>

  • How to load images in List from Xml and view the image and resize the image & save in Flex?

    Hi Friends,
    I am new to flex i am doing application for image resizing rotating and save the resize image.
    I want to load the images from xml file to listcontrol and show that images as a icon in the listview,then i want to drag that image to panel that time it should show it original size of the Image.then it allows user to resize ,crop,rotate the image.then i want to save the resize image,when i save the resize image it should replace the original image in the xmllist.
    I am looking for some useful suggession ,if you dont mind want to see some snippet code.
    It will help me to understand the concept.
    Cheers,
    B.Venkatesan

    Not in Crystal Reports Basic for Visual Studio 2008. You'll have to upgrade to CR 2008 (12.x). Then use kbase [1320507|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do] as a guide on how to do this.
    Ludek

  • Using assign-activity:Append to append child nodes in XML-tree within loop

    I would like to produce an XML looking something like this (just an example):
    &lt;Customer&gt;
    &lt;Name&gt;Tom&lt;/Name&gt;
    &lt;Invoices&gt;
    &lt;Invoice&gt;
    &lt;InvoiceData&gt;.....&lt;/InvoiceData&gt;
    &lt;/Invoice&gt;
    &lt;Invoice&gt;
    &lt;InvoiceData&gt;.....&lt;/InvoiceData&gt;
    &lt;/Invoice&gt;
    &lt;/Invoices&gt;
    &lt;/Customer&gt;
    For different reasons (composite PK's in DB etc) I have to first get the Customer-data, and then get each Invoice for that customer.
    Then I have to loop the Invoices and append each Invoice-node to the XML, ending up with the whole thing when the loop is finished.
    This should be pretty simple (I guess), and I have tried different variations of the Append (assign activity), but everytime I end up with only the last Invoice-node.
    I can see in the Flow-window of the BPEL Console that it is not the same Invoice-node I'm appending within the loop-iterations, so that can not be the case in any way.
    In other words it seems to copy instead of appending.
    What is wrong ?
    Is this a bug in the Append function ?
    Any suggestions to other approaches that might work ? (I have to use the loop to get 1 and 1 Invoice-node though, and in that way put the whole XML together in some way)
    Edited by: user1694182 on 09.okt.2008 05:08

    Thank you for your answer.
    After taking your "debugging"-suggestions at hand and running some tests, I can now see that it gets appended in some way, but not correctly.
    1st LOOP ROUND:
    <installation>
    <measurePoints>
    <measurePoint><measurePointId>308</measurePointId>...</measurePoint>
    </mesurePoints>
    </installation>
    Correct so far.
    2nd LOOP ROUND:
    <installation>
    <measurePoints>
    <measurePoint><measurePointId>322</measurePointId>...</measurePoint>
    <measurePoint><measurePointId>322</measurePointId>...</measurePoint>
    </mesurePoints>
    </installation>
    So now it appends the new measurepoint, but overwrites the 1st as well... Strange..
    3rd LOOP ROUND (last round):
    <installation>
    <measurePoints>
    <measurePoint><measurePointId>382</measurePointId>...</measurePoint>
    <measurePoint><measurePointId>382</measurePointId>...</measurePoint>
    </mesurePoints>
    </installation>
    So suddenly the same Append doesn't append, but overwrites the 2 I had with the new measurepoint...Strange...
    WHAT I DO IN MORE DETAIL:
    1: Assign(copy) the whole XML in the 1st loop round. (Copy - FROM: submitInstallation_InputVariable - TO: Powel_InstallationServiceInput)
    2: Within each loop round I collect the whole XML with just 1 measurePoint (TransformActivity - FROM: DBAdapter-output - TO: submitInstallation_InputVariable).
    3: Within each loop round I then append the new measurePoint (collected in step 2) to the measurePoints-node. (Append - FROM: submitInstallation_InputVariable - TO: Powel_InstallationServiceInput)
    PS! I can see in the BPEL Console that it is a new measurePoint that gets collected in step 2, and just 1 node.
    Help/tips on this is very appreciated ! :-)
    Edited by: user1694182 on 14.okt.2008 00:57

  • How get all child elements from XML

    Hi
    I have one xml i tried to parse that xml using dom parser and i need to get some child elements using java
    <Group>
    <NAME>ABC</NAME>
    <Age>24</AgeC>
    ---------some data here......
    <Group1>
    <group1Category>
    <NAME>ABCTest</NAME>
    <age>27</Age>
    ----Some data here
    <group1subcategory>
    <subcategory>
    <NAME>ABCDEF</NAME>
    <age>28</Age>
    my intention was
    get group name (here ABC) i need all other name value from group1category ,group1 subcategory but pblm that
    my xml contains any number of Group nodes...but only i want name contains ABC
    i wriiten code like this
    DocumentBuilderFactory factory = DocumentBuilderFactory
    .newInstance();
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(xmlFile);
    NodeList nodeList = document.getElementsByTagName("*");
    for (int i = 0; i < nodeList.getLength(); i++)
    Element element = (Element) nodeList.item(i);
    what is next step i need to do..please help

    964749 wrote:
    Sorry for inconvenience caused..i only asked if any ideas i not ask any body to spent time for me...
    This is simple code developed using xpath..i not know how i proceed further
    public class Demo {
    public static void main(String[] args) {
    DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
    try {
    DocumentBuilder builder = domFactory.newDocumentBuilder();
    Document dDoc = builder.parse("hello.xml");
    XPath xpath = XPathFactory.newInstance().newXPath();
    javax.xml.xpath.XPathExpression expr = xpath.compile("//Group/NAME");
    Object Name= expr.evaluate(dDoc, XPathConstants.STRING);
    System.out.println(Name);
    } catch (Exception e) {
    e.printStackTrace();
    i need get group name (here ABC) i need all other name value from group1category ,group1 subcategory but pblm that
    ..how i done in XPATH and also do manipulation of remining result...
    i also try with DOM like
    NodeList nodeList = document.getElementsByTagName("GROUP");
    for (int i = 0; i < nodeList.getLength(); i++)
    Element element = (Element) nodeList.item(i);
    if (element.getNodeName().matches("ECUC-MODULE-DEF"))
    String str=((Element) nodeList.item(i)).getElementsByTagName("NAME").item(0).getFirstChild().getNodeValue();
    if(str.equalsIgnoreCase("abc")){
    NodeList children = element.getChildNodes();
    for (int k = 0; k < children.getLength(); k++) {
    Node child = children.item(k);
    System.out.println("children"+children.getLength());
    if (child.getNodeType() != Node.TEXT_NODE) {
    if(child.getNodeName().equalsIgnoreCase("Group1"))
    how iterate for particular ABC name to group1 and subcategoryFew things
    1. Use code tags to format code
    2. Explain the problem statement clearly. Take time to formulate your question. Explain what you expect from your code and what you are getting along with any exceptions that are being thrown

  • Reading from XML and printing on console

    I have an XML file like this
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ROOT SYSTEM "matches.dtd">
    <ROOT>
    <row>
    <field name="MatchNo">1</field>
    <field name="Date">2006-06-09</field>
    <field name="Time">18:00:00</field>
    <field name="Team1">Germany</field>
    <Team1_sc/>
    <field name="Team2">Costa Rica</field>
    <Team2_sc/>
    <field name="Venue">Munich</field>
    </row>
    <row>
    <field name="MatchNo">2</field>
    <field name="Date">2006-06-09</field>
    <field name="Time">21:00:00</field>
    <field name="Team1">Poland</field>
    <Team1_sc/>
    <field name="Team2">Ecuador</field>
    <Team2_sc/>
    <field name="Venue">Gelsenkirchen</field>
    </row>
    </ROOT>
    I have to print the Data on console
    I wrote a code for this
    import java.io.File;
    import org.w3c.dom.Document;
    import org.w3c.dom.*;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.DocumentBuilder;
    import org.xml.sax.SAXException;
    import org.xml.sax.SAXParseException;
    import java.util.*;
    import java.text.*;
    * Created on Mar 5, 2006
    * TODO To change the template for this generated file go to
    * Window - Preferences - Java - Code Style - Code Templates
    * @author Sandeep_Kongathi
    * TODO To change the template for this generated type comment go to
    * Window - Preferences - Java - Code Style - Code Templates
    public class XMLToConsole {
         String MatchNo = "";
         String Date = "";
         String Time = "";
         String Team1 = "";
         String Team2 = "";
         String Venue = "";
         int totalActionObject=0;
         try {
         DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
         DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
    //     System.out.println ("bbbbb");
         Document doc = docBuilder.parse (new File("C:\\matches.xml"));
    //      normalize text representation
         doc.getDocumentElement ().normalize ();
         /* For each child one  */
         NodeList MatchNo = doc.getElementsByTagName("MatchNo");
         Element MatchNoElement = (Element)MatchNo.item(0);
         NodeList textMatchNo = MatchNoElement.getChildNodes();
         MatchNo = ((Node)textMatchNo.item(0)).getNodeValue().trim();
         /* For each child one  */
         /* For each child one  */
         NodeList Date = doc.getElementsByTagName("Date");
         Element DateElement = (Element)Date.item(0);
         NodeList textDate = DateElement.getChildNodes();
         Date =  ((Node)textDate.item(0)).getNodeValue().trim();
         /* For each child one  */
         /* For each child one  */
         NodeList Time = doc.getElementsByTagName("Time");
         Element TimeElement = (Element)Time.item(0);
         NodeList textTime = TimeElement.getChildNodes();
         Time =((Node)textTime.item(0)).getNodeValue().trim();
         /* For each child one  */
         /* For each child one  */
         NodeList Team1 = doc.getElementsByTagName("Team1");
         Element Team1Element = (Element)Team1.item(0);
         NodeList textTeam1 = Team1Element.getChildNodes();
         Team1 = ((Node)textTeam1.item(0)).getNodeValue().trim();
         /* For each child one  */
         /* For each child one  */
         NodeList Team2 = doc.getElementsByTagName("Team2");
         Element Team2Element = (Element)Team2.item(0);
         NodeList textTeam2 = Team2Element.getChildNodes();
         Team2 = ((Node)textTeam2.item(0)).getNodeValue().trim();
         /* For each child one  */
         /* For each child one  */
         NodeList Venue = doc.getElementsByTagName("Venue");
         Element VenueElement = (Element)Venue.item(0);
         NodeList textVenue = VenueElement.getChildNodes();
         Venue = ((Node)textVenue.item(0)).getNodeValue().trim();
         /* For each child one  */
         NodeList listOfActionObject = doc.getElementsByTagName("row");
          totalActionObject= listOfActionObject.getLength();
          for(int s=0; s<listOfActionObject.getLength() ; s++){
          Node firstActionObjectNode = listOfActionObject.item(s);
                if(firstActionObjectNode.getNodeType() == Node.ELEMENT_NODE){
                    NodeList matchList = firstActionObjectElement.getElementsByTagName("MatchNo");
                    Element  matchElement = (Element)matchList.item(0);
                    NodeList textMatchList = matchElement.getChildNodes();
                   MatchNo =((Node)textMatchList.item(0)).getNodeValue().trim();
                    NodeList dateList = firstActionObjectElement.getElementsByTagName("Date");
                    Element dateElement = (Element)dateList.item(0);
                    NodeList textDateList = dateElement.getChildNodes();
                  Date =((Node)textDateList.item(0)).getNodeValue().trim();
                    NodeList timeList = firstActionObjectElement.getElementsByTagName("Time");
                    Element timeElement = (Element)timeList.item(0);
                    NodeList textTimeList = timeElement.getChildNodes();
                    Time =((Node)textTimeList.item(0)).getNodeValue().trim();
                    NodeList team_1List = firstActionObjectElement.getElementsByTagName("Team_1");
                    Element team_1Element = (Element)team_1List.item(0);
                    NodeList textTeam_1List = team_1Element.getChildNodes();
                    Team1 =((Node)textTeam_1List.item(0)).getNodeValue().trim();
                    NodeList team_2List = firstActionObjectElement.getElementsByTagName("Team_2");
                    Element team_2Element = (Element)team_2List.item(0);
                    NodeList textTeam_2List = team_2Element.getChildNodes();
                    Team_2 =((Node)textTeam_2List.item(0)).getNodeValue().trim();
                    NodeList venueList = firstActionObjectElement.getElementsByTagName("Venue");
                    Element venueElement = (Element)venueList.item(0);
                    NodeList textVenueList = venueElement.getChildNodes();
                    Venue=((Node)textVenueList.item(0)).getNodeValue().trim();
                    System.out.println("Match Number: " +MatchNo);
                    System.out.println("Date1:" +Date);
                    System.out.println("Time1: " +Time);
                    System.out.println("Team_1: " +Team1);
                    System.out.println("Team_2: " +Team2);
                    System.out.println("Venue: " +Venue);
                     catch (SAXParseException err) {
                         System.out.println ("** Parsing error" + ", line " + err.getLineNumber () + ", uri " + err.getSystemId ());
                         System.out.println(" " + err.getMessage ());
                         }catch (SAXException e) {
                         Exception x = e.getException ();
                         ((x == null) ? e : x).printStackTrace ();
                         }catch (Throwable t) {
                         t.printStackTrace ();
                         System.exit (0);
              I am getting Complie time errors like
    C:\Startup\XMLToConsole.java:53: incompatible types
    found : java.lang.String
    required: org.w3c.dom.NodeList
         MatchNo = ((Node)textMatchNo.item(0)).getNodeValue().trim();
    ^
    C:\Startup\XMLToConsole.java:60: incompatible types
    found : java.lang.String
    required: org.w3c.dom.NodeList
         Date = ((Node)textDate.item(0)).getNodeValue().trim();
    ^
    C:\Startup\XMLToConsole.java:67: incompatible types
    found : java.lang.String
    required: org.w3c.dom.NodeList
         Time =((Node)textTime.item(0)).getNodeValue().trim();
    ^
    C:\Startup\XMLToConsole.java:74: incompatible types
    found : java.lang.String
    required: org.w3c.dom.NodeList
         Team1 = ((Node)textTeam1.item(0)).getNodeValue().trim();
    ^
    C:\Startup\XMLToConsole.java:81: incompatible types
    found : java.lang.String
    required: org.w3c.dom.NodeList
         Team2 = ((Node)textTeam2.item(0)).getNodeValue().trim();
    ^
    C:\Startup\XMLToConsole.java:88: incompatible types
    found : java.lang.String
    required: org.w3c.dom.NodeList
         Venue = ((Node)textVenue.item(0)).getNodeValue().trim();
    ^
    6 errors
    Tool completed with exit code 1
    can any one sort out what the error is and reply me

    One thing I see is that you do not have nodes with a name of "MatchNo", for example. You have nodes with a node name of "field", some of whichi have an attribute named "name" wiht a value of "MatchNo".
    You might need to use XPath with a string of
    "/row/field[@name='MatchNo']"
    to find what you want..
    I'm not sure what is causing your compiler errors.
    Dave Patterson

  • Extract Data from XML and Load into table using SQL*Loader

    Hi All,
    We have a XML file (sample.xml) which contains credit card transaction information. We have a standard SQL*Loader control file which loads the data from a flat file and the control file code is written as position based method. Our requirement is to use this control file as per our requirement(i.e) load the data into the table from our XML file), But we need help in converting the XML to a flat file or Extract the data from the XML tags and pass the information to the control file and in turn it loads the table.
    Your suggestion is highly appreciated.
    Thanks in advance

    Hi,
    First of all go to PSA maintanance ( Where you will see PSA records ).
    Goto list---> Save-> File---> Spreadsheet (Choose Radio Button)
    > Give the proper file name where you want to download and then-----> Generate.
    You will get ur PSA data in Excel Format.
    Thanks
    Mayank

  • Read Xml Child node from XML Blob

    Hi Gurus,
    Greetings
    I am working in oracle 10g /Solaris platform.
    I have table with columns namely id varcha2,pmt blob.
    PMT stores xml file.
    <Products xmlns:source="http://apache.org/cocoon/source/1.0" DocStatus="approved" DocTimeStamp="2013-04-18T06:52:14" DocType="PMT" DocVersion="xUCDM_product_external_1_3.xsd">
    <Product Country="DE" IsAccessory="false" IsLocalized="true" IsMaster="false" Locale="de_DE" lastModified="2013-04-18T00:08:11" masterLastModified="2013-02-25T14:46:40">
    <Assets>
      <Asset code="46PFL8008S_12" description="User manual" extension="pdf" extent="3359201" lastModified="2013-04-18" locale="de_DE" number="001" type="DFU">http://download.p4c.abc.com/files/4/46pfl8008s_12/46pfl8008s_12_dfu_deu.pdf</Asset>
      <Asset code="46PFL8008S_12" description="Leaflet" extension="pdf" extent="970750" lastModified="2013-04-18" locale="de_DE" number="001" type="PSS">http://download.p4c.abc.com/files/4/46pfl8008s_12/46pfl8008s_12_pss_deu.pdf</Asset>
      <Asset code="46PFL8008S_12" description="Quick start guide" extension="pdf" extent="911832" lastModified="2013-04-18" locale="de_DE" number="001" type="QSG">http://download.p4c.abc.com/files/4/46pfl8008s_12/46pfl8008s_12_qsg_deu.zip</Asset>
      <Asset code="46PFL8008S_12" description="Front product photograph - highres 2196x1795" extension="jpg" extent="1989253" lastModified="2013-04-18" locale="global" number="001" type="_FP">http://images.abc.com/is/image/abcConsumer/46PFL8008S_12-_FP-global-001</Asset>
      <Asset code="46PFL8008S_12" description="Alternative product photograph 1 - highres 2196x1795" extension="jpg" extent="603474" lastModified="2013-04-18" locale="global" number="001" type="A1P">http://images.abc.com/is/image/abcConsumer/46PFL8008S_12-A1P-global-001</Asset>
      <Asset code="46PFL8008S_12" description="Alternative product photograph 2 - highres 2196x1795" extension="jpg" extent="407701" lastModified="2013-04-18" locale="global" number="001" type="A2P">http://images.abc.com/is/image/abcConsumer/46PFL8008S_12-A2P-global-001</Asset>
      <Asset code="46PFL8008S_12" description="Alternative product photograph 3 - highres 2196x1795" extension="jpg" extent="174261" lastModified="2013-04-18" locale="global" number="001" type="A3P">http://images.abc.com/is/image/abcConsumer/46PFL8008S_12-A3P-global-001</Asset>
      <Asset code="46PFL8008S_12" description="Alternative product photograph 4 - highres 2196x1795" extension="jpg" extent="109712" lastModified="2013-04-18" locale="global" number="001" type="A4P">http://images.abc.com/is/image/abcConsumer/46PFL8008S_12-A4P-global-001</Asset>
       </Assets>
    </Product>
      </Products>');
      I want the extract the ids from the table where pmt contains the child node (asset) contains .zip
    for example http://download.p4c.abc.com/files/4/46pfl8008s_12/46pfl8008s_12_qsg_deu.zip
    Then, I tried like this...
      select r.* from
       (SELECT xmltype(pmt) object_value
                     FROM PRODUCT_TR_PMT
                     XMLTABLE
                                     'for $Product  in $TEST/Products/Product/Assets/Asset
                                         return <RESULT>
                                                   $Product                     
                                                </RESULT>'
                                     passing OBJECT_VALUE as "TEST"   
                                     columns Asset path 'Asset' 
                                 ) r;
    ORA-02263: need to specify the datatype for this column
      Could you kindly help.
    Thanks
    Raj

    Blob storage we (db folks) dont have any control its from application standard design.
    If necessary, i can create function blob to clob.
    Kindly help me in extracting child node which contains zip.
       select r.* from
       (SELECT xmltype(pmt) object_value
                     FROM PRODUCT_TR_PMT
                     XMLTABLE
                                     'for $Product  in $TEST/Products/Product/Assets/Asset
                                         return <RESULT>
                                                   $Product                     
                                                </RESULT>'
                                     passing OBJECT_VALUE as "TEST"   
                                     columns Asset varchar2(255) path 'Asset' 
                                 ) r;
    ORA-06553: PLS-306: wrong number or types of arguments in call to 'XMLTYPE'Thanks
    Raj

  • How To Generate Objects From XML and DTD?

    Are there tools to generate objects from dtd's and xml files?
    If this is not possible for some reason: is there a tool to generate classes from a dtd?
    I can not find the "XML Java Class Generator" (from oracle) anymore.

    XMLBeans
    There are other solutions, but I know this one is pretty good.

Maybe you are looking for