Remove the XML node

Dear adobe experts,

I have a requirement to remove a node in the XML interface of a form of adobe (not only by removing a subform in the form). It must be a deletion, an empty node does not work (I read this in another post).

The XML structure looks like this:

< ITEM >

< DATA >

< ROW_IID > 0 < / ROW_IID >

< PARENT > 0 < / PARENT >

< CHILD > 0 < / CHILD >

< / DATA >

< DATA >

< ROW_IID > 1 < / ROW_IID >

< PARENT > 0 < / PARENT >

< CHILD > 0 < / CHILD >

< / DATA >

< / ITEM >

I want to, for example, to remove the second node of data including the underlying elements: row_iid, parent & child. Already tried: xfa.record.nodes.remove (oRemoveNode); I got it from http://partners.adobe.com/public/developer/en/xml/Adobe_XML_Form_Object_Model_Reference.pd f and several messages in this forum, but I get the following message appears in the error console: remove failed. I know that the somexpression is correct.

Here's the code I used to try to remove the node.

var node_loc;

var del_node;

[node_loc = ' xfa.record.ELEMENT.DATA [1 '];

del_node = xfa.resolveNode (node_loc);

xfa.record.Nodes.Remove (del_node);

Anyone know what I am doing wrong?

Kind regards

Niels

Hi Steve,.

I fixed it myself. I adjusted my code a little, so the node, including the elements is successfully deleted.

Here is the way that I fixed it:

var node_loc;

var del_node;

[node_loc = ' xfa.record.ELEMENT.DATA [1 '];

del_node = xfa.resolveNode (node_loc);

xfa.record.ELEMENT.nodes.remove (del_node);

Thanks for the help!

Kind regards

Niels

Tags: Adobe LiveCycle

Similar Questions

  • Remove an XML node

    Hello

    I have an XML that is generated at the click of a button in the form.

    I use xfa.data.saveXML ("pretty"); to generate the XML.

    Here is the XML

    <? XML version = "1.0" encoding = "UTF-8"? >

    "< xfa: data xmlns:xfa ="http://www.xfa.org/schema/xfa-data/1.0/">."

    < ITEM >

    < DATA >

    < ROW_IID > 0 < / ROW_IID >

    < PARENT > 0 < / PARENT >

    < CHILD > 0 < / CHILD >

    < / DATA >

    < NAME >

    < FNAME > 0 < / FNAME >

    < LNAME > 0 < / LNAME >

    < / NAME >

    < / ITEM >

    < / xfa: data >

    I want to remove the < NAME > node in the XML file and assign the XML handling to a text field.

    Could you get it someone please let me know how to do the same thing?

    Thanks :)

    Hello

    Whereas you want to output a string you can use XSLT, so something like (which copy all xml except the NAME nodes);

    var stylesheet =

    http://www.w3.org/1999/XSL/transform">

    txt var = $data. ELEMENT.applyXSL (stylesheet.toXMLString ());

    Console.println (txt)

    You can also use;

    $data. ELEMENT.nodes.remove ($data.) ELEMENT.NAME)

    Console.println($Data.) ELEMENT.saveXML ("pretty"));

    Concerning

    Bruce

  • No idea how to loop and add the value to the attribute of the xml node?

    I work on a lot of flattening of project using a watched folder.

    I have a process parent to locate the directory and call a sub-process to flatten PDF files.

    I want to write the directory failed to XML.

    If there are several directory failed locations and if I want to add it to the node, he doesn't let me do.

    If I set the Xpath location like/process_data/outputXML/flattenDirectoryRequestMessage/failureFileLocation[x]/@path it gives me invalid character exception. I use 'x' for looping and incrementing.

    If I do not use the [x]. The directory is overwritten.

    No idea how loop and add all the directories failed to attribute of the xml node?

    I understand that you can not browse the xml code to assign the value at each node. Rather you can assign only one time to the node.

    I realized that it is not possible to do it this way. Then concatenate it as strings, and then attach to the xml once.

  • How to set the value of the xml node.

    Hello

    I have the PDF application can be entered by the user using the key. When sending

    I use following code to set the value of the xml node.

    XFA. Data.assignnode ("Employee.ID", "123", 0):

    If its generators of xml as below.

    < employee >.

    < id > 123 / < ID >.

    < / name >

    < / employee >

    Now, I need to generate xml as below.

    < employee id = '123' >

    < / name >

    < / employee >

    So, how together create the id of node as above?

    Thanks in advance.

    Kind regards

    Dhiyane

    Hi Dhiyane,

    You must set contains the property if the node id to "metadata", i.e.;

    xfa.data.assignNode ("employee.id", "123", 0);
    XFA. Data.Employee.ID.Contains = 'metadata ';

    Very awkward, if you have a number of them, in which case you might want to look at using E4X.

    Good luck

    Bruce

  • Remove the specific node of an XML stored as XMLType

    Hello

    I have a XML stored as XMLType,

    < ocaStatus xmlns = "http://xmlbeans.apache.org/ocastatus" >
    < status >
    < > 700 statusCode < / statusCode >
    < statusDate > 2010 - 03 - 31 12:39:41.580 GMT + 05:30 < / statusDate >
    < username > 1234 < / userId >
    < comment > Document is deleted from the OCA. < / comment >
    < / status >
    < status >
    < > 934 statusCode < / statusCode >
    < statusDate > 2010 - 03 - 31 12:39:41.580 GMT + 05:30 < / statusDate >
    < username > 1234 < / userId >
    < comment > Document is deleted from the OCA. < / comment >
    < / status >
    < status >
    < > 934 statusCode < / statusCode >
    < statusDate > 2010 - 03 - 31 12:39:41.580 GMT + 05:30 < / statusDate >
    < username > 1234 < / userId >
    < comment > Document is deleted from the OCA. < / comment >
    < / status >
    < / ocaStatus >

    I have a requirement where the first occurrence of statusCode 934 should be removed from the XML.
    I can do through a java program. But that is costly.
    Is there a way that this can be done by a SQL XMLQuery/XPath statement?

    Help, please.
    Thanks in advance.

    You can use DELETEXML:

    SQL> select xml from myxml;
    
    XML
    --------------------------------------------------------------------------------
    
    
    700
    2010-03-31 12:39:41.580 GMT+05:30
    1234
    Document is deleted from OCA.
    
    
    934
    2010-03-31 12:39:41.580 GMT+05:30
    1234
    Document is deleted from OCA.
    
    
    934
    2010-03-31 12:39:41.580 GMT+05:30
    1234
    Document is deleted from OCA.
    
    
    
    SQL> update myxml
      2  set xml = deletexml(xml,'//status[statusCode="934"][1]',
      3                          'xmlns="http://xmlbeans.apache.org/ocastatus"');
    
    1 row updated.
    
    SQL> select xml from myxml;
    
    XML
    --------------------------------------------------------------------------------
    
    
    700
    2010-03-31 12:39:41.580 GMT+05:30
    1234
    Document is deleted from OCA.
    
    
    934
    2010-03-31 12:39:41.580 GMT+05:30
    1234
    Document is deleted from OCA.
    
    
    

    Max
    http://oracleitalia.WordPress.com

  • How to remove the XML prologue in Oracle?

    Our system works as follows:

    1. place a piece of XML code in the database as a CLOB
    2 database converts this value to XMLTYPE (stored as a CLOB (you can skip this, Marco * {;-)))))
    3. a request then reads XML from the database and inserts it into another bit of XML
    4. the application continues his treatment based on this new composite XML.

    So far, the XML that is loaded into the database in step 1 (for various systems) has never contained a prologue. However, a new system came along and is now passing in a prologue. There are problems of application in step 3.

    Apart from trying to get the new system do not spend in the prologue, is there a way to remove it of in Oracle?

    I came up with two solutions are not elegant:

    1. use XMLTABLE to retrieve the main root node (which might be different, depending on the system sent in the data and could change)
    2 convert the prologue in a commentary, using REPLACE the product, before converting the CLOB in an XMLTYPE.

    If I was forced to use one of the following methods, I would go with 2, but I really, really hope that there is a better way to do it.

    Someone at - it any other suggestions, please?

    PS. We are currently on 10.2.0.4 and are about to move to 11.2.0.3, but the solution is to work on both versions, for more fun and excitement!

    It's error, the application gives: "error obtaining Exception of SAX for additional information: no processing instruction begins with"xml"" who says that the app dev is due to the presence of the prologue in the middle of xml, the app has build up.

    So, basically, the app just "glue" XML in the middle of the other regardless of the structure? What kind of design is?
    IMO, the application needs to be fixed, not the XML input.

    A lot about how to add the prologue, nothing on how to remove it!

    You can use the XMLQuery function to get the root element:

    SQL> create table tmp_xml3 of xmltype
      2  xmltype store as basicfile clob;
    
    Table created
    
    SQL> insert into tmp_xml3 values (xmltype(''));
    
    1 row inserted
    
    SQL> select * from tmp_xml3;
    
    SYS_NC_ROWINFO$
    --------------------------------------------------------------------------------
    
    
    SQL>
    SQL> select xmlquery('*' passing object_value returning content)
      2  from tmp_xml3;
    
    XMLQUERY('*'PASSINGOBJECT_VALU
    --------------------------------------------------------------------------------
    
     
    

    Published by: odie_63 on August 22, 2012 15:26

  • You need to remove the XML tag... Having the same element

    Hello guys,.

    need help, im having trouble removing the tag < EVENT [elem = 6] >

    < EVENTS elem = "6" >

    < FROM_CODE / >

    < PROMO_ID / >

    < TO_CODE / >

    < TELCO_INFO >

    < CALLED_TO > 0063 < / CALLED_TO >

    < CALLING_FROM > 63937390517 < / CALLING_FROM >

    < / TELCO_INFO >

    < GSM_INFO >

    < Indicated / >

    < USAGE_TYPE > DATA < / USAGE_TYPE >

    < / GSM_INFO >

    < START_T > 20/11/2015 22:08 < / START_T >

    < END_T > 20/11/2015 22:08 < / END_T >

    < BAL_IMPACTS elem = "0" >

    < AMOUNT > 0.89 < / AMOUNT >

    < IMPACT_TYPE > 258 < / IMPACT_TYPE >

    < QUANTITY > 103229 < / QUANTITY >

    < RATE_TAG / >

    VAT < TAX_CODE > < / TAX_CODE >

    < / BAL_IMPACTS >

    < BAL_IMPACTS elem = "1" >

    < AMOUNT > 0.11 < / AMOUNT >

    < IMPACT_TYPE > 4 < / IMPACT_TYPE >

    < QUANTITY > 0.89 < / QUANTITY >

    < RATE_TAG / >

    VAT < TAX_CODE > < / TAX_CODE >

    < / BAL_IMPACTS >

    < elem TOTAL = "608" >

    < AMOUNT > 1 < / AMOUNT >

    < / TOTAL >

    < AMOUNT_GROSS > 1 < / AMOUNT_GROSS >

    < AMOUNT_TAXED > 0.89 < / AMOUNT_TAXED >

    < / EVENTS >

    < EVENTS elem = "6" >

    < SYS_DESCR > Cycle before expenses (rev): 549 DUAL-DEF < / SYS_DESCR >

    < BAL_IMPACTS elem = "0" >

    < QUANTITY > 1 < / QUANTITY >

    Plan < RATE_TAG > < / RATE_TAG >

    < AMOUNT > 490,18 < / AMOUNT >

    < IMPACT_TYPE > 1 < / IMPACT_TYPE >

    VAT < TAX_CODE > < / TAX_CODE >

    < / BAL_IMPACTS >

    < BAL_IMPACTS elem = "1" >

    < QUANTITY > 549 < / QUANTITY >

    Plan < RATE_TAG > < / RATE_TAG >

    < AMOUNT > - 490.18 < / AMOUNT >

    < IMPACT_TYPE > 32 < / IMPACT_TYPE >

    < TAX_CODE > VTSKY < / TAX_CODE >

    100% of < DISCOUNT_INFO > < / DISCOUNT_INFO >

    < / BAL_IMPACTS >

    < BAL_IMPACTS elem = "2" >

    < QUANTITY > 490,18 < / QUANTITY >

    Tax of < RATE_TAG > < / RATE_TAG >

    < AMOUNT > 58,82 < / AMOUNT >

    < IMPACT_TYPE > 4 < / IMPACT_TYPE >

    VAT < TAX_CODE > < / TAX_CODE >

    < / BAL_IMPACTS >

    < BAL_IMPACTS elem = "3" >

    < QUANTITY > - 490.18 < / QUANTITY >

    Tax of < RATE_TAG > < / RATE_TAG >

    < AMOUNT > - 58.82 < / AMOUNT >

    < IMPACT_TYPE > 4 < / IMPACT_TYPE >

    < TAX_CODE > VTSKY < / TAX_CODE >

    < / BAL_IMPACTS >

    < elem TOTAL = "608" >

    < AMOUNT > 0 < / AMOUNT >

    < / TOTAL >

    < CYCLE_START_T > 20/12/2015-00:00:00 < / CYCLE_START_T >

    < CYCLE_END_T > 20/01/2016 00:00:00 < / CYCLE_END_T >

    < START_T > 20/12/2015-00:00:00 < / START_T >

    < END_T > 20/12/2015-00:00:00 < / END_T >

    < AMOUNT_GROSS > 490,18 < / AMOUNT_GROSS >

    < AMOUNT_TAXED > 0 < / AMOUNT_TAXED >

    < / EVENTS >

    in my XML file, it apprear 2 < elem = 6 EVENTS > but you just have to remove the entire < elem = 6 EVENTS > with < SYS_DESC >.

    Thanks in advance.

    Your XML file is invalid because it is not an outside element.  In any case, after that...

    with Data (THE_XML) as)

    Select xmltype (')

    0063

    63937390517

    DATA

    20/11/2015-22:08

    20/11/2015-22:08

    0.89

    258

    103229

    VAT

    0.11

    4

    0.89

    VAT

    1

    1

    0.89

    Cycle advance costs (rev): DUAL-DEF 549

    1

    Plan

    490,18

    1

    VAT

    549

    Plan

    -490.18

    32

    VTSKY

    100% discount

    490,18

    Tax

    58,82

    4

    VAT

    -490.18

    Tax

    -58.82

    4

    VTSKY

    0

    20/12/2015-00:00:00

    20/01/2016 00:00:00

    20/12/2015-00:00:00

    20/12/2015-00:00:00

    490,18

    0

    ')

    of the double

    )

    Select deletexml (the_xml, "/ ROOT/EVENTS[@elem="6 "and SYS_DESCR]')

    from the data

    (As requested) RESULT

    0063

    63937390517

    DATA

    20/11/2015-22:08

    20/11/2015-22:08

    0.89

    258

    103229

    VAT

    0.11

    4

    0.89

    VAT

    1

    1

    0.89

  • How to remove the Parent node in the tree

    Hello

    I have a component of the tree in oracle adf and I want to delete a node in this tree. When I want to remove a child node, I don't have an error but when I want to delete a parent node, who have children, I have error. because it has foreign keys.

    Can someone help me?

    You can follow one of two approaches suggested by Timo

    I'd rather cascase remove option - see this https://www.silnium.com/blog/adf/implementing-adf-cascade-delete/

    Cascade Delete - ADF | Technology blog

    If you want to cross-see this

    Andrejus Baranovskis Blog: How browse ADF

  • How to remove the xml with indesign file attributes.

    Dear friends,

    I need to remove attributes xml ('ul' element), I try to underside of coding and joint screenshot also, but I made a mistake. I'm not that I lack the coding below.

    Screen Shot 2016-02-22 at 12.57.49 PM.png

    My coding in the below.

    var elements = app.activeDocument.xmlElements[0].xmlAttributes.item["@new_class"] = "list-style-type:none";
        alert(elements.length);
        delete elements["@new_class"];
    

    Please suggest friends,

    Thank you in advance,

    Hello

    Try this...

    var doc = app.activeDocument;
    
    removeAttributes(doc,'ul','style','list-style-type:none');
    
    function removeAttributes(source,element,attributename,attributevalue){
        for (var i = 0; i < source.xmlElements.length; i++){
                try{
                    for(j=0; j		   
  • Problem with to access the XML nodes whose namespace

    Hello
    I have a XML file with the following format;

    "" "" "< graphml version ="1.3"xmlns =" http://graphml.graphdrawing.org/xmlns/graphml ' xmlns:y = ' http://www.yworks.com/xml/graphml ' xmlns: xsi = " http://www.w3.org/2001/XMLSchema-instance" > "

    < graph id = 'G' edgedefault 'ordered' = >

    < key data 'd11' = >
    < y: SharedData >
    < name there: Brush = "SolidBrush" color = "Black" id = "1" / >
    < / y: SharedData >
    < / data >

    < node id = "G:n0" >
    < y: Labels >
    < y: Text > <! [CDATA [start]] > < / Text: y >
    < / y: Labels >
    < / node >

    < node id = "G:n1" >
    < y: Labels >
    < y: Text > <! [CDATA [end]] > < / Text: y >
    < / y: Labels >
    < / node >

    < / chart >

    < / graphml >


    I access this file as < mx:XML id = "layoutXml" source = "tmp.xml" / > "

    I have no application debugging and found that the layoutXml object contains the xml file as it is. Now when I try to access any child node of layoutXml, every time I found null. Same instruction layoutXml.graph.toXMLString () or layoutXml.graph.toString () returns null.

    I have tryied the following approach as well, but did not work,
    var nameSpace:Namespace = new Namespace (" http://www.yworks.com/xml/graphml");
    var str:String = layoutXml.graph.node. (@id == ' G:n0").nameSpace::Labels.nameSpace::Text.toXMLString();")
    also, this property returns null.

    If anyone has the solution, please answer.

    Thank you.

    Namespace var sets default namespace:
    lack of namespace xml = nameSpace;

    You should then be able to reference nodes normally.

    Tracy

  • The value of the XML node

    I'm going after Yahoo Weather and try to get the value of an XML node

    So after I take the node

    item_buildNode.ToString () = < lastBuildDate > Tuesday, December 26, 2006 12:51 pm CST < / lastBuildDate >

    So I know that I have the appropriate node

    But I want just the value without the tags

    If I try to item_buildNode... nodeValue, which returns a null value

    Can I just the value? If so, how?


    Thank you
    Mathias

    Well, too bad. I have search the Forum better.

    It's item_buildNode.firstChild.nodeValue

  • Retrieve the value of the XML node in XMLTable

    Hello, hope that it is something simple and I went beside her, but consider this example:
     with et as(
         SELECT 
               xmlType('<Invoice>
        <InvoiceInformation>
            <Number>123456</Number>
        </InvoiceInformation>
        <InvoiceLines>
            <InvoiceLine>
                <Detail>
                    <Amount>100</Amount>
                    <Line>1</Line>
                </Detail>
                <Type>
                    <CheesyPotato>
                        <Instructions>
                            <CookTime>120</CookTime>
                            <CookTimeUnits>Minutes</CookTimeUnits>
                            <CookTemperature>450</CookTemperature>
                        </Instructions>
                    </CheesyPotato>
                </Type>
            </InvoiceLine>
            <InvoiceLine>
                <Detail>
                    <Amount>10000</Amount>
                    <Line>2</Line>
                </Detail>
                <Type>
                    <DeathStar>
                        <Instructions>
                            <CookTime>4</CookTime>
                            <CookTimeUnits>5 "parsecs"</CookTimeUnits>
                            <CookTemperature>1000000</CookTemperature>
                        </Instructions>
                    </DeathStar>
                </Type>
            </InvoiceLine>  
            <InvoiceLine>
                <Detail>
                    <Amount>250</Amount>
                    <Line>3</Line>
                </Detail>
                <Type>
                    <Quiche>
                        <Instructions>
                            <CookTime>75</CookTime>
                            <CookTimeUnits>Minutes</CookTimeUnits>
                            <CookTemperature>350</CookTemperature>
                        </Instructions>
                    </Quiche>
                </Type>      
            </InvoiceLine>    
        </InvoiceLines>  
    </Invoice>  
     ') xt
          from dual
           ) 
            SELECT     
                ext.*
               FROM
               et,
               XMLTABLE(
               'for $Invoice in $INV/Invoice
                    for $InvoiceItem in $Invoice/InvoiceLines/InvoiceLine
                      return <row> 
                      {
                        $Invoice
                        ,$InvoiceItem
                      } 
                      </row>'           
                  PASSING et.xt as INV
                        COLUMNS
                   INVOICENUMBER                   VARCHAR2  (6)       PATH 'Invoice/InvoiceInformation/Number'                    
                  ,InvoiceLineNumber               VARCHAR2  (5)       PATH 'InvoiceLine/Detail/Line'
                  ,Amount                          VARCHAR2  (5)       PATH 'InvoiceLine/Detail/Amount'
                  ,CookTime                        VARCHAR2  (5)       PATH 'InvoiceLine/Type//Instructions/CookTime'
                  ,CookTimeUnits                   VARCHAR2  (15)       PATH 'InvoiceLine/Type//Instructions/CookTimeUnits'
                  ,CookTemperature                 VARCHAR2  (10)       PATH 'InvoiceLine/Type//Instructions/CookTemperature'
                ) ext
    /            
                  
                  
        INVOICENUMBER INVOICELINENUMBER AMOUNT COOKTIME COOKTIMEUNITS   COOKTEMPERATURE 
    ------------- ----------------- ------ -------- --------------- --------------- 
    123456        1                 100    120      Minutes         450             
    123456        2                 10000  4        5 "parsecs"     1000000         
    123456        3                 250    75       Minutes         350   
    How the child node of the 'name' Type?
    TypeChild       INVOICENUMBER INVOICELINENUMBER AMOUNT COOKTIME COOKTIMEUNITS   COOKTEMPERATURE 
    ------------------- ------------- ----------------- ------ -------- --------------- --------------- 
    CheesyPotato 123456        1                 100    120      Minutes         450             
    DeathStar      123456        2                 10000  4        5 "parsecs"     1000000         
    Quiche          123456        3                 250    75       Minutes         350 
    I have tried different methods; along the lines of ', $InvoiceItem, Type, child, name ' does not, any help would be appreciated, thanks

    Hello

    You can use the name() function in the COLUMNS clause:

    SQL> WITH et AS(
      2    SELECT XMLType('
      3      
      4          123456
      5      
      6      
      7          
      8              
      9                  100
     10                  1
     11              
     12              
     13                  
     14                      
     15                          120
     16                          Minutes
     17                          450
     18                      
     19                  
     20              
     21          
     22          
     23              
     24                  10000
     25                  2
     26              
     27              
     28                  
     29                      
     30                          4
     31                          5 "parsecs"
     32                          1000000
     33                      
     34                  
     35              
     36          
     37          
     38              
     39                  250
     40                  3
     41              
     42              
     43                  
     44                      
     45                          75
     46                          Minutes
     47                          350
     48                      
     49                  
     50              
     51          
     52      
     53  ') xt
     54    FROM dual
     55  )
     56  SELECT ext.*
     57  FROM et
     58     , XMLTable(
     59         'for $Invoice in $INV/Invoice
     60            for $InvoiceItem in $Invoice/InvoiceLines/InvoiceLine
     61            return 
     62            {
     63              $Invoice/InvoiceInformation
     64            , $InvoiceItem
     65            }
     66            '
     67         PASSING et.xt as INV
     68         COLUMNS
     69           typechild          VARCHAR2(30)  PATH 'name(InvoiceLine/Type/*)'
     70         , INVOICENUMBER      VARCHAR2(6)   PATH 'InvoiceInformation/Number'
     71         , InvoiceLineNumber  VARCHAR2(5)   PATH 'InvoiceLine/Detail/Line'
     72         , Amount             VARCHAR2(5)   PATH 'InvoiceLine/Detail/Amount'
     73         , CookTime           VARCHAR2(5)   PATH 'InvoiceLine/Type/*/Instructions/CookTime'
     74         , CookTimeUnits      VARCHAR2(15)  PATH 'InvoiceLine/Type/*/Instructions/CookTimeUnits'
     75         , CookTemperature    VARCHAR2(10)  PATH 'InvoiceLine/Type/*/Instructions/CookTemperature'
     76       ) ext
     77  ;
    
    TYPECHILD                      INVOICENUMBER INVOICELINENUMBER AMOUNT COOKTIME COOKTIMEUNITS   COOKTEMPERATURE
    ------------------------------ ------------- ----------------- ------ -------- --------------- ---------------
    CheesyPotato                   123456        1                 100    120      Minutes         450
    DeathStar                      123456        2                 10000  4        5 "parsecs"     1000000
    Quiche                         123456        3                 250    75       Minutes         350
     
    

    If this does not work for your version (pre 11g), you will need to push the expression in the main XQuery expression:

    ...
       , XMLTable(
           'for $Invoice in $INV/Invoice
              for $InvoiceItem in $Invoice/InvoiceLines/InvoiceLine
              return 
              {
                element TypeChild {name($InvoiceItem/Type/*)}
              , $Invoice/InvoiceInformation
              , $InvoiceItem
              }
              '
           PASSING et.xt as INV
           COLUMNS
             typechild          VARCHAR2(30)  PATH 'TypeChild'
           , INVOICENUMBER      VARCHAR2(6)   PATH 'InvoiceInformation/Number'
    ...
    
  • Remove the XML attribute

    Hello

    I export xml data into our database files. Since the xsd has changed it can be exported directly to another db to a third-party tool and I (among others) remove an attribute of an element
    CREATE TABLE xml_test(
          message XMLTYPE
          )
    /
    INSERT INTO xml_test
    VALUES (q'[<?xml version="1.0" encoding="ISO-8859-1"?>
    <ZusyMeldung xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns="http://www.zusy.de/2002/XMLSchema" 
    xsi:schemaLocation="http://www.zusy.de/2002/XMLSchema ZusyAZ01.xsd">
      <TransferHeader xsi:nil="true"/>
      <Daten>
        A lot more elements
      </Daten>
    </ZusyMeldung>]')
    /
    COMMIT;
    < TransferHeader xsi: Nil = 'true' / > should become < TransferHeader / >.

    I want to write files directly with the script next and tried to use updateXML in my SELECTION, but somehow I don't understand well.
    DECLARE
        CURSOR cur_out IS
            SELECT  message
            FROM    xml_test;
    BEGIN
        FOR r_out IN cur_out LOOP
            dbms_xslprocessor.clob2file (
                 r_out.message
                ,'DIR_XMLOUT'
                ,'out_name.xml'
                ,0
                );
        END LOOP;
    END;
    /
    Concerning
    Marcus

    Hi Marcus,

    Given that you want to remove, try deleteXML :

    select xmlserialize(document
             deletexml(
               message
             , '/ZusyMeldung/TransferHeader/@xsi:nil'
             , 'xmlns="http://www.zusy.de/2002/XMLSchema", xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"'
             )
           )
    from xml_test ;
    

    Note that the functions of XML DML Oracle (updateXML, deleteXML etc.) are not recommended in 11.2.0.3 for the update of XQuery:

    select xmlquery(
             'declare default element namespace "http://www.zusy.de/2002/XMLSchema"; (: :)
              copy $d := .
              modify ( delete node $d/ZusyMeldung/TransferHeader/@xsi:nil )
              return $d'
            passing message
            returning content
           )
    from xml_test ;
    
  • AS2 change the XML node button

    Hello

    I'm a training designer ACE. I would be grateful if someone can help me solve this code.  I need my flash application in order to move nodes for certain text fields and a movieclip that load images, when I click on one of the 6 simple buttons. Everything works except the part. How to change nodes? Can not find anywhere in websearch buttons change nodes, maybe it's called something else and not "switching nodes? Here is a part of the code that I can't solve, he begins to / / part of the PROBLEM. Thank you!

    //-----------AS2

    function loadXML(loaded) {
        if (loaded) {
        
            _root.locationX = this.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue;
            _root.nameX = this.firstChild.childNodes[0].childNodes[1].firstChild.nodeValue;
            _root.emailX = this.firstChild.childNodes[0].childNodes[2].firstChild.nodeValue;
            _root.image = this.firstChild.childNodes[0].childNodes[3].firstChild.nodeValue;
    
    //loads text
            location_txt.text = _root.locationX;
            name_txt.text = _root.nameX;
            email_txt.text = _root.emailX;
    //loads image   
            var url:String = _root.image;
            var movieClip:MovieClip = createEmptyMovieClip("movieClip", 0);
            movieClip.loadMovie(url);
            
        
    // PROBLEM:  this BUTTON has to switch values to next node
      
    menu1.onPress = function() {
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
            _root.locationX = loadXML.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
            _root.nameX = loadXML.firstChild.childNodes[1].childNodes[1].firstChild.nodeValue;
            _root.emailX = loadXML.firstChild.childNodes[1].childNodes[2].firstChild.nodeValue;
            _root.image = loadXML.firstChild.childNodes[1].childNodes[3].firstChild.nodeValue;
    }
    menu2.onPress = function() {
    xmlData = new XML();
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;
            _root.locationX = loadXML.firstChild.childNodes[2].childNodes[0].firstChild.nodeValue;
            _root.nameX = loadXML.firstChild.childNodes[2].childNodes[1].firstChild.nodeValue;
            _root.emailX = loadXML.firstChild.childNodes[2].childNodes[2].firstChild.nodeValue;
            _root.image = loadXML.firstChild.childNodes[2].childNodes[3].firstChild.nodeValue;
    }
    /// ...etc. --- 6 simple buttons, so far it is not working
    
    
    } else {
    content = "file not loaded!";
    }
    }
    

    +++ XML file: CDA to CDA, PLM button for button PLM, etc..

    <?xml version="1.0" encoding="utf-8" ?>
    <dots>
        <DATA>
              <location>Empty location</location>
              <name>Empty Name</name>
              <email>Empty email address</email>
              <image>Contacts/img/empty.jpg</image>
    
        </DATA>
        <CDA>
              <location>Annemasse - CDA M&T Team</location>
              <name>John Doe CDA</name>
              <email>[email protected]</email>
              <image>Contacts/img/img1.jpg</image>
    
        </CDA>
        <PLM>
              <location>Annemasse - PLM key user</location>
              <name>John Doe PLM</name>
              <email>[email protected]</email>
                        <img>Contacts/img/img2.jpg</img>
    
        </PLM>
        <CAD>
              <location>Annemasse - CAD key user</location>
              <name>John Doe CAD</name>
              <email>[email protected]</email>
                        <img>Contacts/img/img3.jpg</img>
    
        </CAD>
        <CAE>
              <location>Annemasse - CAE key user</location>
              <name>John Doe CAE</name>
              <email>[email protected]</email>
                        <img>Contacts/img/aimg4.jpg</img>
    
        </CAE>
        <PMT>
              <location>Annemasse - PMT key user</location>
              <name>John Doe PMT</name>
              <email>[email protected]</email>
                        <img>Contacts/img/img5.jpg</img>
    
        </PMT>
        <engineering>
              <location>Annemasse - ENGINEERING IS CONTACTS</location>
              <name>John Doe ENG</name>
              <email>[email protected]</email>
                        <img>Contacts/img/img6.jpg</img>
    
        </engineering>
    </dots>
    

    Use the movieclip buttons and load your xml only once file:

    var movieClip:MovieClip = createEmptyMovieClip("movieClip", 0);

    var xmlData:XML;
    xmlData.ignoreWhite = true;
    xmlData.onLoad = loadXML;

    xmlData.load (whatever.xml);

    function loadXML() {
    xmlData=this;

    }

    for(var i:Number=0;i<6;i++){  // assuming you have menu0,menu1,...,menu5

    this["menu"+i].ivar=i;

    this["menu"+i].onRelease=changeF;


    function changeF(){


            _root.locationX = xmlData.firstChild.childNodes[this.ivar].childNodes[0].firstChild.nodeValue;
            _root.nameX = this.firstChild.childNodes[this.ivar].childNodes[1].firstChild.nodeValue;
            _root.emailX = this.firstChild.childNodes[this.ivar].childNodes[2].firstChild.nodeValue;
            _root.image = this.firstChild.childNodes[this.ivar].childNodes[3].firstChild.nodeValue;

    //loads text
            location_txt.text = _root.locationX;
            name_txt.text = _root.nameX;
            email_txt.text = _root.emailX;
    //loads image  
            var url:String = _root.image;
           
            movieClip.loadMovie(url);

    }    

  • Make the XML nodes

    I'm trying to get my XML document-specific information... Here is the info:

    < test >
    < UI > < /iu > 2000
    < amt > 125 < / amt >
    < dump > 0.2 < / dump >
    < > 3.2 hData < / hData >
    < hData > 16 < / hData >
    < > 8 hData < / hData >
    < UI > < /iu > 2000
    < amt > 125 < / amt >
    < dump > 0.3 < / dump >
    < > 4.8 hData < / hData >
    < hData > 16 < / hData >
    < > 8 hData < / hData >
    < / test >

    Here's the code in Flash:

    var myURLLoader:URLLoader = new URLLoader();
    var myURLRequest:URLRequest = new URLRequest ("dump.xml");
    myURLLoader.load (myURLRequest);
    myURLLoader.addEventListener (Event.COMPLETE, dataOK);
    function dataOK(myevent:Event):void {}
    var myXML:XML = new XML (myURLLoader.data);
    TF1. Text = myXML.hData [1];

    }

    He steps back a value of 16, that is correct.  But I want to be able to refer to a specific location, such as the second dump data and the 3rd entry here.  So I tried:

    TF1. Text = myXML.dump [1] .hData [2];

    He comes back with:

    TypeError: Error #1010: a term is undefined and has no properties.

    I gues I just need to know how to read the nodes that are above hData.

    Thank you.

    Dave

    hData nodes are not children of dump nodes.  use:

    myXML.hData [5]

Maybe you are looking for