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

Tags: Adobe LiveCycle

Similar Questions

  • 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

  • Remove xml nodes

    Hello, you know how to remove an example of XML node with a button?


    Is there a way to delete a node?

    Having a blank node is not enough? Note that when you delete something in the DOM that a reinstall the data and the model will be automatically... .This caused me grief in the past (if you get additional data from an external source).

    The command is:

    xfa.datasets.Data.Form1.Page1.Nodes.Remove (remove xfaObject);

    so usually the expression is like this:

    xfa.datasets.Data.Form1.Page1.Nodes.Remove (xfa.resolveNode ("xfa.datasets.data.form1.page1. billingMailAddr'));

    Assuming that you want to remove the nodes billingMailAddr.

    Paul

  • Replace the current XML node with another node in XML fragments

    Hello

    Please help, trying to replace an XML node with other fragments XML using XML DB, updateXML/deleteXML functions don't receive the desired result, on the front of the image below, this is what I have, and the transom is the replacement with new values XML fragment, I expect to see, there is a list of records from the XML that I need to open and do the replacement of the < broker-retail > according to the number of records to be inserted.

    Before the photo:

    < Broker-benefits-link >

    < hpp-rule > 0 < / hpp-rule >

    LISP < in.-CVCA-benefits-type > < / po-CVCA-benefits-type >

    < commit / >

    <broker-retail >

    < broker-entity-not > 1000947836 < / broker-entity-not >

    < broker-pct > 100 < / broker-pct >

    Y < principal > < / main >

    < / broker-retail >

    < / Broker-benefits-link >


    After photo (expected result):

    < Broker-benefits-link >

    < hpp-rule > 0 < / hpp-rule >

    LISP < in.-CVCA-benefits-type > < / po-CVCA-benefits-type >

    < commit / >

    <broker-retail >

    < broker-entity-not > 65656524 < / broker-entity-not >

    < broker-pct > 25 < / broker-pct >

    N < principal > < / main >

    < / broker-retail >

    <broker-retail >

    < broker-entity-not > 122224444 < / broker-entity-not >

    < > 75 broker-pct < / broker-pct >

    Y < principal > < / main >

    < / broker-retail >

    < / Broker-benefits-link >

    Kind regards

    Qwestion

    You can use DELETEXML and INSERTCHILDXML

    SQL> set long 10000
    SQL> column xmldata_new format a100
    SQL> set linesize 150
    SQL>
    SQL> with t
      2  as
      3  (
      4  select
      5  xmltype('
      6    0
      7    LISP
      8    
      9    
     10      1000947836
     11      100
     12      Y
     13    
     14  ') xmldata from dual
     15  )
     16  select xmlserialize
     17         (
     18             document
     19             insertchildxml
     20             (
     21                deletexml
     22                (
     23                    xmldata
     24                  , '/broker-benefit-link/broker-detail'
     25                )
     26              , '/broker-benefit-link'
     27              , 'broker-detail'
     28              , xmltype
     29                (
     30                '
     31                    
     32                        65656524
     33                        25
     34                        N
     35                    
     36                    
     37                        122224444
     38                        75
     39                        Y
     40                    
     41                 ').extract('/broker-master/broker-detail')
     42             )
     43             as clob indent size = 2
     44         ) xmldata_new
     45    from t;
    
    XMLDATA_NEW
    ----------------------------------------------------------------------------------------
    
      0
      LISP
      
      
        65656524
        25
        N
      
      
        122224444
        75
        Y
      
    
    
    SQL>
    
  • 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		   
  • Find the empty XML node on a table with 15 M lines

    I have a query that runs to always seek to empty xml node.

    CREATE TABLE TEST_TAB (ID number, doc XMLTYPE);

    SELECT COUNT (1)

    OF test_tab

    WHERE ((XMLEXISTS (declare default element namespace "http://oracle.com/»;)))  * / EmployeeNode / text () [not (empty (.))]'

    PASSAGE DOC)));

    Are there specific oracle or operator XML text that is more effective to check null values or a specific type of text/xml index that is best suited looking for nulls in the whole of nodes?

    Thank you

    Kevin

    In the meantime, here's a test on a similar scenario.

    It seems that the structured XMLIndex gives the best response time. The obvious drawback is that she is very specific and cannot be used to solve other queries.

    SQL > drop table test_tab is serving;

    Deleted table.

    SQL > create table test_tab like

    2. select id, cast (level as number)

    3, xmlparse (document

    4'http://xmlns.example.org ">"

    5         || -case when mod (level 5) = 0 then end level

    6         || '' correct

    (7) doc

    8 double

    9 connect by level<= 100000="">

    Table created.

    SQL > set timing on

    SQL > define pages 100

    SQL > set lines 200

    SQL > set autotrace on explain

    SQL >

    SQL > exec dbms_stats.gather_table_stats (user, 'TEST_TAB');

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:00.92

    SQL > select count (*)

    2 of test_tab

    3 where (xmlexists)

    4 ' declare default element namespace "http://xmlns.example.org"; / root/item/Text () '

    5 passage doc

    6  ) ;

    COUNT (*)

    ----------

    20000

    Elapsed time: 00:00:09.09

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 2371188561

    --------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

    --------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |          |     1.   125.   271 (1) | 00:00:04 |

    |   1.  GLOBAL TRI |          |     1.   125.            |          |

    |*  2 |   FILTER |          |       |       |            |          |

    |   3.    TABLE ACCESS FULL | TEST_TAB |   100K |    11 M |   269 (1) | 00:00:04 |

    |   4.    XPATH EVALUATION.          |       |       |            |          |

    --------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    2 filter (EXISTS (SELECT 0 FROM))

    XPATHTABLE ('/ oraxq_defpfx:root / oraxq_defpfx:Item / Text () ' PASSING: B1)

    PATH OF XMLTYPE COLUMNS ' C_00$ ' '.')  "P"))

    SQL >

    With the index structured:

    SQL >

    SQL > create index test_tab_sxi on test_tab (doc)

    2 indextype is xdb.xmlindex

    () 3 parameters

    4Q ' {XMLTABLE test_tab_xt

    5 XMLNAMESPACES (default 'http://xmlns.example.org'),

    6 ' / root/item / text () '

    {7 item_value PATH VARCHAR2 COLUMNS (30) '.'} "

    8  ) ;

    The index is created.

    Elapsed time: 00:00:10.13

    SQL >

    SQL > exec dbms_stats.gather_table_stats (user, 'TEST_TAB');

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:01.69

    SQL >

    SQL > select count (*)

    2 of test_tab

    3 where (xmlexists)

    4 ' declare default element namespace "http://xmlns.example.org"; / root/item/Text () '

    5 passage doc

    6  ) ;

    COUNT (*)

    ----------

    20000

    Elapsed time: 00:00:00.18

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 3461631238

    -------------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | Cost (% CPU). Time |

    -------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |             |     1.    28.   290 (1) | 00:00:04 |

    |   1.  GLOBAL TRI |             |     1.    28.            |          |

    |*  2 |   HASH JOIN RIGHT SEMI |             | 22015 |   601K |   290 (1) | 00:00:04 |

    |*  3 |    TABLE ACCESS FULL | TEST_TAB_XT | 22015 |   343K |    20 (0) | 00:00:01 |

    |   4.    TABLE ACCESS FULL | TEST_TAB |   100K |  1171K |   269 (1) | 00:00:04 |

    -------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    2 - access ("TEST_TAB". ROWID = "SYS_SXI_0." ("' RID ')

    3 - filter("SYS_SXI_0".") ITEM_VALUE' IS NOT NULL)

    With an index not structured:

    SQL > drop index test_tab_sxi;

    The index is deleted.

    Elapsed time: 00:00:00.11

    SQL >

    SQL >

    SQL > create index test_tab_uxi on test_tab (doc)

    2 indextype is xdb.xmlindex

    3 parameters ("PATH of TABLE test_tab_pt

    4 PATHS (INCLUDE (/ root/point))

    (5 MAPPING of namespace (xmlns = "http://xmlns.example.org"))');

    The index is created.

    Elapsed time: 00:01:20.99

    SQL >

    SQL > exec dbms_stats.gather_table_stats (user, 'TEST_TAB');

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:06.56

    SQL >

    SQL > select count (*)

    2 of test_tab

    3 where (xmlexists)

    4 ' declare default element namespace "http://xmlns.example.org"; / root/item/Text () '

    5 passage doc

    6  ) ;

    COUNT (*)

    ----------

    20000

    Elapsed time: 00:00:00.45

    Execution plan

    ----------------------------------------------------------

    Hash value of plan: 2464052102

    ---------------------------------------------------------------------------------------------

    | ID | Operation | Name | Lines | Bytes | TempSpc | Cost (% CPU). Time |

    ---------------------------------------------------------------------------------------------

    |   0 | SELECT STATEMENT |             |     1.    42.       |   773 (1) | 00:00:10 |

    |   1.  GLOBAL TRI |             |     1.    42.       |            |          |

    |*  2 |   HASH JOIN RIGHT SEMI |             |  6547 |   268K |  2176K |   773 (1) | 00:00:10 |

    |*  3 |    TABLE ACCESS FULL | TEST_TAB_PT | 53020 |  1553K |       |   283 (2) | 00:00:04 |

    |   4.    TABLE ACCESS FULL | TEST_TAB |   100K |  1171K |       |   269 (1) | 00:00:04 |

    ---------------------------------------------------------------------------------------------

    Information of predicates (identified by the operation identity card):

    ---------------------------------------------------

    2 - access ("TEST_TAB". ROWID = "SYS_P0." ("' RID ')

    3 - filter("SYS_P0".") PATHID "= HEXTORAW ('061D') AND"

    SYS_XMLI_LOC_ISTEXT ("SYS_P0". "LOCATOR", "SYS_P0" "." " PATHID') = 1)

    (tested on 11.2.0.2)

  • Alteration of the content of an XML node in java

    Hi all

    I change the contents of an XML node using java, using the method of setTextContent() a node.

    Sometimes I also add child nodes of a node. In this case, when I add the child nodes of a given node, when I print the xml data, I see the added nodes.

    for example:

    Initial XML:

    < a > < / a >
    < b > < / b >
    < c > < / c >


    For my project requirement, based on certain conditions, I do 'a' 'b', 'c' as children nodes nodes. I reached this output.


    The problem is

    FINAL XML:

    < a > < b > < / b > < c > < / c > < / a >


    I get the nodes children in the same line as above. But the power required should be as below.


    REQUIRED XML

    < a >
    < b > < / b >
    < c > < / c >
    < /a >

    I also used the Doc.normalize () function. But still, it helps strength.

    Kindly help me in this regard.

    Thank you
    Sabarisri. N

    Hello

    You can try to transform the result as below:

    Transformer transformer = TransformerFactory.newInstance () .newTransformer ();
    transformer.setOutputProperty (OutputKeys.INDENT, 'yes');

    initialize the StreamResult with the object of the file to save to file
    StreamResult result = new StreamResult (new StringWriter());

    DOMSource source = new DOMSource (doc); Here, the doc is you XML document.
    transform. Transform (source, result);

    String xmlString = result.getWriter (m:System.NET.SocketAddress.ToString ());
    System.out.println (xmlString);

    Thank you best regards &,.
    Nilesh Sahni (www.infocepts.com)

    Published by: Nilesh on August 30, 2011 12:31

  • Date in format XML nodes

    I work with XML in AS3. I'm loading in an xml with dates in a format such as:

    2011-1-12-10-00-a

    I am to convert those to the actual Date of Flash in order to compare them and use the methods of the class Date, etc. I prefer convert once and then store them in the XML node, they came.

    Is it possible to store complex values such as date or what you have in an XML?

    Yes, or more directly using:

    var ms:int=date.getTime();

    var newDate:Date = new Date (ms);

  • 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

  • Error of Conversion of forms - XML nodes more than 64K can not be inserted [ORA-31167]

    Hello

    I'm trying to convert a set of Modules of Oracle (*.fmb files, version 9) form to
    Oracle Application Express. When creating a new project of conversion, while
    Download files of forms XML (... "myform_fmb.xml"), I get, for most of them, the
    following error message:

    ORA-31167: cannot insert XML nodes more than 64 K in size.

    … Back by demand.

    My development environment is:

    Oracle 10.2.0.4.0 Linux Database
    Request Express 3.2.1.00.12

    Is it possible to avoid the 64K limit (or I'm doing something wrong)? Someone at - it
    any experience in this?
    How would be possible to identify the nodes (> 64K) offending?
    Would it be useful to try to perform the migration in a 11g environment, and then import the
    converted to 10g application?
    Are there improvements in the conversion process when you use Apex 4.0?
    Any suggestions?

    Thank you very much in advance for your answer.


    Prague, 24.6.10

    Alexander,

    Hi Alexander,.

    Indeed, it is a restriction of 10g. 10g a text inside a tag in XML (text) cannot exceed 64 KB. There are
    also no work around in 10g. In 11g this limitation was liftet - then it should work in 11g

    Does this help... ?

    Best regards

    Carsten-

  • 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

  • conversion of XML node to a string using Xquery transformation in OSB

    How to convert XML node to a string using a built in function by using Xquery transformation in OSB? In BPEL, we the Xpath function ora extension: getContentAsString() to do the same.

    Do you mean fn - bea:serialize()?

    http://download.Oracle.com/docs/CD/E13159_01/OSB/docs10gr3/Userguide/XQuery.html#wp1104692

  • 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

Maybe you are looking for

  • Satellite Pro P300 - problem with volume control

    Hello I have a problem with my volume control. He worked for the first two months of use value, but now refuses to lower the sound.He sort of stutters and actually transforms the sound upward when you turn, he 'left' to drop. I markets DEAMS it is a

  • Why does my mouse pointer stick momentarily?

    Whenever I'm on my computer and move my pointer from one place to another (read my emails or play a game online for example) most of the time my pointer moves correctly but about every 10 or 15 seconds when I'm going to move it, it freezes for about

  • 14-k074ca ENVY TouchSmart: TouchSmart HP ENVY 14-k074ca Sleekbook need to replace the battery.

    My laptop battery collapsed two weeks ago and my battery is not listed on the Web site. HP has a brocken link referring to the partners Web site which I can't access.

  • LabVIEW 8.6.1 crashes with screws built in LabVIEW 7.1.1

    Hi experts, We have recently upgraded to latest LabVIEW 8.6.1. Told us that screws built in 7.1.1 will be open in 8.6.1 without any pain, but that seems to be not right. We have a big software test built in 7.1.1 and locks up when I try to open it wi

  • Posibility to have my laptop and reinstalled

    It is in the near future, the real possibility of having reinstalled my laptop but I'm a little concerned by some drivers my laptop is a Dell Inspiron 1150 and some drivers are Dell, a XP disc these would have on or I should go to the web site and br