Extraction of the repetitive elements of XML

In line with the wire, How can I get the XML elements (because this thread already answered, so I open a new thread)

Databases
BANNER
----------------------------------------------------------
Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
PL/SQL Release 10.2.0.3.0 - Production
CORE    10.2.0.3.0      Production
TNS for Linux: Version 10.2.0.3.0 - Production
NLSRTL Version 10.2.0.3.0 - Production
XML
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:skos="http://www.w3.org/2004/02/skos/core#">
  <skos:Concept rdf:about="http://my.site.com/#Acoustics">
    <skos:ID>12033</skos:ID>
   <skos:narrower rdf:resource="http://my.site.com/#Aeroacoustics"/>
    <skos:narrower rdf:resource="http://my.site.com/#Vibrations (Acoustics)"/>
    <skos:narrower rdf:resource="http://my.site.com/#Acoustic materials"/>
   </skos:Concept>
 </rdf:RDF>
I want the result as follows
About                ID                          Resource

Acoustics           12033                      Aeroacoustics
Acoustics           12033                      Vibrations (Acoustics)
Acoustics           12033                      Acoustic materials
Any help would be appreciated.
Thanks in advance.

Published by: 876991 on October 10, 2012 11:26

Published by: 876991 on October 10, 2012 11:28

Here's a start, based on what odie_63 had already provided.

SELECT x.about, x.id, x2.res
  FROM th_xml t
     , xmltable(
         xmlnamespaces(
           'http://www.w3.org/1999/02/22-rdf-syntax-ns#' as "rdf"
         , 'http://www.w3.org/2004/02/skos/core#' as "skos"
         )
       , '/rdf:RDF/skos:Concept'
         passing t.in_file_1
         columns
           about   varchar2(30) path '@rdf:about'
         , ID      number       path 'skos:ID'
         , nar_xml xmltype      path 'skos:narrower') x
     , xmltable(
         xmlnamespaces(
           'http://www.w3.org/1999/02/22-rdf-syntax-ns#' as "rdf"
         , 'http://www.w3.org/2004/02/skos/core#' as "skos"
         )
       , 'skos:narrower'
         passing x.nar_xml
         columns
           res      varchar2(50)       path '@rdf:resource') x2

Tags: Oracle Development

Similar Questions

  • Binding XML schema to the repetitive elements - what am I doing wrong?

    I managed to successfully link a schema to a form of basic and apart from a few problems of active player, it works as expected.

    My next project is to do the same thing but with a form that contains repeating subforms.

    I wrote my diagram and validated and everything seems fine.  When I connect it to shape if it makes certain fields behave in strange ways.

    The form consists of three sections.  The first is a unique subform to repeat fields.  Two of the pieces is a table with the repetition of lines, and the third part is a collection of fields with the Add/Remove button using the instance manager script.

    When I bind these fields and add lines, I get strange results.  In the second part by pressing the Add button copies the entire line rather than create a new one.  Changing the value of a line of others change.

    In the third part, I can create entirely new subforms by using the Add button, but the this.parent.index + 1; script stops working.

    Anyone know why this is happening and how can I solve it?

    The pattern is below:

    < xsd: element name = "RemoteWorking" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "PartZero" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "RequireAddHardWare" / >
    < xsd: element name = "RequireRemoteWork" / >
    < / xsd: SEQUENCE >
    < / xsd: complexType >
    < / xsd: element >

    < xsd: element name = "PartOne" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "Name" / >
    < xsd: element name = "FirstName" / >
    < xsd: element name = "User name" / >
    < xsd: element name = "JobTitle" / >
    < xsd: element name = "Role" / >
    < xsd: element name = "LineManager" / >
    < xsd: element name = "Direction" / >
    < xsd: element name = "PersonnelCategory" / >
    < xsd: element name = "CONumber" / >
    < xsd: element name = "TelephoneNumber" / >
    < xsd: element name = "BuildingCode" / >
    < xsd: element name = "NuméroBureau" / >
    < xsd: element name = "WorkingHours" / >
    < xsd: element name = "AltContact" / >
    < / xsd: SEQUENCE >
    < / xsd: complexType >
    < / xsd: element >

    < xsd: element name = "PartTwo" maxOccurs = "unbounded" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "AdditionalHardware" maxOccurs = "unbounded" / >
    < / xsd: SEQUENCE >
    < / xsd: complexType >
    < / xsd: element >

    < xsd: element name = "PartThree" maxOccurs = "unbounded" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "ARTICLEREQUIS" / >
    < xsd: element name = "Program" / >
    < xsd: element name = "CostCentre" / >
    < xsd: element name = "BusinessCase" / >
    < xsd: element name = "Device" / >
    < / xsd: SEQUENCE >
    < xsd: attribute name = "ItemNo" type = "xsd: Integer" use = "required" / >
    < / xsd: complexType >
    < / xsd: element >

    < xsd: element name = "PartFour" >
    < xsd: complexType >
    < xsd: SEQUENCE >
    < xsd: element name = "Unit" / >
    < / xsd: SEQUENCE >
    < / xsd: complexType >
    < / xsd: element >
    < / xsd: SEQUENCE >
    < / xsd: complexType >
    < / xsd: element >
    < / xsd: Schema >

    The binding expressions must indicate that you have more than one section of PartTwo. To do this you need to add a [*] binding expressions that use the PartTwo node. If you want to keep just bind the subform that contains the information of PartTwo th to the PartTwo node, and then add the [*] at the end of the expression. Then al children of this node will get expressions such as $. Name of the node to which it refers.

    Hope that helps

    Paul

  • How to get the name element and xml comment in a page?

    I need to list all the name element and comment on a page

    You can use below methods.

    IXMLUtils::GetElementIndices()

    IFrameList::QueryFrameContaining()

  • Only for the repetitive Elements I want to total

    Dear all,
    Please help me in this report

    ONC Est.Amt paid Amt
    C1 150 125
    C2 800 710
    C2 100 100
    C3 200 190
    C4 150 130
    C4 350 225
    C4 500 380
    C5 750 680

    I want the total for item only periodic just below the item as below

    ONC Est.Amt paid Amt
    C1 150 125
    C2 800 710
    C2 100 100
    total of 810 c2
    C3 200 190
    C4 150 130
    C4 350 225
    C4 500 380
    c4 735 total
    C5 750 680

    Thank you
    REGI

    Hello

    In your data model, you will need to have the request of master / detail.
    At the master, you will have: ONC. In the details, you will have the rest of the fields.

    You can create a function in the master, which counts the number of records for each NOC and another which calculates the sum at the level of the ONC.

    In the page layout for the entire field of ONC, add a trigger of format like this:
    If: count_function > 1 then
    Returns true;
    on the other
    Returns false;

    This will achieve what you want.

    Kind regards
    Alex

    If someone useful or appropriate please mark accordingly.

  • Extract the matrix element

    I am trying to make the detection of peaks on a waveform. I use the waveform peak detection VI for that. One of the outputs of this VI is a picture of the 'locations' of each peak.

    The table of locations is displayed on the front panel, and it displays each item. I want to be able to extract a specific element of the array, however, say the third element (value = 226). I tried to do by using the table of index function, but I think that my understanding of this feature was incorrect. It seems that this can only isolate an ultrasensitive table 1 d array of?

    I'm sure that the answer is pretty simple, but I'm scratching my head trying to find. Thanks in advance.

    Your contribution is an array of waveforms, so you will get a table of the peaks for each waveform. You check out the first elements, which is a cluster that contains a table of the peaks for the first waveform. (Given that LabVIEW can not have arrays of arrays, you will get an array of clusters, each containing a table 1 d).

    If you have only a waveform in the input array, you must use table index before the detection of peaks and feed only a waveform to get a simple output of table 1 d.

    If you want to analyze an array of waveforms, simply dig a little deeper to the output you get. Array index to get the result of one of the waveforms (that is what you are currently doing!), and then ungroup to get the table of the results of this waveform, then the array index to access the first Ridge.

  • Root element is missing. System.Xml.XmlException: The root element is missing.

    Hello

    I have .NET 3.5 Web service hosted in my machine (Windows XP SP3) DEV .net 3.5 sp1... When I try to access the service form my

    client is the exception as below...

    Root element is missing. System.Xml.XmlException: The root element is missing.
    at System.Xml.XmlTextReaderImpl.Throw (Exception e)
    at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo (String res)
    at System.Xml.XmlTextReaderImpl.ParseDocumentContent)
    at System.Xml.XmlTextReaderImpl.Read)
    to System.Xml.XmlTextReader.Read)
    at System.Xml.XmlReader.MoveToContent)
    at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse (SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
    at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke (String methodName, Object [] parameters)

    Can any one opinion on this issue... Am I missing any software update...

    Thanks in advance...

    Kind regards

    Richard Starck M.

    Hi RAMANSELVA,

    Your question is more complex than what is generally answered in the Microsoft Answers forums. It is better suited for the IT audience Pro on MSDN. Please post your question in the MSDN forum.

    http://social.msdn.Microsoft.com/forums/en-us/netfxsetup/threads

  • Loading the XML file with the missing elements dynamically by ODI

    Hi guys,.

    I have the XML with two nodes Employee and address below. On a daily basis, sometimes the address element might not come from the source xml file, but my interface has columns mapped to the elements of the address, and that is why it may fail because of the source element is not found in the file or data could not get charged because the State 'and' in the sql query that is generated between the employee and address elements.  Is there a way where I can load the data dynamically where I can search in the file only for items (used) present and dynamically loading data only for these items?

    XML file:

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

    < EMP >

    < Empsch >

    < employee >

    < EmployeeID 12345 > < / EmployeeID >

    < original > t < / initials >

    John < name > < / LastName >

    DOE < FirstName > < / name >

    < / employee >

    < address >

    < > 12345 as WorkPhone < / as WorkPhone >

    < WorkAddress > test 234 < / WorkAddress >

    < / address >

    < / Empsch >

    < / EMP >

    Thank you

    Fabien Tambisetty

    I managed to solve it by using left outer joins, and in referring to the structure of the table of the XSD

  • How to pass the content of an xml element in the text frame in inDesign Script

    var XMLFile = File.openDialog ("select XML Files... ») ;

    var doc = app.activeDocument;

    If (!) App.Documents.Length)

    {alert ("ERROR: Document not opened");}

    return;

    }

    doc.importXML (XMLFile);

    var firstFigureNode = doc.xmlElements [0] .xmlElements [1] .xmlElements [0];

    var lableNode = firstFigureNode.xmlElements [0];

    var lableNodeText = lableNode.contents;

    myFrame var = doc.textFrames.add ({geometricBounds: [-13, 13, 3, -3]});

    lableNodeText.move (LocationOptions.AFTER, myFrame.texts [0]);

    ========================================================

    My requirement is: == > > move the content of an xml element in the text by inDesign Script block, but XML InDesign file Structure should not be change & data in the XML Structure should remain as it was before...

    I tried to code above, but it does not work...

    Please can someone help me in solving this problem...

    It does not work correctly...

    It moves firstFigureNode in myFrame...

    firstFigureNode.placeXML (myFrame);

    ===>> For Apple Script try below Code ===>>

    myFrame markup using firstFigureNode

  • I'm new in indesign scripting, please tell me how to write a script to get the contents of an XML element and then sort all the content

    I'm new in indesign scripting, please tell me how to write a script to get the contents of an XML element and then sort all the content

    Hello

    Can the code below is useful for you, but I do not know how to sort.

    Change the tag based on your employment application.

  • How to pass an xml CDATA in the string element when OSB call a webservice?

    How to pass an xml CDATA in the string element when OSB call a webservice?

    I have a business service (biz) this route to exploitation of a Web service.

    An example of this legacy Web service request:
    < soapenv:Envelope xmlns:soapenv = 'http://schemas.xmlsoap.org/soap/envelope/' xmlns: ex = "example" >
    < soapenv:Header / >
    < soapenv:Body >
    < ex: run >
    < ex: arg > <! [CDATA [< searchCustomerByDocumentNumber >
    < documentNumber > 12345678909 < / documentNumber >
    [[< / searchCustomerByDocumentNumber >]] > < / ex: arg >
    < / ex: run >
    < / soapenv:Body >
    < / soapenv:Envelope >

    type ex: arg is a string.

    How to pass this structure CDATA webservice in OSB?

    Steps to resolve this problem:
    1 create an XML schema. For example:


    elementFormDefault = "unqualified" >


              
                   
                        
                             
                             

                        

                        
                             
                        

                   

         

         

         
         

    With this XSD, XML can be generating:


    documentNumber

    2 create an XQuery query to create a ComplexType searchCustomerByDocumentNumber. For example:
    (: pragma bea: element global-element-return = "searchCustomerByDocumentNumber" location = "searchCustomerByDocumentNumber.xsd" ::))

    declare namespace xf = "http://tempuri.org/NovoSia/CreateSearchCustomerByDocumentNumber/";

    declare function xf:CreateSearchCustomerByDocumentNumber($documentNumber_as_xs:string)
    as {(searchCustomerByDocumentNumber)}

    {$documentNumber}

    };

    declare the variable $documentNumber as XS: String external;

    XF:CreateSearchCustomerByDocumentNumber ($documentNumber)

    3. in your step in proxy pipeline add to assign the created the XQuery function call from the number of the document of your payload.
    Assign to a variable (for example: called searchCustomerByDocumentNumberRequest)

    4. create an another Transformation of XQuery (XQ) to create a request to the existing Web service. For example:
    {fn - bea: serialize ($searchCustomerByDocumentNumberRequest)}

    For more information about xquery Serialize function:
    41.2.6 fn - bea: serialize()
    You can use the fn - bea: serialize() function if you need to represent an XML document as a string instead of as an XML element. For example, you can share an XML document through an EJB interface and the EJB method takes the string as an argument. The function has the following signature:

    FN - bea: serialize($input as item()) as xs: string

    Source: http://docs.oracle.com/cd/E14571_01/doc.1111/e15867/xquery.htm

  • Get the first instance of XML elements

    Hi all

    My XML tag looks like this:

    < Xref RID = Ref "id001' type = 'Test' >

    < Xref RID = ref "id002' type = 'Test' >

    < Xref RID = ref "id003' type = 'Test' >

    < Xref RID = ref 'id004' type = 'Test' >

    Code:

    var root = app.activeDocument.xmlElements [0];

    (var xrefRid = root.evaluateXPathExpression('//xref[@rid]');

    (var xrefType = root.evaluateXPathExpression('//xref[@ref-type]');

    for (i = 0; i < xrefRid.length; i ++)

    {

    var refTypeValue is xrefRid [j].xmlAttributes.itemByName ("ref-type") .value;.

    var ridValue is xrefType [j].xmlAttributes.itemByName ("rid") .value;.

    If (refTypeValue is "Test")

    {

    Alert (ridValue);

    }

    }

    In my multiple number same document 'RID' is here, but I want the first occurrence of the xref tag.

    By example, if < Xref RID = Ref "id001' type = 'Test' > occur on different pages of a book, but I need the first occurrence of the elements.

    Hope someone can help me...

    Vandy

    If your structure is constructed in the same manner as above , XPath works very well:

    _root var = app.activeDocument.xmlElements.firstItem ();

    var _firstXrefID001andID002 = _root.evaluateXPathExpression ("//p [position () = 1] / xref [@ RID ="id001"] |") [/ / p [position () = 2] / xre f[@rid='id002'] ");"

    App.Select (_firstXrefID001andID002);

    If further stations of

    are possible, for example

          1

          Title

          Example text sample text sample text sample text sample text sample text

         

    Sample text sample text sample sample text sample text sample

         

    Sample text sample text sample sample text sample text sample

         

    Sample text sample text sample sample text sample text sample

         

    Example of example text text Sample text sample text Sample Text sample text

         

    Example of example text text Sample text sample text Sample Text sample text

         

    Example of example text text Sample text sample text Sample Text sample text

         

    Example of example text text Sample text sample text Sample Text sample text

         

    Example of example text text Sample text sample text Sample Text sample text

         

    Example of example text text Sample text sample text Sample Text sample text

         

    Example of example text text Sample text sample text Sample Text sample text

         

    Example of example text text Sample text sample text Sample Text sample text

         

    Example of example text text Sample text sample text Sample Text sample text

         

    Example of example text text Sample text sample text Sample Text sample text

         

    Example of example text text Sample text sample text Sample Text sample text

         

    Example of example text text Sample text sample text Sample Text sample text

    You can try these XPathsExpressions and take the first element of tables resulting:

    _root var = app.activeDocument.xmlElements.firstItem ();

    [var _firstXrefID001 = _root.evaluateXPathExpression("//p/xref[@rid='id001']"); "

    App.Select(_firstXrefID001[0]);

    [var _firstXrefID002 = _root.evaluateXPathExpression("//p/xref[@rid='id002']"); "

    App.Select(_firstXrefID002[0]);

    Roland

  • How can I display the value of an XML element in my dynamic textbox?

    I followed the instructions of the forum here. When I examined the record/document, the result did not 100% accurate.

    Here is my Code XML and Flash Code:

    XML

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

    < userbase >

    Test line 1 < projinfo > < / projinfo >

    < / userbase >

    Flash

    var my_xml:XML = new XML();

    var myURL:URLRequest = new URLRequest ("userbase.xml");

    var loader_URL:URLLoader = new URLLoader (myURL);

    loader_URL.addEventListener ("complete", fileLoaded);

    function fileLoaded(e:Event):void

    {

    my_xml = XML (loader_URL.data);

    mynamehosp. Text = my_xml.projinfo;

    }

    When I saw the dynamic textbox file showed "line of Test." If I did the < projinfo > element reads like this:

    < projinfo > Test line 1 more text here < / projinfo >

    The dynamic TextBox was 'Test line more text here. It is completely ignoring the number "1". How can I fix it? When our company actually uses it, it is possible that we will have (a) number (s) in the values of the organization unit.

    Any ideas?

    The code is very well. Probably you embed the police, and if you did you do have figures included.

  • Flatten XML does not record the names of the ListBox element to the XML file.

    On my front, I have a ListBox indicator that has strings that the user can select. Also, the user can edit items in the drop-down list to add new items. After that the user selects one and pushes my "Save" button, I use the flatten XML function to save the selection in an XML file. But Flatten XML saves only the value (the index of the selected items to the XML file and not the names of items in ListBox.) This is enough information to reconstruct from the string of data that the user has selected.

    A ListBox where a user is to select from a list of strings, flatten function XML should not also store the strings that have been selected?


  • How to extract values of classic report column in the text element

    Hi all

    I've created a classic report (select id, name,' < input type = "button" value = "add" id = "add" name = "add" > "as" add details "details ;) with a single column as column values want link.i in the text element when I click on the link of that particular record of the report)

    (1) in the link this link column property I've specified the URL as [javascript:insert_in_table(#ID#,#NAME#)]

    (2) text two article P_ID, P_NAME

    (3) in the header of the page, I've specified as javascript

    < script type = "text/javascript" >

    function insert_in_table (id, name) {}

    var regId = ' #detail #'.substr (1);

    var req = new htmldb_Get (not null, $v ('pFlowId'), 'APPLICATION_PROCESS = add', $v('pFlowStepId'));

    Req.Add ('P_ID', ID);

    Req.Add ('P_NAME', Name);

    forced. GetAsync (function () {}

    If {(p.readyState is 4)

    $a_report (regId);

    }

    });

    }

    < /script >

    (4) created a (add) process whose point: on demand, run this process when requested by ajax

    pl/sql: insert into name_detail (id, name) values (: P_ID,: P_NAME)

    now the problem is I m not getting the values of column in the report in the text element, it only shows white.

    Kind regards

    Ketan

    Hello Ketan,

    Assuming that you want to insert the values into the table, this is why you want to set values for the element,

    If this is the case, then no need to define values for the element to insert.

    Follow the steps below, it is one of the embodiment of your condition.

    Step 1: Put the code below in your classic report query

    assuming that the id is of type number and the name is of type varchar, that's why I am attaching the name to apostrophe, see line 3

    select id
         , name
         , ''  as "Add to detail"
    from detail
    

    Edit 'Add details' column-> column attributes-> view-> column of Standard report

    Step 2: Create a process in the processing of the Page

    Name: INSERT_DATA

    Address the point: on demand, run this process when requested by ajax

    Process: putting the code below

    Declare
      P_ID number ;
      P_NAME varchar2(50);
      Begin
          P_ID   := apex_application.g_x01;
          P_NAME := apex_application.g_x02;
          insert into name_detail(id,name) values (P_ID,P_NAME);
    End;
    

    Step 3: Create a java script function to call your insert ajax process.

    Change the Page-> the function and the global variable declaration-> put the code below

    function insert_in_table(id,name) {
      apex.server.process ( "INSERT_DATA", {
          x01: id,x02: name
      }, { success: function( pData ) { }
      });
    }
    

    Hope this helps you,

    Kind regards

    Jitendra

  • XSLT - repeat the target schema based on the repetition of the input node

    Hi all

    I have a requirement where all elements in the schema target processing must repeat based on repetition if an id in the input schema.

    XML 1:

    < root >

    < Productcollection >

    < productdesc > string 1 < / productdesc >

    productmanfdate > jj/mm/aaaa < / productmanfdate >

    < ProductID >

    < productCode > 100 < / productCode >

    < productCode > 101 < / productCode >

    < productCode > 102 < / productCode >

    < / ProductID >

    < / Productcollection >

    < / root >

    the power required is XML:

    < root >

    < Productcollection >

    < productdesc > string 1 < / productdesc >

    productmanfdate > jj/mm/aaaa < / productmanfdate >

    < productCode > 100 < / productCode >

    < / Productcollection >

    < Productcollection >

    < productdesc > string 1 < / productdesc >

    productmanfdate > jj/mm/aaaa < / productmanfdate >

    < productCode > 101 < / productCode >

    < / Productcollection >

    < Productcollection >

    < productdesc > string 1 < / productdesc >

    productmanfdate > jj/mm/aaaa < / productmanfdate >

    < productCode > 102 < / productCode >

    < / Productcollection >

    < / root >

    Can someone please help me on how to do this type of transformation.

    Thank you

    Try this one:

    ===================================================

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

    ===================================================

    This will give you exactly what you wanted.

    See you soon!

Maybe you are looking for