Merge xml nodes

Hi all

I get the XML files where carriage returns create redundant nodes. That is to say what is to be:

< tag > A

B

C

D

< / tag >

is actually

< tag > A < / tag >

< tag > B < / tag >

< tag > C < / tag >

< tag > D < / tag >


I can certainly find these tags and merge somehow, but I wanted to check if there might be generic sort of merging of these nodes of type of repetition. Unfortunately implementation XPath won't allow me to use something as follows - siblings:tag


Any idea?


Loïc

Hi love,

I did read your post with sufficient attention.

I tried:

var _xmlString = "

Bold

Bold

ABCDStrong
", _XML = new XML(_xmlString), _followingTags = _XML.xpath("./tag[1]/following-sibling::tag"), _destTag = _XML.child("tag")[0]; _destTag.insertChildAfter(_destTag.text(),_followingTags.text()); for(var i = _followingTags.length() -1; i >= 0; i-- ) { delete _followingTags[i]; } $.writeln(_XML);

Result:


  

Bold

Bold

A B C D Strong

Perhaps a different approach, but I do not know how the structure looks exactly like...

Roland

Tags: InDesign

Similar Questions

  • 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>
    
  • 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

  • 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

  • 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

  • Merge XML as a automatic Script files

    Hey!
    I had several xml files and you want to merge...

    they're all like that with different information.->

    
    
    
        CLASSICA
      
    
         VH1 Classic
    
    
        Bach, Partiten für Violine solo
        Solist Instr.: Gidon Kremer (Violine), Bildregie: Daniel Finkernagel, Alexander Lück
        Gidon Kremer spielt die Partiten für Violine solo Nr. 1 h-Moll BWV 1002, Nr. 2 d-Moll BWV 1004 und Nr. 3 E-Dur BWV 1004 von Johann Sebastian Bach (1685-1750). Anfang der siebziger Jahre begann Gidon Kremers Karriere, und seitdem hat er sich den Ruf eines Geigers von internationalem Format und ganz eigenem Stil erworben. Geboren wurde Kremer 1947 in der lettischen Hauptstadt Riga. Als Achtzehnjähriger spielte er David Oistrach vor, der ihn als einen seiner wenigen Schüler annahm und am Moskauer Konservatorium unterrichtete. 1967 errang Gidon Kremer beim Brüsseler Wettbewerb "Reine Elisabeth" seinen ersten internationalen Preis. 1970 erreichte er mit dem Ersten Preis des Moskauer Tschaikowsky-Wettbewerbs den vorläufigen Höhepunkt seiner noch jungen Laufbahn. Bald darauf zählte Kremer zu den gefragtesten Geigern der Welt. Nachdem Gidon Kremer 1981 die Sowjetunion für immer verlassen hatte, gründete er das Festival in Lockenhaus, bei dem sich alljährlich Musiker aus aller Welt treffen. Hier entstand diese Aufnahme.
      
    
    

    What follows will merge the .xml files that have your structure, but different information. Based on your example, I created 4 XML files of test with different information and executed the following Python script. All 4 XML files have been merged into a combined.xml file. Quickly. Tested with default Python 2.7.10 on El Capitan 10.11.2.

    The Python script and its invocation of the command line shown here is from a post on stackoverflow, named high-tech answer.

    Copy the following source Python in a programming editor. Under filename xmlcombine.py. The interactive steps in the Terminal. Support, all of your XML files you want to combine are in the same folder as your Python script, and that you are using the Bash shell.

    chmod + x./xmlcombine.py

    shopt shopt-s

    ./xmlcombine.py! (combined) .xml > combined.xml

    shopt shopt-u

    #! / usr/bin/env python

    import sys

    XML.eTree import ElementTree

    def run (files):

    first = None

    name of the file in the files:

    data = ElementTree.parse (filename) .getroot)

    If the first is None:

    first = data

    Another thing:

    First.extend (Data)

    If the first is not nothing:

    print ElementTree.tostring (first)

    If __name__ == "__main__":

    Run(sys.argv[1:])

    Example of structure:

  • Research within an XML node

    I'm trying to use the XML parser, in LabVIEW to read a custom XML file.  Basically I have several SubTest tags, each of which can or not contain multiple tags.  I want to search in each of these subtest tags to see if it contains each of the tags am interested and write in a cluster if it exists, or write a default value if it does not exist.

    I try to use get them all nodes matching and get first node in correspondence to achieve, but it doesn't seem to work.

    I use get all nodes matching for search tags subtest then pass each of these nodes in get first node corresponds to search tags in the node for each number that I'm interested.

    The problem is that first node to match returns the first match for the entire document each time, NOT the node I'm going in.

    I have attached a simplified VI that illustrates the problem.  Wrong documentation for first node of correspondence, or I do something wrong?  Thank you.

    Note: Using XML is saved in 2012 and Help_11 XML is saved for 2011

    Your search for price won't.

    As you're already gave a link to the book node, then you have not need search again from the top node.

    Replace your XPath 2 of "/ bookstore/book/price" only "of prices.

  • Pickle of parsing XML node

    I try to analyse a string from a body element that is retrieved as an incoming message from a source Amazon SQS. The item in question uses a developed set of delimiters (.. and...), okay, it's not that complex, but need to get several items in a single string in the queue.

    The raw looks a lot like as follows:


    http://queue.amazonaws.com/doc/2008-01-01/ ">ef3a2678-8fd0-..." XXX-XXX-XXXXX... ... File foo.txt. Size... 4680716... offset... 0... URL... http://foo.S3.amazonaws.com: 80/0ed6c45f-a8ca-4aa2-825a-0749c68ec6b3/5213e03f-3a09-4558-be1d-ad70a84a89fa/c2dc5820-c423-49e6-8f80-7190606a0ada-1? AWSAccessKeyId = XXXXXX & expires = 1237310737 & Signature = Lbik % 2bu5PRzApp6PvY0dNam4EcXo % 3d... Part... 1... DateTimeModified... 2009-03-17 16:25:37.3896ab1594-cc85-4b6c-8602-e39a74bf98a6

    The data are very well throughout our process until it hits this block of code:

    NodeList bodyElements = result.getXMLResult () .getElementsByTagName ("Body");
    If (bodyElements.getLength () > 0)
    {
    NodeList childNodes = bodyElements.item (0) .getChildNodes ();
    If (childNodes.getLength () > 0)
    {
    Body of node = childNodes.item (0);
    System.out.println (Body.getNodeValue ());
    java.util.Hashtable messageValues = parseMessageBody (body.getNodeValue ());
    result.setMessageValues (messageValues);
    }
    }

    Things are loose the rails when getChildNodes() is called. Throw a watch on the body, I can see the data as expected in the _text elements however the _expandedText seems to truncate to the '&' if I continue to debug, the result appears in the form:

    URL... http://foo.S3.amazonaws.com: 80/0ed6c45f-a8ca-4aa2-825a-0749c68ec6b3/5213e03f-3a09-4558-be1d-ad70a84a89fa/c2dc5820-c423-49e6-8f80-7190606a0ada-1? AWSAccessKeyId = XXXXXX<- missing="" the="" "&"="" and="" expiry="" and="" signature="" goodness.="" (&expires="">

    I don't know I am doing something n00bie-ish stoopid, but I'm quite at loss as to what is happening.

    It is invalid to have the & symbol in an XML string.  Non alpha numeric characters should be replaced with the escape characters.

  • No nested extensible XML nodes

    Nice day

    I am new to Oracle, working on a project for a client, from a .NET/MSSQL environment. Initially the project was intended for MSSQL, but it was decided, a week before the deadline, we should migrate database and all the functions and procedures in Oracle. Most of this had progressed relatively smoothly, until today.

    The idea is to query the database and return the XML as follows (Simplified):

    < document >

    < id > 1 < /ID >

    cheeses from < name > < / name >

    < owner >

    < name > bert < / name >

    < identification >

    Passport < type > < / type >

    < number > 12345 < / number >

    < / identification >

    < identification >

    travel document < type > < / type >

    < number > 98765 < / number >

    < / identification >

    < / owner >

    < / document >

    The structure of the XML has been implemented by an international organization and is 100% out of my control.

    As you can see it the 'identification' node repeats without being nested, and that's what I need. So far I've been able to get the repeat nested under some other node ( Redmark), as follows:

    < document >

    < id > 1 < /ID >

    cheeses from < name > < / name >

    < owner >

    < name > bert < / name >

    < identification >

    < identification >

    Passport < type > < / type >

    < number > 12345 < / number >

    < / identification >

    < identification >

    travel document < type > < / type >

    < number > 98765 < / number >

    < / identification >

    < / identifications >

    < / owner >

    < / document >

    Currently I use a function to generate the nodes 'identification', and I call this function to a query, as follows:

    -Function

    CREATE FUNCTION IDENTIFICATIONDETAILS

    .....

    SELECT

    XMLAGG

    (

    XMLELEMENT

    (

    "identification."

    XMLFOREST

    (

    type 'TYPE '.

    number such AS 'number '.

    )

    )

    )

    Of...

    ;/

    -Query

    SELECT

    XMLFOREST

    (

    p.NAME AS 'name',

    IDENTIFICATIONDETAILS (p.ID) AS 'identification'

    )

    Of

    NO p

    This is how I understand it. XMLFOREST function generates a list of nodes such as specified by its parameters. XMLELEMENT nests, then the nodes generated by the XMLFOREST function under a single node as shown by it first parameter; If this is not done, all the results will be simply sent together not the outer query specifies as follows (not the repetition of type and number):

    < document >

    < id > 1 < /ID >

    cheeses from < name > < / name >

    < owner >

    < name > bert < / name >

    < identification >

    Passport < type > < / type >

    < number > 12345 < / number >

    travel document < type > < / type >

    < number > 98765 < / number >

    < / identification >

    < / owner >

    < / document >

    Function XMLAGG the then consolidates the collection of items returned by the XMLELEMENT function into a single object, otherwise I get the error "several rows returned" (paraphrase). Then, the result of the function is nested under a node of 'identification' (marked Green) that I am obliged to alias parameter XMLFOREST.


    So I need to get rid of the external nesting; This alias 'identifier', it's causing me a headache.

    It's probably something simple, but I've been struggling with this every day now and I think I need the eyes of certain fees, not biased on check it out and point out my flaws. also, some with experiences more eyes go top will also be a bonus.

    Thanks in advance for your time, assistance, and to respond to my problem.

    Best!

    What about

    Select

    XmlElement ("owner",

    XMLAGG)

    XmlElement ('identification',

    XmlElement ("type", e.ename)

    XmlElement ("number", e.empno)

    )

    )

    ) d

    from emp e, Dept. d

    where e.deptno = d.deptn

    Smith

    7369

    Allen

    7499

    ...

Maybe you are looking for

  • The screen add people faces a (~ 1600) much just show as squares of white, grey

    Hello I was going through my photo library (running 2.0 on Sierra Photos) cleaning and marking of the people. I got far just about every face on the left is a square white, gray. If I add this person, the area where the image would be just rotates th

  • Cannot install HP App

    Just set up a new TP today and get the message that HP App Catalog do not download. It is down or is the problem with the TP? BTW, I tried the trick on by clicking on the yellow! in software update, but no joy. Now, I have only a black screen open fo

  • G9D51EA

    Hello I'm looking for drivers for this laptop. The site driver for this product is empty full. g9d51ea #abh [Personal information] With sincere friendships. Edwin

  • Aplicattion made on PC compatible with PDA?

    I made a request on my computer, and I was wondering if I can use it on my pda, what I mean is, can I use my application done on computer or do I have to make another specifically for PDAS?

  • Error: System Restore cannot create a restore point.

    When you start System Restore, I get the error message from Web page "line: 166; "Error: unspecified error."  When I continue to try to create a new Restore Point, I get the message "System Restore cannot create a files.  Restart the computer, and re