How to remove a node in an XML document

Hello

My flex plugin loads an XML document that is passed from the ExternalInterace. I have a list control that displays the data from the XML document.

The XML looks like:
< document >
< response >
< objectlist >
< list type = "type" >
< object type = "type" name = "Value name" id = "GUID value1" >
< params >
.........
.........
< params >
< / object >
<! - several items in this list - >

< / list >
< / objectlist >
< / answer >
< / document >

I set the dataProvider of the list to xmlDoc.response.objectlist.list.object

Here, I want to delete one of the object before displaying the data nodes (in other words, I don't want one of the nodes in the document XML should appear in the list).

How can I do this? I couldn't find a way to remove a node in the XML api.

-Gerard

You can either use the operator 'delete ':
delete xmlDoc.response.objectlist.list.object [5]
When the object to delete can be the fifth down (you need to play with your xml code in debugging down actual values) or convert xmlListCollection. The xmlListCollection provides easy methods to remove the offending nodes or you can provide a function filterFunction for the collection that allows you to "hide" the node.

Tags: Flex

Similar Questions

  • How to remove the value of the XML attribute in the Indesign file with javascript

    Hi all

    How to remove the value of the XML attribute in the Indesign file.

    1.jpg

    What error is this?

    in any case try this as well (one another),

    var myDoc = app.activeDocument;
    attrDelete(myDoc);
    function attrDelete(elm)
    {
        for (var i = 0; i < elm.xmlElements.length; i++)
        {
            try{
                for(j=0; j
    

    Vandy

  • Delete an end (leaf) Node in an XML Document

    I have an object type node, where each of them was a node of object type, which can contain a node of type object etc. I need to remove the last item and returns the new xml document, see example, any ideas?

    < id menuItem = "itemID" Graphic = "" name = "test01" text = "test01" > "
    < id menuItem = "itemID" Graphic = "" name = "test01" text = "test01" > "
    < id menuItem = "itemID" Graphic = "" name = "test01" text = "test01" > "
    < id menuItem = "itemID" Graphic = "" name = "test01" text = "test01" > "
    < / menuItem >
    < / menuItem >
    < / menuItem >
    < / menuItem >

    Thank you

    Chester

    public void removeEndNode(value:XML):XML {}
    If (value.descendants("*").length () == 0) {}
    return (value) XML;
    } else {}
    value.descendants("*") [value.descendants("*").length () - 2] = "";
    return (value) XML;
    }
    }

  • How to remove a line in a PDF document?

    How to remove a line in a PDF so it's not an empty space left after that I have remove the text in the line I want to delete?

    Basically you don't have. PDF is not a file format of spreadsheet or word processing (see ISO 32000 for a description of this PDF "is").

    After enjoying a few eve readings long winter of the ISO standard, you will come to realize this PDF is no 'tables', the 'lines', the 'columns '...

    Content objects are "painted" on page PDF "canvas" - kinda sorta a paint-by-numbers thing.

    That said you can use content redaction Acrobat Pro for slick tool. Maybe not as elegant as you want, but if done correctly the content is gone (for sure, absolutely, forever).

    Be well...

  • How to remove a page of the PDF document?

    How to remove a page from the PDF?

    Tools > Pages > delete

    Select that range from the page to remove

    Click on the OK button

  • How can I combine 2 pl/sql xml documents

    Hello

    We are generating a report with DBMS_XMLGEN. The report is too large and the selection is very heavy. Don't want to use dynamic SQL statements. I am trying to break the queries and generate xml data, and then add the docs together. Is there a way we can add an xml document to another?

    Thank you for your help in advance.

    I plan to write queries (10 queries) in this case and generate XML fragments and inserted into a temporary table and then concatenate them.

    In this case, you will need the aggregation in the rows XMLAgg function, don't not XMLConcat.

  • How to remove a child in an XML object?

    Hey guys, I'm a new user for AS3. I did an xml object and add a few children. I use appendChild() to add a child to the XML. But if I want to delete one, what should I do? I tried to search in the reference, but I can not find a remove function.

    var questions: XML =

        
        
        
        
        
        

    ;

    function deleteNode(value:XML)
    {

    if(value==null) {return ;}
    If (value. Parent () == null) {return ;}
    delete value.parent () .children () [value.childIndex ()]
    }

    Example: To remove the third node (Id = 3)

    deleteNode (questions. Issue. (@Id is "3") [0])

    OR

    deleteNode (questions. Question [2])

  • How to remove start up no disc recovery documents

    I upgraded my boot of Win7 on an SSD drive and use the previous start for data and programs.  I deleted the old boot drive windows folder but cannot delete recovery file.  I can't get its size through properties, but it is apparently huge.  The 750 GB drive is almost complete, but only 100 MB appears in other folders.  How can I remove this folder in order to regain the space?

    Right-click on the recovery folder and go to properties. Under properties, go to the Security tab down the bottom click on advanced. Then go to the owner tab, click on change. Once this is done in the double list click your user name, and check the box Replace owner of subcontainers and objects. Click on apply. Return to the Security tab, and then click Advanced again. Click on change permissions. Double click on your username and check the two boxes below. Press on apply. Once this is done, you should have no problem deleting the folder.

  • How to remove the white background around the document when printing

    Everytime I go to print something in Photoshop, when I print there a white boarder around him...

    How can I remove the border?

    It's probably the print margin. Printers will not print to the edge on standard printer. The only way that you can print to the edge is implemented with the brand culture and then cut your works of art.

  • How to remove spaces in the output HTML document?

    I read data from database, then I do it in HTML + CSS + js out with some custom tags format.
    I use paging and exit only 10 records per page - there is no some long fields, but many conditions CFIF, etc..
    I noticed that there are a lot of white space, which could be lost.
    However, when I use cfprocessingdirective or enablecfoutputonly - I see almost any difference compared to not use them: places are in their places (like < tr >... < td >... etc).
    Also - I can't put < cfsilent > everywhere, because there are TONS of cfif terms of the code...

    What should I do? :( Maybe there's some magical setting in the CF for this administrator.

    There is a CF administrative setting - enable Whitespace Management on
    the settings page.

    Other management tools of the white space you mentioned can also be made to
    work. But you don't have to code your pages with white spaces in mind. For
    example, using works even better if you can group your logic in
    blocks. Even with enableoutputonly. If your page is a giant
    you won't see a lot of improvement with this option.
    To make it work, you need to have only the tags all about what is
    in fact intended to be sent to the client any of of the processing logic.

  • How to extract the node where the value of the node is the max in all of the XML document?

    Hello

    I have a transaction that refers to an xmltype in iRecruitment, containing multiple versions of the same node as follows:

    (only for the example data)



    {noformat} & lt; Transaction & gt;


    & lt; data & gt;


    & lt; ObjectVersionNumber & gt; 1 & lt; / object_version_number & gt;


    & lt; EO & gt;


    & lt; Attribute1 & gt; A & lt; / Attribute1 & gt;


    & lt; Attribut2 & gt; B & lt; / attribut2 & gt;


    & lt; /EO & gt;


    & lt; / data & gt;


    & lt; data & gt;


    & lt; ObjectVersionNumber & gt; 2 & lt; / object_version_number & gt;


    & lt; EO & gt;


    & lt; Attribute1 & gt; A & lt; / Attribute1 & gt;


    & lt; Attribut2 & gt; C & lt; / attribut2 & gt;


    & lt; /EO & gt;


    & lt; / data & gt;


    & lt; data & gt;


    & lt; ObjectVersionNumber & gt; X & lt; / object_version_number & gt;


    & lt; EO & gt;


    & lt; Attribute1 & gt;? & lt; / Attribute1 & gt;


    & lt; Attribut2 & gt;? & lt; / attribut2 & gt;


    & lt; /EO & gt;


    & lt; / data & gt;


    & lt; / Transaction & gt; {noformat}

    I can extract a value for FULL-TIME 1 or 2, is not a problem.
    However, how can I go on the selection of a value of an attribute below FULL-TIME X, where X is the maximum value of FULL-TIME in any node in the XML document?

    I tried to the last node corresponding to my way, but it is not always the case that the FULL-TIME max will correspond to this scenario.

    Any help would be greatly appreciated!

    Thank you very much, Pete

    Published by: Pete Mahon on February 24, 2009 12:11

    Here's a way

    SQL> set long 100000
    SQL> with XML as (
      2  select XMLTYPE(
      3  '
      4  
      5     
      6             1
      7             
      8                     A
      9                     B
     10             
     11     
     12     
     13             2
     14             
     15                     A
     16                     C
     17             
     18     
     19     
     20             3
     21             
     22                     ?
     23                     ?
     24             
     25     
     26  ') OBJECT_VALUE
     27    from dual
     28  )
     29  select DATA, OVN
     30    from XML,
     31         XMLTable
     32         (
     33           '/Transaction/data'
     34           passing OBJECT_VALUE
     35           columns
     36           DATA XMLType path '.',
     37           OVN  number  path 'ObjectVersionNumber'
     38         )
     39   where OVN = ( select MAX(OVN)
     40                   from XML,
     41                        XMLTable
     42                        (
     43                          '/Transaction/data'
     44                          passing OBJECT_VALUE
     45                          columns
     46                          OVN  number  path 'ObjectVersionNumber'
     47                        )
     48               )
     49
    SQL> /
    
    DATA
    --------------------------------------------------------------------------------
           OVN
    ----------
    3?
    ?
             3
    
    SQL>
    
  • XML document lack of implementation in the form after adding the node

    Hi all

    I'm adding a new node to my XML document using java.

    After I add, when I print the doc, I can see the xml code is not properly 'indexed' or 'formatted' (with a step internal node within the parent node.)

    I have put OutputKeys.INDEX that Yes. But I still have this problem.


    Kindlly help me regarding this.


    Thank you
    Sabarisri. N

    After I add, when I print the doc, I can see that xml is not properly "indexed" (sic, "indented") or 'formatted' (with a step internal node within the parent node.)

    It is indeed a common place of what to get. Rarely these whitespace contravene semantic aspects of xml, but it's annoying to the human eye. The OutputKeys.INDENT on the transformer fixing certainly wouldn't heal and makes it worse.

    If the lack of alignment gets enough wide, sometimes I use a custom xsl file to put an order of it. This is how the xsl looks like: it is just a slight development of an identity transformation. And I assume you are using jdk1.5 + packaged xerces and xalan.

    
    
    
    
    
        
            
        
    
    
        
    
    
    

    Suppose to be called indenter.xsl, and put themselves in the working directory. Printing to a file may seem just that.

    TransformerFactory tf = TransformerFactory.newInstance();
    Transformer t = tf.newTransformer(new StreamSource("indenter.xsl"));
    //suppose the doc is the document parsed and edited in the memory, and outfile is the path to output file
    t.transform(new DOMSource(doc), new StreamResult(new FileOutputStream(outfile)));
    

    I use xalan namespace to control the amount of space to indent. If you don't use of xalan, just leave these namespace declaration and the xalan:indent - amounted to and let the xsl processor using its default value.

    If you prefer instead of writing your own small xsl utilities, you can maybe google (mainly in using key as pretty print or a utility called htmltidy with w3c) to clean the misaligned output. Or check the documentation on the xsl processor used, some processor could have custom method to do the same.

    But cleaning may still run the risk of too interpret what can hold and is not. It is important to know what you finally want what to do and adjust according to your need.

    Published by: tsuji on Sep 21, 2011 07:57

  • How to remove all the exhibitors?

    How to remove all the exhibitors of large document?

    I tried to use find/replace and then find format, but I couldn't find the Exhibitor box.

    In find/replace, in Format to find, go to the basic character Formats section and it is in the drop Position down to the right.

  • Help, please.  How to remove a part of the reference?

    Sometimes, I need to use an old indesign document to another book. It's easy and fast. You don't need to set notes, running headers, templates etc.

    I still have the problem with books with indexes on the inside.

    It is easy to delete an old text from the document and fill in a new text.

    But if an old document index, such reference as 'see' 'See also' remains still etc. left (restored).

    Are listed in the index palette stil.

    And I do not know how to remove them automatically from my old document before importing a new text to it.

    Probably someone of you can write this simple script that can delete all index reference (or particularly like 'see' and see also") of the blank InDesign document.

    I mean empty indesign document, which is the document without the body of the text inside.

    Thanks in advance for your help and sorry for my bad English.

    try {}

    app.activeDocument.indexes [0].topics.everyItem () .remove ();

    } catch {} (_)

    }

  • In the XML document HTML tags

    I have an application that loads an XML file information and displays in a dynamic text box. Which works very well. Now, I want to add tags HTML of the information contained in the XML file for the dynamic text box will format. If I add html right:

    < Answer1 > Earth, < b > < /b > air, fire and water. < / Answer1 >

    I get a null value in the text box. If I encode

    < Answer1 > Earth, & gt; b & lt; Air & gt; / & lt; fire and water. < / Answer1 >

    It then displays

    Earth, the < b > < /b > air, fire and water.

    No help on how to code html embedded in an XML document, so a dynamic text box using the html code?

    Thank you.

    Just use CDATA tags around your HTML values, for example:

    air, fire and water.]] >

    HTH.

Maybe you are looking for