Read a XML node value/attribute value from a CLOB

Hello,
I can write SQL/ - PL/SQL "straightforward" but now I have a problem what is to big for me.  I hop that someone can help.
We create by code a xml structure and write these into the oracle database CLOB field. I'm sorry to say that a xml text structure is written into a clob in stead of a xmltype field. (it's a design failure?) It's a large xml structure. I believe I can't attach a file so I put at the end of this discussion a light example of the xml structure.
It's a xml with quartervalue's, so there are 35040 detail rows (24h * 4 * 365days). I want to accumulate the the attribute Amount value 9. The amount value is in the Detail node a attribute but at the end you can see that for the DST are also 4 value's, but these are not attribute value's but node value's. (In this case it are four value's in some cases there is one DST amount value.
Can somebody help me how to accumulate all the detail attribute value Amount with the node value Amount of the DST tag?
XML structure:
<?xml version="1.0"?>
<Message xmlns:ns1="http://automaticdealcapture/">
    <BusinessDocument messageDateTime="2013-10-25T13:59:31+02:00" ediReference="LO-461967" messageName="New" businessSector="Z" documentFunction="Original">
        <DocumentData>
            <ns1:Adcs>
                <ns1:Package>
                    <ns1:Deal>
                        <ns1:ProductCode>PWCODE</ns1:ProductCode>
                        <ns1:Action>NEW</ns1:Action>
                        <ns1:Memo1>MemoField</ns1:Memo1>
                        <ns1:Details>
                            <ns1:Detail Dates="2014-01-01" Datee="2014-01-01" Times="00:00:00" Timee="01:00:00" Amount="0.0153" Price="11.111"/>
                            <ns1:Detail Dates="2014-01-01" Datee="2014-01-01" Times="01:00:00" Timee="02:00:00" Amount="0.015" Price="22.222"/>
                            etc. 350040 detail rows.
                        </ns1:Details>
                        <ns1:DSTS>
                            <ns1:Year Val="2014">
                                <ns1:DST Period="1">
                                    <ns1:Amount>0.0146</ns1:Amount>
                                    <ns1:Price>33.333</ns1:Price>
                                </ns1:DST>
                                <ns1:DST Period="2">
                                    <ns1:Amount>0.0222</ns1:Amount>
                                    <ns1:Price>33.333</ns1:Price>
                                </ns1:DST>
                                <ns1:DST Period="3">
                                    <ns1:Amount>0.0444</ns1:Amount>
                                    <ns1:Price>33.333</ns1:Price>
                                </ns1:DST>
                                <ns1:DST Period="4">
                                    <ns1:Amount>0.0146</ns1:Amount>
                                    <ns1:Price>33.333</ns1:Price>
                                </ns1:DST>
                            </ns1:Year>
                        </ns1:DSTS>
                    </ns1:Deal>
                </ns1:Package>
            </ns1:Adcs>
        </DocumentData>
    </BusinessDocument>
</Message>

From what I know, extracting the "Amount" values in the Details section and the "Amount" values in the DSTS section would be two different SELECT statements.
Both of these will use XMLTable() to extract the values.
BTW - If you need more information on this, post up in the XML/XML DB forum section for more complex help.  (eg getting YEAR with the DSTS Amount values)
as far as XML size goes, I've seen oracle handle a 100MB XML document without problems.
(just understand, it will be 'slow')
This one will give you the Amount values from the DSTS section:
with xml_data as ( SELECT
XMLType('<?xml version="1.0"?>
<Message xmlns:ns1="http://automaticdealcapture/">
    <BusinessDocument messageDateTime="2013-10-25T13:59:31+02:00" ediReference="LO-461967" messageName="New" businessSector="Z" documentFunction="Original">
        <DocumentData>
            <ns1:Adcs>
                <ns1:Package>
                    <ns1:Deal>
                        <ns1:ProductCode>PWCODE</ns1:ProductCode>
                        <ns1:Action>NEW</ns1:Action>
                        <ns1:Memo1>MemoField</ns1:Memo1>
                        <ns1:Details>
                            <ns1:Detail Dates="2014-01-01" Datee="2014-01-01" Times="00:00:00" Timee="01:00:00" Amount="0.0153" Price="11.111"/>
                            <ns1:Detail Dates="2014-01-01" Datee="2014-01-01" Times="01:00:00" Timee="02:00:00" Amount="0.015" Price="22.222"/>
                        </ns1:Details>
                        <ns1:DSTS>
                            <ns1:Year Val="2014">
                                <ns1:DST Period="1">
                                    <ns1:Amount>0.0146</ns1:Amount>
                                    <ns1:Price>33.333</ns1:Price>
                                </ns1:DST>
                                <ns1:DST Period="2">
                                    <ns1:Amount>0.0222</ns1:Amount>
                                    <ns1:Price>33.333</ns1:Price>
                                </ns1:DST>
                                <ns1:DST Period="3">
                                    <ns1:Amount>0.0444</ns1:Amount>
                                    <ns1:Price>33.333</ns1:Price>
                                </ns1:DST>
                                <ns1:DST Period="4">
                                    <ns1:Amount>0.0146</ns1:Amount>
                                    <ns1:Price>33.333</ns1:Price>
                                </ns1:DST>
                            </ns1:Year>
                        </ns1:DSTS>
                    </ns1:Deal>
                </ns1:Package>
            </ns1:Adcs>
        </DocumentData>
    </BusinessDocument>
</Message>') as XMLDATA from dual
select Y.amount
from xml_data X,
  XMLTable(  XMLNAMESPACES( 'http://automaticdealcapture/' as "ns1"),
   '/Message/BusinessDocument/DocumentData/ns1:Adcs/ns1:Package/ns1:Deal/ns1:DSTS/ns1:Year/ns1:DST'
    passing X.XMLData
  COLUMNS
    amount Number PATH '/ns1:DST/ns1:Amount'
  ) Y;
Replace the XMLTable() with the one below to get the Amount from the Details section:
  XMLTable(  XMLNAMESPACES( 'http://automaticdealcapture/' as "ns1"),
   '/Message/BusinessDocument/DocumentData/ns1:Adcs/ns1:Package/ns1:Deal/ns1:Details/ns1:Detail'
    passing X.XMLData
  COLUMNS
    amount number PATH '/ns1:Detail/@Amount'
  ) Y;

Similar Messages

  • Oracle XML DOM parser - attribute values are not printing on the screen ??

    Hi Everyone,
    I am just trying to use oracle DOM parser to paerse one of my xml file, java file can be compiled and run agianst a xml file, But I cannot see any attribute values printing on the screen..
    Appreciate if anyone can help, where I have gone wrong please?
    Below is the java file:
    // menna puthe DOMSample eka - duwanawa 19/12/2005
    import java.io.*;
    import java.net.*;
    import org.w3c.dom.*;
    import org.w3c.dom.Node;
    import oracle.xml.parser.v2.*;
    public class DOMSample {  //public class eka ***
    static public void main(String[] argv){  // main method eka ###
    try {
    if (argv.length != 1){
    // Must pass in the name of the XML file...
    System.err.println("Usage: java DOMSample filename");
    System.exit(1);
    // Get an instance of the parser
    DOMParser parser = new DOMParser();
    // Generate a URL from the filename.
    URL url = createURL(argv[0]);
    // Set various parser options: validation on,
    // warnings shown, error stream set to stderr.
    parser.setErrorStream(System.err);
    parser.showWarnings(true);
    // Parse the document.
    parser.parse(url);
    // Obtain the document.
    Document doc = parser.getDocument();
    // Print document elements
    System.out.print("The elements are: ");
    printElements(doc);
    // Print document element attributes
    System.out.println("The attributes of each element are: ");
    printElementAttributes(doc);
    catch (Exception e){
    System.out.println(e.toString());
    } // main method eka ###
    static void printElements(Document doc) {
    NodeList nl = doc.getElementsByTagName("*");
    Node n;
    for (int i=0; i<nl.getLength(); i++){
    n = nl.item(i);
    System.out.print(n.getNodeName() + " ");
    System.out.println();
    static void printElementAttributes(Document doc){
    NodeList nl = doc.getElementsByTagName("*");
    Element e;
    Node n;
    NamedNodeMap nnm;
    String attrname;
    String attrval;
    int i, len;
    len = nl.getLength();
    for (int j=0; j < len; j++){
    e = (Element)nl.item(j);
    System.out.println(e.getTagName() + ":");
    nnm = e.getAttributes();
    if (nnm != null){
    for (i=0; i<nnm.getLength(); i++){
    n = nnm.item(i);
    attrname = n.getNodeName();
    attrval = n.getNodeValue();
    System.out.print(" " + attrname + " = " + attrval);
    System.out.println();
    static URL createURL(String filename) {  // podi 3 Start
    URL url = null;
    try {
    url = new URL(filename);
    } catch (MalformedURLException ex) { /// BBBBBB
    try {
    File f = new File(filename);
    url = f.toURL();
    } catch (MalformedURLException e) {
    System.out.println("Cannot create URL for: " + filename);
    System.exit(0);
    } // BBBBBB
    return url;
    } // podi 3 End
    } //public class eka ***
    // End of program
    output comes as below:
    Isbn:
    Title:
    Price:
    Author:
    Message was edited by:
    chandanal

    Hi Chandanal,
    I edited your code slightly and I was able to get the correct output.
    I changed the following line:
    for (int j=0; j >< len; j++)to:
    for (int j=0; j < len; j++)I have included the complete source below:
    // menna puthe DOMSample eka - duwanawa 19/12/2005
    import java.io.*;
    import java.net.*;
    import org.w3c.dom.*;
    import org.w3c.dom.Node;
    import oracle.xml.parser.v2.*;
    public class DOMSample {
        //public class eka ***
        public static void main(String[] argv) {
            // main method eka ###
            try {
                if (argv.length != 1) {
                    // Must pass in the name of the XML file...
                    System.err.println("Usage: java DOMSample filename");
                    System.exit(1);
                // Get an instance of the parser
                DOMParser parser = new DOMParser();
                // Generate a URL from the filename.
                URL url = createURL(argv[0]);
                // Set various parser options: validation on,
                // warnings shown, error stream set to stderr.
                parser.setErrorStream(System.err);
                parser.showWarnings(true);
                // Parse the document.
                parser.parse(url);
                // Obtain the document.
                Document doc = parser.getDocument();
                // Print document elements
                System.out.print("The elements are: ");
                printElements(doc);
                // Print document element attributes
                System.out.println("The attributes of each element are: ");
                printElementAttributes(doc);
            } catch (Exception e) {
                System.out.println(e.toString());
        // main method eka ###
        static void printElements(Document doc) {
            NodeList nl = doc.getElementsByTagName("*");
            Node n;
            for (int i = 0; i < nl.getLength(); i++) {
                n = nl.item(i);
                System.out.print(n.getNodeName() + " ");
            System.out.println();
        static void printElementAttributes(Document doc) {
            NodeList nl = doc.getElementsByTagName("*");
            Element e;
            Node n;
            NamedNodeMap nnm;
            String attrname;
            String attrval;
            int i, len;
            len = nl.getLength();
            for (int j = 0; j < len; j++) {
                e = (Element)nl.item(j);
                System.out.println(e.getTagName() + ":");
                nnm = e.getAttributes();
                if (nnm != null) {
                    for (i = 0; i < nnm.getLength(); i++) {
                        n = nnm.item(i);
                        attrname = n.getNodeName();
                        attrval = n.getNodeValue();
                        System.out.print(" " + attrname + " = " + attrval);
                System.out.println();
        static URL createURL(String filename) {
            // podi 3 Start
            URL url = null;
            try {
                url = new URL(filename);
            } catch (MalformedURLException ex) {
                /// BBBBBB
                try {
                    File f = new File(filename);
                    url = f.toURL();
                } catch (MalformedURLException e) {
                    System.out.println("Cannot create URL for: " + filename);
                    System.exit(0);
            // BBBBBB
            return url;
        // podi 3 End
    } //public class eka ***-Blaise

  • Remove xml node based on value

    Hi,
    we have to remove elements bases on the value.
    for example consider below xml
    <htl:room>
              <htl:ratePlan>
                <htl:freeNights>12</htl:freeNights>
                <htl:promoSavings>undefined</htl:promoSavings>
                <htl:tax>undefined</htl:tax>
              </htl:ratePlan>
              <htl:guestAllocation>1,2</htl:guestAllocation>
            </htl:room>
    We have to remove elements with value undefined and should construct a new xml as below
    <htl:room>
              <htl:ratePlan>
                <htl:freeNights>12</htl:freeNights>
              </htl:ratePlan>
              <htl:guestAllocation>1,2</htl:guestAllocation>
            </htl:room>
    please help.
    Thanks

    i assume that loc always corresponds to name. So to find the rows to remain is just a simple group by
    with data as(
    select 'aaa' name,'a1' loc,10 count from dual union all
    select 'aaa','a1',0 from dual union all
    select 'bbb','b1',0 from dual union all
    select 'ccc','c1',0 from dual union all
    select 'dcc','d1',11 from dual union all
    select 'dcc','d1',0 from dual )
    select
      name
    , loc
    , max(count) cnt
    from data
    group by
      name
    , loc
    order by
      name
    , loc
    NAME     LOC     CNT
    aaa     a1     10
    bbb     b1     0
    ccc     c1     0
    dcc     d1     11to find the other is just a minus
    with data as(
    select 'aaa' name,'a1' loc,10 count from dual union all
    select 'aaa','a1',0 from dual union all
    select 'bbb','b1',0 from dual union all
    select 'ccc','c1',0 from dual union all
    select 'dcc','d1',11 from dual union all
    select 'dcc','d1',0 from dual )
    select name,loc,count from data
    minus
    select
      name
    , loc
    , max(count) cnt
    from data
    group by
      name
    , loc
    order by
      name
    , loc
    NAME     LOC     COUNT
    aaa     a1     0
    dcc     d1     0so a delete would be
    delete from data
    where
    (name,loc,count)
    in
    (select name,loc,count from data
    minus ..regards

  • How to read a xml node name in xsl? Urgent!

    Hi,
    I've a dynamic xml which gets generated at runtime. The basic nodes remain same but the content and nodes vary.
    - <root>
    - <list>
    - <row>
    <courseStartDate></courseStartDate>
    <courseEndDate></courseEndDate>
    <courseName>ORACLE</courseName>
    </row>
    - </list>
    </root>
    I have an xsl which would read the values
    as :
    <xsl:value-of select="courseStartDate"/>
    I would like to know if its possible to read the node name "courseStartDate" through xsl, which could be stored in a variable and then the corresponding value could be retrieved??
    Thanks

    If u want to display the name : value then u can do like this
    <xsl:eval>this.selectSingleNode("name").nodeName</xsl:eval> : <xsl:value-of select="name" />

  • Search the xml node by attributes and display the entire row

    I am having a table with two columns say
    school_name string type
    student_notebookprice xmldata
    how do i search with oracle query having student_id=102 and schoolname="abc_school" with notebook price 20, how do i get only one single row
    abc_school,
    <students>
         <student id="101">
         <notebookprice>12</notebookprice>
         </student>
         <student id="102">
              <notebookprice>20</notebookprice>
              <notebookprice>30</notebookprice>
              <notebookprice>40</notebookprice>
    </student>
    </students>
    def_school,
    <students>
         <student id="301">
         <notebookprice>10</notebookprice>
         </student>
         <student id="302">
              <notebookprice>15</notebookprice>
              <notebookprice>16</notebookprice>
    </student>
    </students>

    yes . what i want based on search criteria i need to display that row . initially i have tried with the below query
    SELECT school_name,
    extractvalue(value(x), '//id') as student_id ,
    extractValue(value(x), '//teacher') AS teacher
    FROM school t ,
    TABLE( XMLSequence( Extract(t.obj_xml, '/students/student[id=101 and teacher="abc"]'))) x
    where existsNode(t.obj_xml, '/students/student[id=101 and teacher="abc"]') = 1
    but when i want to add the second student in the search , i am failed to produce the second student information in the output and i can able to add it to where clause and but how to display the student info in the output . The xmltable option that u have specified looks good but what i fear is , it produce multiple combination with all the tags in the xml with the other columns in the table . will it cause any performence issue .
    <students>
    <student >
    <id>101</id>
    <teacher>abc</teacher>
    </student>
    <student >
    <id>102</id>
    <teacher>xyz</teacher>
    <teacher>onp</teacher>
    <teacher>rsm</teacher>
    </student>
    </students>
    SELECT school_name,
    extractvalue(value(x), '//id') as student_id ,
    extractValue(value(x), '//teacher') AS teacher
    FROM school t ,
    TABLE( XMLSequence( Extract(t.obj_xml, '/students/student[id=101 and teacher="abc"]'))) x
    where existsNode(t.obj_xml, '/students/student[id=101 and teacher="abc"]') = 1
    and existsnode(t.obj_xml, '/students/student[id=102 and teacher="xyz"]') = 1

  • How can I read an XML string that's not from an XML file?

    I've got a script I'm trying to setup that communicates over a socket to retrieve different directions from a custom built Java program.  The Java program listens to requests from the Adobe scripting engine (in my case it's a Photoshop script) on a socket and immediately responds with the next set of directions.  These directions are currently in XML format.  The issue I'm having is that I can't parse the XML data since it's entered into a new XML object from a string rather than being read from a file.  Even without the socket code, you can see the issue by doing the following:
    var xml = new XML("<test><data>hey!</data></test>");
    alert(xml.test.data);
    alert(xml);
    The first alert "should" return "hey!" (without quotes, of course), but it doesn't, while the second alert returns what you would expect it to:
    <test>
        <data>hey!</data>
    </test>
    It works fine if read from an XML file, but from a string, like shown above, it just presents an empty alert box when attempting to access "xml.test.data".  Any ideas on how to fix this issue?  Can it be fixed?  Has it been fixed in newer versions (I'm currently using CS4)?
    Thanks in advance for any help!

    Duh... found my error... I was attempting to access the data by referencing the created "root" element.  Since <test> is the very first element tag, it's setup as the root element, which you don't need to reference.  Changing the alert to alert(xml.data); fixed it.
    Now I just feel dumb, lol...

  • Select XML Node by a specific attribute value

    I am newbie for LifeCyle.
    This might be an easy question, but it really got me here.
    I am trying bind xml data into a Drop-Down List. The databinding is working fine, but I would like to have more specific node selected from the xml file by using a attribute value.
    for example Code in AS 3.0
    root.node.(@id=="1").subNode
    How could i do the same thing in LifeCycle Designer 8.0
    Thank you in advance!!!

    there's no native method for this, maybe you should create some functions for this. just like
    private function setAttribute(node:XML, name:String, value:String, index:int = -1):void
        var attrs:XMLList = node.attributes().copy(),
            l:int = attrs.length();
        if(index == -1 || index > l - 1)
            node.@[name] = value;
        else
            delete node.@*;
            var idx:int = 0;
            for (var i:int = 0; i < l + 1; i++)
                if(i == index)
                    node.@[name] = value;
                else
                    var attr:XML = attrs[idx];
                    node.@[attr.name()] = attr.toString();
                    idx++;
    and use it like this:
    setAttribute(myNode, "otherAttribute", "abc", 0);

  • How to read  data from a value attribute

    I  have a context node which has some value attributes.the value to these attributes have been set in their setter/getter methods . How do i read data in the do_prepare_output ,because this attribute does not get recognised when i do get_property_as_string( iv_attr_name = 'XYZ' ). Please let me know how this can be done .

    Hi Shakuntala,
    Value attributes are only for display purpose.
    Check where is the value for the Value Attribute you are trying to read getting stored in SET method.
    For example, Employee Responsible has a value attribute RESPONSIBLE_NAME_UI on the screen
    but in turn the value gets stored in the 'RESPONSIBLE_NAME' and 'RESPONSIBLE_TEXT'.
    You can get these fields in SET method.
    Now when you want to read, use the logic available in GET method for the value attribute like this
      value = me->get_responsible_text( attribute_path = '//TRADE/RESPONSIBLE_TEXT' ).
      IF value IS INITIAL.
        value = me->get_responsible_name( attribute_path = '//TRADE/RESPONSIBLE_NAME' ).
      ENDIF.
    Regards,
    Masood Imrani S.

  • Issues In Reading Attribute Values From Master Data

    Hi All,
    I have a requirement where, i need to read an attribute value from master data. I have a characteristic YCSTATMCG (AT Cost Group Code) which is the master data from where i have to read the attribute, 0PROFIT_CTR (Profit Center). The attribute thus read, has to be populated into another characteristic, YPROFIT_C.  But YCSTATMCG referes to another characteristic, YCSTCG. Here is the FOX Code I wrote with YPROFIT_C as the changing characteristic and 0AMOUNT as keyfigure.
    DATA V_ATCP TYPE YCSTATMCG.
    DATA V_PROFIT TYPE YPROFIT_C.
    DATA V_PROFITC TYPE YPROFIT_C.
    DATA V_AMOUNT TYPE F.
    V_ATCP = OBJV().
    MESSAGE I020(YCO_CFT) WITH V_ATCP.
    V_AMOUNT = {0AMOUNT,  # }.
    V_PROFIT = ATRV('0PROFIT_CTR' , V_ATCP).
    MESSAGE I020(YCO_CFT) WITH V_PROFIT.
    {0AMOUNT, V_PROFIT} = V_AMOUNT.
    But this is not working. The ATRV() function is not reading the attribute values at all. Any solutions and suggestions is highly valued.
    Thanks in advance
    Swaroop

    Hi,
    even i have the same situation.
    i just want the attribute value of a char to be populated into another characteristic in the planning query.
    my question is whether i should populate the keyfigure field also in the FOX code.
    if so should i populate both 0amount and 0quantity fields as i have 2 keyfigure fields.
    Thanks for your help
    Nishanth

  • How to extract attribute value from an XML

    I have column where all my diffrent structures of XML's are getting stored. I want extract a patticular attribute value from all the XML’s. Can any one help me with this?
    Thanks,
    swagath

    Kindly refer to the EXTRACTVALUE function in your online documentation and refrain from further doc questions.
    Sybrand Bakker
    Senior Oracle DBA

  • Parsing XML data stored as CLOB in DB and save attribute values in table

    Hello,
    I have a CLOB column in table that is holding XML data as follows,
    <banners>
    <banner-image id="0">
    <type>BANNER</type>
    <local-path>http.gif</local-path>
    <click-through-url>www</click-through-url>
    <make>Acura</make>
    </banner-image>
    <banner-image id="1">
    <type>BANNER</type>
    <local-path>http.gif</local-path>
    <click-through-url>gfrty</click-through-url>
    <make>BMW</make>
    </banner-image>
    </banners>
    Now I need to parse thru the above XML data and pull the attribute values to store in another table as follows,
    BANNER_IMAGE_ID | TYPE | LOCAL_PATH | CLICK_URL | MAKE
    0 | BANNER | http.gif | www | Acura
    1 | BANNER | http.gif | gfrty | BMW
    And XML data doesn't always end up with 2 rows in this table....some times it may be 3 or 4 as well. It is just that in this example it ended up with 2 rows.
    So, I would appreciate if someone can help me find a generic way of doing this,
    Thank you in advance,
    Madhu.

    This is not a reply.. sorry.
    I took have a similar problem only..
    can you pls help me
    XML structure.
    <PODetails>
    <POHeader>
    <CurrencyID>INR</CurrencyID>
    <ExchangeRate>1</ExchangeRate>
    <RefNo>0080000110</RefNo>
    <VendorID>1200</VendorID>
    <TransDate>2006-12-20</TransDate>
    <DocRelationshipId>PURCHASE</DocRelationshipId>
    <LocationID>0000102327</LocationID>
    </POHeader>
    <POItemDetails>
    <ItemID>ARSH1332</ItemID>
    <Size>L HS</Size>
    <Quality>Q1</Quality>
    <CustPO>rush order</CustPO>
    <UOM>PC</UOM>
    <Quantity>3.000</Quantity>
    <PriceValue>2509.5</PriceValue>
    <TaxAmount>0.00</TaxAmount>
    </POItemDetails>
    <POItemDetails>
    <ItemID>ARSH1332</ItemID>
    <Size>M HS</Size>
    <Quality>Q1</Quality>
    <CustPO>rush order</CustPO>
    <UOM>PC</UOM>
    <Quantity>2.000</Quantity>
    <PriceValue>1673</PriceValue>
    <TaxAmount>0.00</TaxAmount>
    </POItemDetails>
    <POItemDetails>
    <ItemID>ARSH1556</ItemID>
    <Size>39FS</Size>
    <Quality>Q1</Quality>
    <CustPO>rush order</CustPO>
    <UOM>PC</UOM>
    <Quantity>1.000</Quantity>
    <PriceValue>836.5</PriceValue>
    <TaxAmount>0.00</TaxAmount>
    </POItemDetails>
    </PODetails>
    The DB is ORACLE 9i
    This is stored in a XML table of type XMLTYPE.
    THIS I USED THE .extract function to get the values of the nodes.
    POHeader details are working fine. But when i get the POItemDetails i am getting 'ARSH1332ARSH1332ARSH1556' when i issue the command
    select a.extract('/PODetails/POItemDetails/ItemID/text()').getStringVal() ItemID
    FROM xmltable a
    WHERE a.existsnode('//POItemDetails/ItemID')=1
    Pls Help..
    Regds,
    Santhoshkumar.G.

  • Read Selected Tree Node value.  Jdeveloper Jdeveloper 11.1.2.1.0 11.1.2.1.0

    Version: Jdeveloper 11.1.2.1.0
    how to get programmatically tree node value.
    i have tried but cann't read value from selected node.
    please help me.
    here is my application creation steps:
    1. New Application
    2. Fusion Web Application (ADF) Template
    3. Create View Object VOTreeMst
    Query:
         Select Department_Name,Department_Id
         From Departments
    4. Create View Object VOTreeChd
    Query:
         Select Last_Name,Employee_Id,Department_Id
         From Employees
    5. Create View Link VLTreeMstChd
         VOTreeMst.DepartmentId=VOTreeChd.DepartmentId
         And Add to Application Module
    6. Create page page1 in ViewController
         New-->Web Tier-->JSF/Facelets-->Page
         Selected Document Type JSP XML
    7. Drag VOTreeMst1 From Data Controls into page1
    and select Tree-->ADF Tree
    8. ADD java Code into selection Listener
    public void nodeSelect(SelectionEvent selectionEvent) {
    //original selection listener set by ADF
    String adfSelectionListener = "#{bindings.VOTreeMst1.treeModel.makeCurrent}";
    //make sure the default selection listener functionality is preserved.
    //you don't need to do this for multi select trees as the ADF binding
    //only supports single current row selection
    /* START PRESERVER DEFAULT ADF SELECT BEHAVIOR */
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application application = fctx.getApplication();
    ELContext elCtx = fctx.getELContext();
    ExpressionFactory exprFactory = application.getExpressionFactory();
    MethodExpression me = null;
    me = exprFactory.createMethodExpression(elCtx, adfSelectionListener, Object.class,
    new Class[] { SelectionEvent.class });
    me.invoke(elCtx, new Object[] { selectionEvent });
    /* END PRESERVER DEFAULT ADF SELECT BEHAVIOR */
    RichTree tree = (RichTree)selectionEvent.getSource();
    TreeModel model = (TreeModel)tree.getValue();
    //get selected nodes
    RowKeySet rowKeySet = selectionEvent.getAddedSet();
    Iterator rksIterator = rowKeySet.iterator();
    //for single select configurations, thi sonly is called once
    while (rksIterator.hasNext()) {
    List key = (List)rksIterator.next();
    JUCtrlHierBinding treeBinding = null;
    CollectionModel collectionModel = (CollectionModel)tree.getValue();
    treeBinding = (JUCtrlHierBinding)collectionModel.getWrappedData();
    JUCtrlHierNodeBinding nodeBinding = treeBinding.findNodeByKeyPath(key);
    Row rw = nodeBinding.getRow();
    //print first row attribute. Note that in a tree you have to determine the node
    //type if you want to select node attributes by name and not index
    String rowType = rw.getStructureDef().getDefName();
    if(rowType.equalsIgnoreCase("VOTreeMst")){
    System.out.println("This row is a department: " + rw.getAttribute("DepartmentId"));
    else if(rowType.equalsIgnoreCase("VOTreeChd")){
    System.out.println("This row is an employee: " + rw.getAttribute("EmployeeId"));
    else{
    System.out.println("Huh ????");
    // ... do more usefuls stuff here
    9. when i click on first node it is working but i click on second node it is not working
    error message::
    <LifecycleImpl> <_handleException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase INVOKE_APPLICATION 5
    javax.el.ELException: java.lang.NullPointerException
         at com.sun.el.parser.AstValue.invoke(Unknown Source)
         at com.sun.el.MethodExpressionImpl.invoke(Unknown Source)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodExpression(UIXComponentBase.java:1589)
         at org.apache.myfaces.trinidad.component.UIXTree.broadcast(UIXTree.java:237)
    <RegistrationConfigurator> <handleError> ADF_FACES-60096:Server Exception during PPR, #1
    javax.el.ELException: java.lang.NullPointerException
    I have also tried using following code but same problem
    public void onTreeSelect(SelectionEvent selectionEvent) {
    //original selection listener set by ADF
    String adfSelectionListener = "#{bindings.VOTreeMst1.treeModel.makeCurrent}";
    //make sure the default selection listener functionality is preserved.
    //you don't need to do this for multi select trees as the ADF binding
    //only supports single current row selection
    /* START PRESERVER DEFAULT ADF SELECT BEHAVIOR */
    FacesContext fctx = FacesContext.getCurrentInstance();
    Application application = fctx.getApplication();
    ELContext elCtx = fctx.getELContext();
    ExpressionFactory exprFactory = application.getExpressionFactory();
    MethodExpression me = null;
    me = exprFactory.createMethodExpression(elCtx, adfSelectionListener, Object.class,
    new Class[] { SelectionEvent.class });
    me.invoke(elCtx, new Object[] { selectionEvent });
    /* END PRESERVER DEFAULT ADF SELECT BEHAVIOR */
    RichTree tree = (RichTree)selectionEvent.getSource();
    TreeModel model = (TreeModel)tree.getValue();
    //get selected nodes
    RowKeySet rowKeySet = selectionEvent.getAddedSet();
    Iterator rksIterator = rowKeySet.iterator();
    //for single select configurations, thi sonly is called once
    while (rksIterator.hasNext()) {
    List key = (List)rksIterator.next();
    JUCtrlHierBinding treeBinding = null;
    treeBinding = (JUCtrlHierBinding)((CollectionModel)tree.getValue()).getWrappedData();
    JUCtrlHierNodeBinding nodeBinding = treeBinding.findNodeByKeyPath(key);
    Row rw = nodeBinding.getRow();
    //print first row attribute. Note that in a tree you have to determine the node
    //type if you want to select node attributes by name and not index
    System.out.println("row: " + rw.getAttribute(0));
    But
    If i create .jspx page From
    Web Tier->Jsp->page Then it is working fine
    when i create .jspx page From
    Web Tier->JSF\Facelets->page Then it is not working
    i need to get value from "Web Tier->JSF\Facelets->page"
    is there any help please?

    You should try Franks generic selectionListener http://www.oracle.com/technetwork/developer-tools/adf/learnmore/25-generic-tree-selection-listener-169164.pdf. For help on hoe to get the selected tree node data check http://www.oracle.com/technetwork/developer-tools/adf/learnmore/26-get-selected-tree-node-data-169165.pdf
    Timo

  • How to get attribute value of a node

    Hi experts
    I have a mapped node in my view context from component controller context. This node consists of 2 value attributes inside
    Example:
    NODE1             -
    > Cardinality 1..1, seleciton 1..1
       -- x_date         -
    > type DATS
       -- x_years        -
    > dec3
    How do I get the attribute value attr1 and attr2 ??
    Here is my code in my view method
      DATA: lr_node_info TYPE REF TO if_wd_context_node_info,
            l_date       TYPE dats,
            l_xyears     TYPE i.
      lr_node_info = wd_context->get_node_info( ).
      lr_node_info = lr_node_info->get_child_node('NODE1').
       l_date       = lr_node_info->get_attribute( name = 'X_DATE' ).
       l_xyears     = lr_node_info->get_attribute( name = 'X_YEARS' ).
    It does not seems to work since it says < the result type of the function method can not be converted into the result type L_DATE>
    I try to understand why but not sucessful, please help and thank you for your kindness

    Hi Dean,
    Regading uour problem of reading the attributes value of the context node, you have to  use the code wizard. that ia avaliable on the top toolbar when you are inside the View Method
    There is option to read context  select that radio button option and then thru F4 help
    if you can select the node then Code is automatically generated with variable declaration.!!
    Like this :
      DATA lo_nd_node1 TYPE REF TO if_wd_context_node.
        DATA lo_el_node1 TYPE REF TO if_wd_context_element.
        DATA ls_node1 TYPE wd_this->element_node1.
        DATA lv_x_date LIKE ls_node1-x_date.
        DATA lv_x_year LIKE ls_node1-x_year.   
      navigate from <CONTEXT> to <NODE1> via lead selection
        lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).
      get element via lead selection
        lo_el_node1 = lo_nd_node1->get_element(  ).
      get all declared attributes
        lo_el_node1->get_static_attributes(
          IMPORTING
            static_attributes = ls_node1 ).
        lv_x_date = ls_node1-x_date.
        lv_x_date = ls_noe1-x_year.
    if you can select the attribute then Code is automatically generated with variable declaration.!!
    DATA lo_nd_node1 TYPE REF TO if_wd_context_node.
      DATA lo_el_node1 TYPE REF TO if_wd_context_element.
      DATA ls_node1 TYPE wd_this->element_node1.
      DATA lv_x_date LIKE ls_node1-x_date.
    navigate from <CONTEXT> to <NODE1> via lead selection
      lo_nd_node1 = wd_context->get_child_node( name = wd_this->wdctx_node1 ).
    get element via lead selection
      lo_el_node1 = lo_nd_node1->get_element(  ).
    get single attribute
      lo_el_node1->get_attribute(
        EXPORTING
          name =  `X_DATE`
        IMPORTING
          value = lv_x_date ).
    Hopes this will helps you.
    Regard
    Manoj Kumar

  • XML-22009: (Error) Attribute 'select' not found in 'xsl:value-of'

    Hello,
    I'm a long-time Siebel developer but novice to BIP, trying to enhance some complex rtf templates that an experienced xdo/bip developer (contractor) designed for us in the past, with a couple of new fields that have been added to the integration object.
    All templates and sub-templates receive 'no errors found' when using add-in tool selection of 'Validate Template'. Unfortunately we cannot utilize the 'preview' capability due to the way the sub-templates are called, so only way to test is to upload into server and attempt to run real-time.
    This results in UI error of SBL-OMS-00203, which when we dig into the xdo log file turns out to be:
    <Line 648, Column 88>: XML-22009: (Error) Attribute 'select' not found in 'xsl:value-of'.
    I have exported all templates and sub-templates into XSL-FO Style Sheet and looked at line 648 column 88, and none of them seem to correspond to this line/column combination (in fact most exports do not even go that high in lines).
    Googling 'XML-22009' hasn't proven to be of much help, so reaching out to the xdo experts in this forum.
    How are the line/column #'s determined in the xdo log output?
    I am pretty sure that it must be some issue with my 'Main' template, since none of the sub-templates have been changed (and the current version of the report, without the new fields incorporated, still runs fine from the UI). In the XSL-FO format export of the (modified, with new fields added) 'Main.rtf' file, line 648 places it right in the midst of a bunch of hex which corresponds to an imbedded image (which was also part of the existing template, no change there) and that line only has 65 columns (i.e. doesn't even go up to 88), so I'm questioning how valid the Line/Column information is in the xdo log error message.
    Any hints on troubleshooting this one would be greatly appreciated!
    Thanks & Regards,
    Katrina

    Hi,
    as I wrote in the inital message, we even left out the output method or used "application/pdf". The result is unfortunately always the same. And I still claim this is not a problem with the stylesheet itself, it has to do something with the mobile's environment.
    Something I didn't tell: we have 2 servlets in our application, 1 responsible for output in html and 1 in pdf. The .fo stylesheet passed to the 'html servlet' is parsed correctly (and shows the source code, because it does not know about fo and conversion to pdf), the .xsl stylesheet passed to the 'pdf servlet' raises same exception/same line. You might tell us that there is a problem with the 'pdf servlet', but once again: why in online it is working?
    Greetings and thanx very much for your precious time!

  • Protecting the attribute value from getting reset!

    Hello all,
    I have attached a custom drop down search help to the attribute "SERVICE_UNIT_NAME" in the "BTPARTNERSET" context node. The drop down list contains a blank entry as well as a couple of other entries, I have placed a create object statement for my search help class in the Getter method "GET_V_SERVICE_UNIT_NAME" while written the following code in the setter method "GET_P_SERVICE_UNIT_NAME" as suggested by one of the esteemed experts here on the forum.
      case iv_property.
        when if_bsp_wd_model_setter_getter=>fp_fieldtype.
             rv_value = cl_bsp_dlc_view_descriptor=>field_type_picklist.
      endcase.
    This drop down list is showing correctly, however my problem is that if the user selects any value from the drop down list, the selected value gets copied to the attribute but when ever the user press an "ENTER KEY" or any other action, the value in the attribute gets initialized to the first value in the drop down list which is a "BLANK" value. I want to preserve the value originally selected by the user from the drop down list, without it being reset by any other user actions on the screen.  Do I need to redefine any other method for this attribute? I'll appreciate any help.
    Regards,

    Naresh and Sumit, many thanks for your valuable inputs however, I have tried your code but I am still facing the same issue, as the attribute value for "SERVICE_UNIT_NAME" is getting refresh every time an "ENTER" is pressed on the page. Let me specify some other detail that may help in understanding this behaviour for the attribute value, actually when on the initial page, user has to enter his phone no / network ID, so that the standard functionality bring about the city, postal code, country etc. so once these values are set in the related attributes, the user will click on the incident button, which brings about a search help (web dialogue) for partner selection, so any value selected, is displayed afterwards in the "SERVICE_UNIT_NAME" attribute on the next page. However, after putting the custom drop down list at the said attribute, the value selected on the previous page is not populating in the attribute and the user can select the value from the custom drop down list now, but once he press "ENTER" or pushes any other button the page, the selected value in the attribute gets initialized. Is there a way to check for the user input?

Maybe you are looking for

  • Can you delete an item from itunes and get your money back???

    hi!!! can u please tell me if you can delete an item from itunes and get your money back??? Thanks XD

  • How do I turn off password resets

    I'm a little frustrated - there are periods of time when i'm not logging into my formcentral account, and, when I go to log in with the correct credentials, Adobe is doing me the "service" of resetting my password for me. Which is great, except, it's

  • Cannot Deploy JPD with Timer Event Subscription in WLI 9.2 MP1 cluster

    Has anyone had any luck deploying a JPD with a timer event subscription to a 9.2 MP1 WLI cluster? I am able to deploy Synchronous Client Request JPDs without any trouble but the ones that rely on internal WLI queues for invocation will not deploy in

  • Posting date to accounting for billing document

    Dear Experts In SD cycle, we have created billing document in first quarter. As per our customization settings the billing document was created with Posting block. Now today i.e. in second quarter we want to release this billing document to accountin

  • IPodSBCDriver.kext problem = improperly installed extension

    I just bought an iPod shuffle that works fine with my Powerbook G4, but which won't connect properly to my iMac (800 MHz G4) , which is where my music library is located. When I restart the iMac and put the shuffle into the USB 2.0 port, I get the er