Appending XML Node to XMLTYPE Variable

Hi All,
My Database Details,
BANNER
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
PL/SQL Release 9.2.0.1.0 - Production
CORE 9.2.0.1.0 Production
TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
NLSRTL Version 9.2.0.1.0 - Production
SQL> var mycnt number
SQL> exec :mycnt := 2
SQL> declare
xml xmltype := xmltype('
<EMP>
<NAME>
</NAME>
<SALARY>
<DATE></DATE>
<AMOUNT></AMOUNT>
</SALARY>
</EMP>');
l_sal long := '<SALARY><DATE></DATE><AMOUNT></AMOUNT></SALARY>';
l_str long;
begin for i in 1 .. :mycnt
loop
l_str := l_str || l_sal;
end loop;
xml := xmltype(replace (xml.getstringval(), '</EMP>', l_str || '</EMP>'));
dbms_output.put_line (xml.extract('.').getstringval());
end;
<EMP>
<NAME/>
<SALARY>
<DATE/>
<AMOUNT/>
</SALARY>
<SALARY>
<DATE/>
<AMOUNT/>
</SALARY>
<SALARY>
<DATE/>
<AMOUNT/>
</SALARY>
</EMP>
This program is working fine. Consider the following scenario...
My XML is like this,
<ABC>
<AB> -- First element
<CCC></CCC>
</AB>
<AB> -- Second element
<CCC></CCC>
</AB>
</ABC>
Now i want to replicate the tag of <CCC></CCC>
to 'N' TIMES from XPATH = /A/AB[1]/CCC and /A/AB[2]/CCC
For example if N=3 then, the XML should be,
<ABC>
<AB>
<CCC></CCC>
<CCC></CCC>
<CCC></CCC>
</AB>
<AB>
<CCC></CCC>
<CCC></CCC>
<CCC></CCC>
</AB>
</ABC>
Please provide me some Sample PLSQL code for this,
Thanks in Advance,
Simbhu

not sure that this is waht you want - but maybe you find smth useful:
SQL> set serveroutput on;
SQL>
SQL> declare str xmltype:=xmltype('<ABC><AB><CCC></CCC></AB><AB><CCC></CCC></AB><AB><CCC></CCC></AB></ABC>');
  2  begin
  3  for i in 1..2
  4  loop
  5  select InsertChildXML(str, '/ABC/AB['||i||']', 'CCC', XMLForest('' as "CCC",'' as "CCC")) into str from dual;
  6  end loop;
  7  dbms_output.put_line(str.extract('.').getstringval());
  8  end;
  9  /
<ABC>
  <AB>
    <CCC/>
    <CCC/>
    <CCC/>
  </AB>
  <AB>
    <CCC/>
    <CCC/>
    <CCC/>
  </AB>
  <AB>
    <CCC/>
  </AB>
</ABC>
PL/SQL procedure successfully completed
SQL>

Similar Messages

  • How can i append new xml node to xmltype doc with updatexml and xpath?

    ex. content of column:
    <xmldoc>
    <xmlnode attr="x" value="x1"/>
    <xmlnode attr="y" value="y1"/>
    </xmldoc>
    needed to be:
    <xmldoc>
    <xmlnode attr="x" value="x1"/>
    <xmlnode attr="y" value="y1"/>
    <xmlnode attr="z" value="z1"/>
    <xmldoc/>
    how can i do this with updatexml without rewriting all xmlnode-elements?

    You have to specify the DTD in the transformation. If you are using XSLT then you do that on your <xsl:output>. Otherwise you need to give more details.

  • Appending XML node in bpel.

    Hi,
    I have a transform activity that creates a XML as below:
    <Students>
    <Student>
    <Name>A</Name>
    <Age>123</Age>
    </Student>
    </Students>
    After that i need to use an assign activity to append another student node with output as below:
    <Students>
    <Student>
    <Name>A</Name>
    <Age>123</Age>
    </Student>
    <Student> <!-- This is the appended node -->
    <Name>C</Name>
    <Age>452</Age>
    </Student>
    </Students>
    let me know how to achieve this using bpel assign activity.
    Thanks.

    It's something like this...
    Variable_1
    <list>
         <data>aa</data>
         <data>bb</data>
    </list>Variable_2
    <list>
         <data>1</data>
         <data>2</data>
    </list>Then you put an append in your ASSIGN activity
    <bpelx:append>
         <bpelx:from variable="Variable_2" query="/list/*"/>
         <bpelx:to variable="Variable_1" query="/list"/>
    </bpelx:append>And you get this as result...
    <list>
    <data>aa</data>
    <data>bb</data>
    <data>1</data>
    <data>2</data>
    </list>Cheers,
    Vlad

  • Appending XML Node

    Hi All,
    My Database Details,
    BANNER
    Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
    PL/SQL Release 9.2.0.1.0 - Production
    CORE 9.2.0.1.0 Production
    TNS for 32-bit Windows: Version 9.2.0.1.0 - Production
    NLSRTL Version 9.2.0.1.0 - Production
    SQL> var mycnt number
    SQL> exec :mycnt := 2
    SQL> declare
    xml xmltype := xmltype('
    <EMP>
    <NAME>
    </NAME>
    <SALARY>
    <DATE></DATE>
    <AMOUNT></AMOUNT>
    </SALARY>
    </EMP>');
    l_sal long := '<SALARY><DATE></DATE><AMOUNT></AMOUNT></SALARY>';
    l_str long;
    begin for i in 1 .. :mycnt
    loop
    l_str := l_str || l_sal;
    end loop;
    xml := xmltype(replace (xml.getstringval(), '</EMP>', l_str || '</EMP>'));
    dbms_output.put_line (xml.extract('.').getstringval());
    end;
    <EMP>
    <NAME/>
    <SALARY>
    <DATE/>
    <AMOUNT/>
    </SALARY>
    <SALARY>
    <DATE/>
    <AMOUNT/>
    </SALARY>
    <SALARY>
    <DATE/>
    <AMOUNT/>
    </SALARY>
    </EMP>
    This program is working fine. Consider the following scenario...
    My XML is like this,
    <ABC>
    <AB> -- First element
    <CCC></CCC>
    </AB>
    <AB> -- Second element
    <CCC></CCC>
    </AB>
    </ABC>
    Now i want to replicate the tag of <CCC></CCC>
    to 'N' TIMES from XPATH = /A/AB[1]/CCC and /A/AB[2]/CCC
    For example if N=3 then, the XML should be,
    <ABC>
    <AB>
    <CCC></CCC>
    <CCC></CCC>
    <CCC></CCC>
    </AB>
    <AB>
    <CCC></CCC>
    <CCC></CCC>
    <CCC></CCC>
    </AB>
    </ABC>
    Please provide me some Sample PLSQL code for this,
    Thanks in Advance,
    Simbhu

    Please read XML DB FAQ. 9.2.0.3.0 is the minimum support release for XDB

  • Append xml node into a list

    Hi,
    In an embedded sub process with looping logic, we have a db adapter call.
    We are trying to insert the single response object from each of the db adapter call into a list.
    Problem we are facing is the list is not able to append the new db response into the list.
    AppendToList is not of help. XSLT construct copy-to was not of help.
    Using the following three messages
    Msg1: - Loop Interation 1
    <elementCollection>
    <element>aaa</element>
    </elementCollection>
    Msg2: - Loop Interation 2
    <elementCollection>
    <element>bbb</element>
    </elementCollection>
    Msg3: - Loop Interation 3
    <elementCollection>
    <element>ccc</element>
    </elementCollection>
    to be inserted into the following message
    Result: - After all the iterations
    <elementCollection>
    <element>aaa</element>
    <element>bbb</element>
    <element>ccc</element>
    </elementCollection>
    Any help/pointers will be appreciated.
    Edited by: 905033 on Jul 4, 2012 10:32 PM
    provided sample messages
    Edited by: 905033 on Oct 23, 2012 2:55 AM

    Please see the transformation bellow... I've built a quick sample and it worked for me.
    Cheers,
    Vlad
    It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts).
    https://forums.oracle.com/forums/ann.jspa?annID=893
    <xsl:stylesheet version="1.0"
      <xsl:param name="Variable_2"/>
      <xsl:param name="Variable_3"/>
      <xsl:template match="/">
        <ns0:elementCollection>
          <xsl:for-each select="ns0:elementCollection/ns0:element">
            <ns0:element>
              <xsl:value-of select="."/>
            </ns0:element>
          </xsl:for-each>
          <xsl:for-each select="$Variable_2/ns0:elementCollection/ns0:element">
            <ns0:element>
              <xsl:value-of select="."/>
            </ns0:element>
          </xsl:for-each>
          <xsl:for-each select="$Variable_3/ns0:elementCollection/ns0:element">
            <ns0:element>
              <xsl:value-of select="."/>
            </ns0:element>
          </xsl:for-each>
        </ns0:elementCollection>
      </xsl:template>
    </xsl:stylesheet>

  • Updatexml on xmltype variable

    Is there a way to update the XML in an xmltype variable?
    I don't want to have to use the sql commands update ... set that constrain me to changing XML already stored in a table.
    For example this is what I would like to do. If I have the following XML in clob vXmlClob
    <Action>
    <User>SVOLLMAN</User>
    </Action>
    I want to change the user to Dave...
    declare
    vXmlType xmltype;
    vXmlClob clob;
    begin
    vXmlType := xmltype(vXmlClob);
    vXmlType := xmlType.updatexml('Action/User','Dave');
    end;
    Of course this does not work but is there another way of updating the XML in my variable. Or maybe I am looking at this the wrong way - is there any way of using the update ... set sql commands without having the XML already in a table.

    You mean this?:
    michaels>  select xml, updatexml (d.xml, 'Action/User/text()', 'Dave') updated_xml
      from (select xmltype ('<Action><User>SVOLLMAN</User></Action>') xml from dual) d
    XML                                        UPDATED_XML                          
    <Action><User>SVOLLMAN</User></Action>     <Action><User>Dave</User></Action>                                                                                        

  • How I can append new node in existing  XML file

    I've just begun learning DOM XML , so I'm currently at a very beginner level.
    I have an existing XML file that I would like to add an additional node to before saving it to another variable.
    how I can append new node in this file.
    now this code is overwrite new data over old data
    The code looks like this:
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.parsers.ParserConfigurationException;
    import javax.xml.transform.Result;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.TransformerFactoryConfigurationError;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Attr;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    public class VerbXMLWriter
        static String EVerb3;
        static String englishTranslate3;
        public void VerbXMLWriter(String EVerb, String englishTranslate )
             EVerb3 = EVerb;
             englishTranslate3=englishTranslate;
        File xmlFile = new File("VerbDB.xml");
        DocumentBuilderFactory factory =  DocumentBuilderFactory.newInstance();
        try
         DocumentBuilder builder = factory.newDocumentBuilder();
         Document document = builder.newDocument();
        Element root = document.createElement("Verb");
         document.appendChild(root);
         Element verb = document.createElement(EVerb3);
         verb.setAttribute("EnglishTranslate",englishTranslate3);
         root.appendChild(verb);
         Source xmlSource = new DOMSource( document );
         Result result = new StreamResult( new FileOutputStream(xmlFile) );
        TransformerFactory transformerFactory = TransformerFactory.newInstance();
        Transformer transformer =
        transformerFactory.newTransformer();
        transformer.setOutputProperty( "indent", "yes" );
         transformer.transform( xmlSource, result );
      catch(TransformerFactoryConfigurationError factoryError )
        factoryError.printStackTrace();
       catch (ParserConfigurationException pc)
           pc.printStackTrace();
       catch (IOException io)
          io.printStackTrace();
       catch(Exception excep )
           excep.printStackTrace();
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <Verb>
    <Play EnglishTranslate="playing" />
    </Verb>Edited by: itb402 on Mar 9, 2008 6:05 AM

    in your code you are already appending new nodes to the root node. so what exactly is your problem? The following steps are usually taken for appending a new node:
    1. Read the XML document
    2. Build a DOM tree
    3. Navigate to the node under which you want to insert the new node
    4. Create a new node.
    5. Insert the new node to the node selected in point #3.
    ~Debopam

  • Reorder an xmltype variable in plsql

    I have an xml package sitiing in an xmltype variable.
    Does anyone know a way I can reorder the nodes alphabetically?
    Many Thanks
    Paul

    I can't post the xml.
    The forum just keeps saying content is not allowed.Use &#x7B;code} tags to enclose any code snippets you want to post. It'll preserve formatting and prevent content to be interpreted on the page.
    It's explained here : http://forums.oracle.com/forums/help.jspa
    Does this work for you :
    SQL> set serveroutput on
    SQL>
    SQL> DECLARE
      2 
      3   doc xmltype := xmltype(
      4   '<root>
      5  <things>bbb
      6  <somestuff>1234</somestuff>
      7  <morestuff>5678</morestuff>
      8  </things>
      9  <things>aaa
    10  <somestuff>dog</somestuff>
    11  <morestuff>cat</morestuff>
    12  </things>
    13  </root>'
    14   );
    15 
    16   ordered_doc xmltype;
    17 
    18  BEGIN
    19 
    20   select xmlquery(
    21   'for $i in $d/*
    22    return element {name($i)}
    23    {
    24     for $j in $i/things
    25     order by $j/text()
    26     return $j
    27    }'
    28    passing doc as "d"
    29    returning content
    30   )
    31   into ordered_doc
    32   from dual;
    33 
    34   dbms_output.put_line(ordered_doc.getclobval());
    35 
    36  END;
    37  /
    <root><things>aaa
    <somestuff>dog</somestuff>
      <morestuff>cat</morestuff>
    </things>
    <things>bbb
    <somestuff>1234</somestuff>
      <morestuff>5678</morestuff>
    </things>
    </root>
    PL/SQL procedure successfully completed
    The first "for" in the XQuery is there in case you don't want to hardcode the root element.

  • Append xml elements to a file

    Ok. After solve the problem of append to files using a file adapter in osb (Re: Write/Append text file with OSB now i want to know if there is some way to append elements to an existant xml. For each request i will have the following message:
    <root_node>
    <msg>
    <element />
    <element />
    <inner>
    <inner_data />
    </inner>
    <inner>
    <inner_data />
    </inner>
    <msg>
    </root_node>
    And, for two requests ai want to log:
    <root_node>
    <msg>
    <element />
    <element />
    <inner>
    <inner_data />
    </inner>
    <inner>
    <inner_data />
    </inner>
    <msg>
    <msg>
    <element />
    <element />
    <inner>
    <inner_data />
    </inner>
    <inner>
    <inner_data />
    </inner>
    <msg>
    </root_node>
    And no:
    <root_node>
    <msg>
    <element />
    <element />
    <inner>
    <inner_data />
    </inner>
    <inner>
    <inner_data />
    </inner>
    <msg>
    </root_node>
    <root_node>
    <msg>
    <element />
    <element />
    <inner>
    <inner_data />
    </inner>
    <inner>
    <inner_data />
    </inner>
    <msg>
    </root_node>
    As i'm doing (in my tests).
    Thank you.

    do you want to append/insert nodes in the file
    or do you want to construct that xml first in the osb and after that insert the xml in the file ?
    http://download.oracle.com/docs/cd/E13159_01/osb/docs10gr3/userguide/modelingmessageflow.html
    Message Processing Actions
    Insert activity
    you can use the insert activity to insert/append xml parts in your payload, and when the format is done, write it to the file

  • Converting java.lang.String to a XML Node

    Hi,
    how do you convert a straight forward string like ..
    "<nodename>this is the node value</nodename>" to a org.w3c.dom.Node....??
    This way it would be easier to use appendNode() to add temporary nodes & build up a document.

    ur app will perform poor if u r going to instantiate
    Document builder often.and u cant append the node ,like
    the way u r trying do.
    the node has to belong to the same document.
    u have to necessarily create node/text node, from this document and append it .
    Option two: read content from 1 file as a string append
    the second value from dealer_info and then create a document from the result String.but make sure ur string is in valid XML format.
    HTH
    vasanth-ct
    Ok let me tell you what exactly i want to do, so that
    you can advise me better. Please tell me, what could
    be done to avoid the error below.
    //start from an existing template xml file
    Document d =
    parseXmlFile("D:/www/Detailcache/detail.xml", false);
    Node root=d.getFirstChild();
    //append dealer information to the root node
    Node dnode=getDealerInfo(currentDealer);
    System.out.println("Node
    Info-->"+dnode.getNodeName());
    root.appendChild(dnode);
    //<-------------------Line175
    //Dealerinfo module returning the parent node
    public Node getDealerInfo(DealerInfo currentDealer) {
    try {
    DocumentBuilderFactory factory =
    ctory = DocumentBuilderFactory.newInstance();
    String
    String dealer_info="<dealer_info><dealer_address>930
    Rockbridge
    ave</dealer_address><dealer_country>USA</dealer_countr
    </dealer_info>";byte buf[] = dealer_info.getBytes();
    ByteArrayInputStream in = new
    n = new ByteArrayInputStream(buf);
    BufferedInputStream bis = new
    s = new BufferedInputStream(in);
    Document dealer_info_doc =
    o_doc = factory.newDocumentBuilder().parse(bis);
    Node dealer_info_node=
    o_node= dealer_info_doc.getFirstChild();
    return dealer_info_node;
    } catch (Exception e) {e.printStackTrace();}
    return null;
    My problem is 'root.appendChild(dnode);' returns an
    error :
    Node Info-->dealer_info
    org.apache.crimson.tree.DomEx: WRONG_DOCUMENT_ERR:
    That node doesn't belong in this document.
    at
    org.apache.crimson.tree.ParentNode.checkDocument(Unkno
    n Source)
    at
    org.apache.crimson.tree.ParentNode.appendChild(Unknown
    Source)
    at
    com.boatventures.inventory.servlet.XmlServlet.showPage
    XmlServlet.java:175)
    at
    com.boatventures.inventory.servlet.XmlServlet.doGet(Xm
    Servlet.java:64)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.jav
    :740)
    at
    javax.servlet.http.HttpServlet.service(HttpServlet.jav
    :853)
    at
    allaire.jrun.servlet.JRunSE.service(JRunSE.java:1417)
    at
    allaire.jrun.session.JRunSessionService.service(JRunSe
    sionService.java:1106)
    at
    allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:127
    at
    allaire.jrun.servlet.JRunNamedDispatcher.forward(JRunN
    medDispatcher.java:39)
    at
    allaire.jrun.servlet.Invoker.service(Invoker.java:84)
    at
    allaire.jrun.servlet.JRunSE.service(JRunSE.java:1417)
    at
    allaire.jrun.session.JRunSessionService.service(JRunSe
    sionService.java:1106)
    at
    allaire.jrun.servlet.JRunSE.runServlet(JRunSE.java:127
    at
    allaire.jrun.servlet.JRunRequestDispatcher.forward(JRu
    RequestDispatcher.java:89)
    at
    allaire.jrun.servlet.JRunSE.service(JRunSE.java:1557)
    at
    allaire.jrun.servlet.JRunSE.service(JRunSE.java:1547)
    at
    allaire.jrun.servlet.JvmContext.dispatch(JvmContext.ja
    a:364)
    at
    allaire.jrun.jrpp.ProxyEndpoint.run(ProxyEndpoint.java
    388)
         at allaire.jrun.ThreadPool.run(ThreadPool.java:272)
    at
    allaire.jrun.WorkerThread.run(WorkerThread.java:75)

  • Map several records to different elements in the same xml node

    Hi,
    I am trying to map data from relational tables to elements as per my xml schema. One of my tables has several records that I need to map to different elements in the same xml node.
    For example:
    Customer_Id | Param_Id |Param_Name
    212 | 1 |State
    212 | 2 |Country
    212 | 3 |ZipCode
    I can not change the structure of this existing table and need to work with it.
    How do I map the different params for a specific customer to my Customer node in the schema?
    One option is to join on the parameters table several times, but there ought to be a better way!
    PLEASE HELP!!!
    Thanks,

    First I question the design that contains/allows 600 attributes on an element. They sound like they really should be elements in the XML.
    Regardless, the following (NOT TESTED) should work for you (assuming you want to write one SQL with 600 columns)
    CREATE OR REPLACE VIEW APPLICATION_XML
    OF XMLTYPE
    Element "LOAN_APPLICATION"
    with object ID
    substr(extractValue(object_value,'/LOAN_APPLICATION/APPLICATION_DATA/@CallID'),1,5)
    AS
    WITH parm_tb AS
    SELECT MAX(DECODE(prv_valu, 1, prv_value)) BusinessType,
           MAX(DECODE(param_id, 2, prv_value)) Product,
           MAX(DECODE(param_id, 3, prv_value)) SomethingElse
      FROM parameter_details
    WHERE prv_pmh_header_id = 1
    SELECT xmlElement
       ("APPLICATION_DATA",
         xmlAttributes
          p.prv_detail_id as "CallID",
          p.PRV_PRM_PARAM_ID as "RandomID",
          p.prv_value as AppInitDate
         xmlElement
         ("PRODUCER_DATA",
           xmlAttributes
            parm_tb.BusinessType as "BusinessType" ,
            parm_tb.Product as "Product"
      FROM parameters_table p
    WHERE p.PRV_PMH_HEADER_ID = 1

  • How to get Total Number of XML Nodes?

    Hello All,
    I have a Flash program I'm doing in Actionscript 3, using CS6.
    I'm using the XMLSocket Class to read-in XML Data. I will write some sample XML Data that is being sent to the Flash
    program below...
    I know with this line here (below) I can access the 4th "element or node" of that XML Data.
         Accessing XML Nodes/Elements:
    // *I created an XML Variable called xml, and "e.data" contains ALL the XML Data
    var xml:XML = XML(e.data);
    // Accessing the 4th element of the data:
    xml.MESSAGE[3].@VAR;          --->     "loggedOutUsers"
    xml.MESSAGE[3].@TEXT;         --->     "15"
         SAMPLE XML DATA:
         <FRAME>
    0               <MESSAGE VAR="screen2Display" TEXT="FRAME_1"/>
    1               <MESSAGE VAR="numUsers" TEXT="27"/>
    2               <MESSAGE VAR="loggedInUsers" TEXT="12"/>
    3               <MESSAGE VAR="loggedOutUsers" TEXT="15"/>
    4               <MESSAGE VAR="admins" TEXT="2"/>
         </FRAME>
    I'm new to Flash and Actionscript but I'm very familiar with other languages and how arrays work and such, and I know for
    example, in a Shell Script to get the total number of elements in an array called "myArray" I would write something like
    this --> ${#myArray[@]}. And since processing the XML Data looks an awful lot like an array I figured there was maybe
    some way of accessing the total number of "elements/nodes" in the XML Data...?
    Any thoughts would be much appreciated!
    Thanks in Advance,
    Matt

    Hey vamsibatu, thanks again for the quick reply!
    Ohhh, ok I gotcha. That makes more sense.
    So I just tried this loop below and I guess I could use this and just keep assigning an int variable to the output so
    when it finishes I will be left with a variable containing the total number of elements:
    for (var x:int in xml.MESSAGE)
         trace("x == " + x);
    *Which OUTPUTS the Following:
    x == 0
    x == 1
    x == 2
    x == 3
    x == 4
    So I guess I could do something like this and when the loop completes I will be left with the total number of elements/nodes...
    var myTotal:int;
    for (var x:int in xml.MESSAGE)
        myTotal = x;
    // add '1' to myTotal since the XML Data is zero-based:
    myTotal += 1;
    trace("myTotal == " + myTotal);
    *Which Prints:
    "myTotal == 5"
    Thanks again for you suggestions, much appreciated!
    I think that should be good enough for what I needed. Thanks...
    Thanks Again,
    Matt

  • AS3 returns a string of XML nodes as null....

    I am working on a project that calls and searches an XML sheet that looks like this:
        <Searchtext Wordlookup="john smith">
            <location>$1</location>
            <Name>john smith</Name>
        </Searchtext>
    and it continues like this for about 100+ people.
    Now, my flash takes this data and allows the user to either click on a textbox prefilled with a name (whose e.target.data.text is matched up to the xml using @Wordlookup) or type in the name of the person (again matching the textbox's content to @Wordlookup) which results in the location of that person lighting up (MC's are named the same as the location node for each). This end works perfectly fine using this code:
      var result:String = xmldata.Searchtext.(@Wordlookup == inputTxt.text.toLowerCase()).location.toString(); 
    Now I want to do the opposite; click on a location, and the code will match up that movieclip's name to a location node in my xm - light up that location, and output the person's name in the textbox. Only problem in that Flash apparently thinks a node in my xml is now a variable that is undefined (it should return as the name that is related to the location in my xml). I have looked high and low for a solution, but I just can't seem to solve it (it is probably simple, and I'll facepalm myself) The error inducing code is this:
      var resultz:String = xmldata.Searchtext.(location.text() == e.target.name).Name.toString();
    And the error produced is this: ReferenceError: Error #1065: Variable location is not defined.
    Not sure exactly why this is happening, thank you in advance for any help!

    So my as3: (I gave you this chunk in case I've just completely missed something here)
                                  loader = new URLLoader();
                                  loadXML();
                        private function loadXML():void
                                  loader.load(new URLRequest("data.xml"));
                                  loader.addEventListener(Event.COMPLETE, onXMLLoaded)
                                  trace("loaded");
                        private function onXMLLoaded(e:Event):void
                                  xmldata = new XML(loader.data);
                                  var itemXMLList:XMLList = XMLList(xmldata.Searchtext..location);
                var count:int = itemXMLList.length();
                trace(count);
                                  trace(xmldata.Searchtext.location[25].text().toString(),xmldata.Searchtext.location[25].text.length().toString());
                           trace(xmldata.Searchtext.location[0].text().toString(),          xmldata.Searchtext.location[0].text.length().toString());
            private function LocationClick(e:Event):void
    //         var resultz:String = xmldata.Searchtext.(location.text().toString() == e.target.name).Name.toString();
    //         inputTxt.text=resultz;
               trace(e.target.name, e.target.name.length);
               inputTxt.text=e.target.name;          
    My output using this:
    loaded
    78
    $1 0
    $2 0
    $1 2
    $2 2

  • Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state

    we have developed packages to do the followings
    Extract data from DB2 Source and put it in MS Sql Server 2008 database (Lets Say DatabaseA).From MS Sql Server 2008 (DatabaseA)
    we will process the data and place it in another database MS Sql Server 2008 (DatabaseB)
    We have created packages in BIDS..We created datasource connection in Datasource folder in BIDS..Which has DB2 Connection and both Ms Sql Server connection (Windows authentication-Let
    say its pointing to the server -ServerA which has DatabaseA and DatabaseB).The datasource connections will be used in packages during development.
    For deployment we have created Package Configuration which will have both DB2 Connection and MS SqlServer connection in the config
    We deployed the packages in different MS SqlServer by changing the connectionstring in the config for DB2 and MS SqlServer...
    While runing the package we are getting the following error message
    Code: 0xC0016016     Source:       Description: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for
    use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.
    ilikemicrosoft

    Hi Surendiran,
    This is because the package has been created by somebody else and the package is being deployed under sombody else's account. e.g. If you are the creator then the package is encryption set according to your account and the package setup in SQL server is
    under a different user account.
    This happens because the package protection level is set to EncryptSensitiveWithUserKey which encrypts
    sensitive information using creator's account name.
    As a solution:
    Either you have to set up the package in SQL server under your account (which some infrastructures do not allow).
    OR
    Set the package property Protection Level to "DontSaveSensitive" and add a configuration file
    to the package and set the initial values for all the variables and all the connection manager in that configuration file (which might be tedious of-course).
    OR
    The third options (which I like do) is to open the package file and delete the password encryption entries from the package. Do note that this is not supported by designer and every time you make changes to the connection managers these encryption entries come
    back.
    Hope this helps. 
    Please mark the post as answered if it answers your question

  • Upadting a XML node value to another table

    Hi guys,
    Can you please tell me, what is wrong with the below query
    update csabcd cs set (cs.ELEMENT,cs.ELEMENT2,cs.ELEMENT3) =
            (select x.* from abcde a, xmltable ('.' passing XMLTYPE(a.xml)
                 columns mort1 varchar2 (80) path '/alert/tab1/details/Element',
                         mort2 varchar2 (80) path '/alert/tab1/details/Element2',
                         mort3 varchar2 (80) path '/alert/tab1/details/Element3'
                         ) x  where cs.aid = a.aid);i get this error
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00229: input source is empty
    Error at line 0
    ORA-06512: at "SYS.XMLTYPE", line 254
    ORA-06512: at line 1Edited by: Depakjan on Oct 21, 2010 1:35 PM

    Well from that sample, the XMLTABLE works ok...
    SQL> ed
    Wrote file afiedt.buf
      1  with abcde as (select '<?xml version="1.0" encoding="UTF-8"?>
      2  <alert>
      3    <tab0 comment="section in XSL component" name="Initial Information">
      4      <details>
      5        <Priority>0001</Priority>
      6        <DateVRUClaimInitiated>2010-06-29</DateVRUClaimInitiated>
      7      </details>
      8      <contacts comment="grid in XSL component">
      9        many child nodes here
    10      </contacts>
    11    </tab0>
    12    <tab1 comment="section in XSL component" name="Additional Information">
    13      <details comment="list collection in XSL component">
    14        <Channel1>123</Channel1>
    15        <Element>1234</Element>
    16        <Element2>1234</Element2>
    17        <Element3>1234</Element3>
    18      </details>
    19      <IPAddresses>
    20        Many child nodes here
    21      </IPAddresses>
    22      <ANIPhones>
    23        Many child nodes here
    24      </ANIPhones>
    25    </tab1>
    26  </alert>' as xml from dual)
    27  --
    28  --
    29  --
    30  select x.*
    31  from abcde a
    32      ,xmltable ('.'
    33                 passing xmltype(a.xml)
    34                 columns mort1 varchar2 (80) path '/alert/tab1/details/Element'
    35                        ,mort2 varchar2 (80) path '/alert/tab1/details/Element2'
    36                        ,mort3 varchar2 (80) path '/alert/tab1/details/Element3'
    37*               ) x
    SQL> /
    MORT1      MORT2      MORT3
    1234       1234       1234
    SQL>There must be something else in the XML that's causing the problem.
    What happens if you just do:
    select xmltype(xml) from abcde(add appropriate where clause for particular ID if necessary)
    Is it able to convert the xml strings to xmltype ok?

Maybe you are looking for

  • Web Calendar Events off by 1 hour after March 11, 2007

    We're running JES Calendar 2005Q4 with patches. Has anyone else noticed this issue yet? Look in the web interface first...on recurring appointments, everything is correct until March 11th. Then all appointments are pushed out an hour later. On April

  • Error message from OSX when using Toast

    When I opena dvd in Toast and go to slide show I get the error message below: rocess: Slideshow [241] Path: /Volumes/Snow and Scotland 2010/Slideshow.app/Contents/MacOS/Slideshow Identifier: com.roxio.Slideshow Version: ??? (1.0) Code Type: X86 (Nati

  • Type casting of primitive types

    Hi, I have two pieces of code. The type casting between them is strange. 1st snippet int i =100; byte b = i;This gives an precision error. where as this is allowed final int i =100; byte b = i;Pls explain as to why is this happening. Regards, Anand

  • No existen registros coincidentes  Objeto Definido por el usuario (OUDO)

    Hola  a todos EL sistema me esta mandando el siguiente error No existen registros coincidentes  Objeto Definido por el usuario (OUDO) (ODBC -2028) Esto al tratar de crear una factura de proveedores, he revisado varias notas y post con mensjes similar

  • Toshiba E55 exausts heat from rear, is this bad?

    The heat heats up the screen allot. Is this bad? Would a laptop cooler help?