Merge the XML document in a table

Hello
I want to merge some of the values of an xml document in a table "Project_Table".

CREATE TABLE Project_Table
(
TASK_ID NUMBER (15),
TASK_NAME VARCHAR2 (100 BYTE),
START_DATE DATE,
)

I am using the following procedure, that I adapted from another post. It inserts null values, I think because I'm not showing the nodes correctly.

DECLARE
BFILE v_bfile: = BFILENAME ("'DTEMP","test.xml");
v_clob CLOB.
BEGIN
-Create directory DTEMP as "C:\TEMP";
-grant read the < schema > DTEMP directory;

DBMS_LOB.CREATETEMPORARY (v_clob, TRUE);
DBMS_LOB. OPEN (v_bfile, DBMS_LOB.lob_readonly);
DBMS_LOB. LoadFromFile (v_clob, v_bfile, DBMS_LOB.lobmaxsize);
Dbms_output.put_line (v_clob);
MERGE IN project_table t
USING (SELECT TO_NUMBER (EXTRACTVALUE (VALUE (x), ' / task ')) task_id,)
To_date (EXTRACTVALUE (value (x), "/ start"), 'DD-MM-YYYY') start_date,
EXTRACTVALUE (value (x), "/ name") TaskName
(SELECT XMLTYPE (v_clob) XML
THE DOUBLE).
TABLE (XMLSEQUENCE (EXTRACT (xml, ' / project'))) x) r
WE (t.task_id = r.task_id)
WHEN MATCHED THEN
UPDATE
SET t.start_date = r.start_date, t.task_name = r.task_name
WHEN NOT MATCHED THEN
INSERT (task_id, start_date, taskname)
VALUES (r.task_id, r.start_date, r.task_name);
COMMIT;
END;

This is the document of test.xml.

<? XML version = "1.0" encoding = "UTF-8"? >
-name of the project 'ProjectName' company 'Company' webLink = = = "" view-date = '2009-12-14"see-index '0' = gantt-Divider-location = '300' resource-divider-card ="300"version ="2.0">"
< description / >
< zoom-view state = "default: 8" / >
-<!
->
-< calendars >
-day-types >
< day-type id = '0' / >
< day-type id = "1" / >
-< Calendar id = "1" name = "default" >
< Sun weeks default = '0' LUN '0' = TEU = '0' kills = '0' game = '0' Fri '0' = Saturday = '0' / >
< overloaded-day-types / >
< days / >
< / calendar >
< / day-types >
< / calendars >
-task color = "#8cb6ce" >
-< taskproperties >
< taskproperty id = "tpd0" name = 'type' type = 'default' valuetype = "icon" / >
< taskproperty id = "TDP1" name = 'priority' type = 'default' valuetype = "icon" / >
< taskproperty id = "tpd2" name = 'info' type = 'default' valuetype = "icon" / >
< taskproperty id = "tpd3" name = "name" type = 'default' valuetype = "text" / >
< taskproperty id = "tpd4" name = "begindate" type = 'default' valuetype = "date" / >
< taskproperty id = "tpd5" name = "enddate" type = 'default' valuetype = "date" / >
< taskproperty id = "tpd6" name = "Duration" type = 'default' valuetype = "int" / >
< taskproperty id = "tpd7" name = "completion" type = 'default' valuetype = "int" / >
< taskproperty id = "tpd8" name = "Coordinator" type = 'default' valuetype = "text" / >
< taskproperty id = "tpd9" name = "predecessorsr" type = "default" valuetype = "text" / >
< / taskproperties >
< job id = '0' name = 'TaskA"color =" #0099cc "form = meeting"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"="false"start ="2010-01-28"duration ="1"complete ="0"priority ="1"expand ="true"/ >
< task id = "1" name = "TaskB" color = "#ff0000" form = meeting "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" = "false" start = "2010-01-28" duration = "1" complete = "100" priority = "1" expand = "true" / >
< job id = "2" name = 'Day' color = "#ff9933" form = meeting "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" = "false" start = "2010-02-01" duration = "19" complete = "0" priority = "1" expand = "true" / >
< job id = "3" name = "TaskD" color = "#ff0000" form = "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" meeting = "false" start = "2010-02-01" duration = "32" full = "100" priority = "1" expand = "true" / >
< job id = "4" name = "TaskE" color = "#66ff99" form = meeting "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" = "false" start = "2010-02-01" duration = "67" complete = "0" priority = "1" expand = "true" / >
< job id = "5" name = "TaskF" color = "#66ff99" form = meeting "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" = "false" start = "2010-02-01" duration = "46" complete = "10" priority = "1" expand = "true" / >
< job id = "6" name = "TaskG" color = "#00cccc" form = meeting "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" = "false" start = "2010-03-15" duration = "30" complete = "0" priority = "1" expand = "true" / >
< job id = "7" name = "TaskH" color = "#00cccc" form = meeting "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" = "false" start = "2010-03-15" duration = "103" full '1' = '1' priority = expand = "true" / >
< job id = "8" name = "TaskI" color = "#0000ff" form = meeting "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" = "false" start = '2010-04-26' length = "11" complete = "0" priority = "1" expand = "true" / >
< job id = '9' name = 'TaskJ"color =" #0000ff "form = meeting"0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0"="false"start = '2010-04-26' length ="11"complete ="0"priority ="1"expand ="true"/ >
< job id = "10" name = "TaskK" color = "#000000" meeting = 'false' start time = "2010-07-12" = "65" full = "0" priority = "1" expand = "true" / >
< / tasks >
< resources / >
< allowances / >
< holiday / >
-< taskdisplaycolumns >
< displaycolumn property id = "tpd3" order = "0" width = "75" / >
< displaycolumn property id = "tpd4" order = "1" width = "75" / >
< displaycolumn property id = "tpd5" order = "2" width = "75" / >
< displaycolumn property id = "tpd7" order = "3" width = "75" / >
< / taskdisplaycolumns >
< Previous / >
< roles roles-name = "Default" / >
< / project >

Any ideas how to change the procedure, in order to merge the data in the xml document in the table?

Thank you

Hello

Here's what you need in your USING clause:

SELECT to_number(extractvalue(column_value, 'task/@id'))                as task_id,
       to_date(extractvalue(column_value, 'task/@start'), 'YYYY-MM-DD') as start_date,
       extractvalue(column_value, 'task/@name')                         as task_name
FROM TABLE(
  XMLSEQUENCE(
    EXTRACT(xmltype(v_clob), '//task')
  )
)

Since you want nodes "task" request, just extract them directly. In addition, 'id', 'start', 'name' is attributes, you must access them with an '@'.

You can also take a look at function XMLTABLE (which tends to replace construction TABLE (XMLSEQUENCE (...))):

SELECT *
FROM XMLTABLE(
 '//task'
 passing xmltype(v_clob)
 columns task_id    number(15)    path '/task/@id',
         start_date date          path '/task/@start',
         task_name  varchar2(100) path '/task/@name'
)

Edit: the XMLType constructor overload taking a BFILE type as an argument, so you can simplify the code a bit more:

DECLARE

 v_xml XMLTYPE := XMLTYPE( BFILENAME('DTEMP', 'test.xml'), nls_charset_id('AL32UTF8') );

BEGIN

MERGE INTO project_table t
USING (
  SELECT *
  FROM XMLTABLE(
   '//task'
   passing v_xml
   columns task_id    number(15)    path '/task/@id',
           start_date date          path '/task/@start',
           task_name  varchar2(100) path '/task/@name'
  )
) r
ON (t.task_id = r.task_id)
WHEN MATCHED THEN ...
WHEN NOT MATCHED THEN ...
;

...

END;

HTH

Published by: odie_63 on March 18, 2010 12:13

Published by: odie_63 on March 18, 2010 12:15

Tags: Oracle Development

Similar Questions

  • Change the content of the xml document as data selected with SQLX functions

    Hi all
    I have seen several examples of database xml documents using SQLX functions but they seem to be simple queries, which we reproduce the same forest of xml in all elements. What I'm trying to do is to create something like the following:


    < billing xmls = "http://blurb.com" >
    < header >
    < timestamp > 2008-12-11 13:28:46 < / timestamp >
    < source > ORCL < / source >
    < / header >
    < transaction and billing-answers >
    < invoice-transaction-response >
    < invoice-transaction-id > 36866320 < / billing-transaction-id >
    ORDER of < invoice-transaction-type > < / billing-transaction-type >
    <-group-id of transaction > 092220082100 < / transaction-group-id >
    < ok >
    < charged to date > 2008-09-22T 10: 20:43 - 05:00 < / beak-date >
    < /OK. >
    < / billing-transaction-response >
    < invoice-transaction-response >
    < invoice-transaction-id > 37617490 < / billing-transaction-id >
    ORDER of < invoice-transaction-type > < / billing-transaction-type >
    <-group-id of transaction > 112020082100 < / transaction-group-id >
    < error >
    reasons <>
    < reason >
    < text > impossible to derive information of customer SHIP_TO < / text >
    < / reason >
    < / reasons >
    < / error >
    < / billing-transaction-response >
    < / billing-transaction-answers >
    < / billing >


    I can see how to generate the individual components of the xml document, but I don't know how to put this together in a single select statement:


    SQL > SELECT XMLElement ("billing", XMLAttributes (http://blurb.com LIKE "xmls")
    2, XMLElement ("header"
    3, XMLElement ("timestamp", TO_CHAR (SYSDATE, ' YYYY-MM-DD HH24:MI:SS'))))
    4, XMLElement ("source", "ORCL'"))).extract('/*') xml
    5 FROM DUAL;

    XML
    ----------------------------------------------------------------------------------------
    < billing xmls = "http://blurb.com" >
    < header >
    < timestamp > 2008-12-11 13:28:46 < / timestamp >
    < source > ORCL < / source >
    < / header >
    < / billing >


    SQL > SELECT XMLElement ("billing transaction-answers"
    2, XMLAgg (XMLElement ("billing-transaction-reply"
    3, XMLElement ("billing transaction id", billing_transaction_id)
    4, XMLElement ("billing-transaction-type", billing_transaction_type)
    5, XMLElement ("transaction-group-id", transaction_group_id)
    6, XMLElement ("ok"
    7, XMLElement ("beak-date", billed_date))).extract('/*') xml
    8 FROM table_a
    9 status WHERE! = 'E';

    XML
    ----------------------------------------------------------------------------------------------------
    < transaction and billing-answers >
    < invoice-transaction-response >
    < invoice-transaction-id > 36866320 < / billing-transaction-id >
    ORDER of < invoice-transaction-type > < / billing-transaction-type >
    <-group-id of transaction > 092220082100 < / transaction-group-id >
    < ok >
    < charged to date > 2008-09-22T 10: 20:43 - 05:00 < / beak-date >
    < /OK. >
    < / billing-transaction-response >
    < / billing-transaction-answers >



    MDACFS@CORPD23 > SELECT XMLElement ("billing transaction-answers"
    2, XMLAgg (XMLElement ("billing-transaction-reply"
    3, XMLElement ("billing transaction id", billing_transaction_id)
    4, XMLElement ("billing-transaction-type", billing_transaction_type)
    5, XMLElement ("transaction-group-id", transaction_group_id)
    6, XMLElement ("error"
    7, XMLElement ("patterns"
    8, XMLElement ("reason"
    9, XMLElement ("text", error_message))).extract('/*') xml
    10 FROM table_a
    * 11 situation WHERE = 'E '; *

    XML
    -------------------------------------------------------------------------------------
    < transaction and billing-answers >
    < invoice-transaction-response >
    < invoice-transaction-id > 37617490 < / billing-transaction-id >
    ORDER of < invoice-transaction-type > < / billing-transaction-type >
    <-group-id of transaction > 112020082100 < / transaction-group-id >
    < error >
    reasons <>
    < reason >
    < text > impossible to derive information of customer SHIP_TO < / text >
    < / reason >
    < / reasons >
    < / error >
    < / billing-transaction-response >
    < / billing-transaction-answers >

    This is my first attempt to generate xml from the database if it is not a correct approach then please notify. Any help much appreciated.

    See you soon,.
    Paul.

    Given you already wrote each song as a separate statement which refers to what you want, you already have the concept and just need to merge the three queries SQL in one alone. Here is an example of the fusion of your first two SQL set statements.

    SELECT XMLElement("billing", XMLAttributes('http://blurb.com' AS "xmls")
            ,XMLElement("header"
              ,XMLElement("timestamp", TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS'))
              ,XMLElement("source", 'ORCL')
             ),
             (SELECT XMLElement("billing-transaction-replies"
                      ,XMLAgg(XMLElement("billing-transaction-reply"
                       ,XMLElement("billing-transaction-id", rownum))))
               FROM dual
               CONNECT BY level <= 5
             )) rslt
    FROM DUAL;
    
    returns
    
    
         
    2008-12-12 09:21:39 ORCL
    1 2 3 4 5
  • Display the error when the xml document is not valid against the schema

    Hello

    I'm using isChemaValid() in a way that, to determine if the xml document is valid against the xml schema.

    This function returns only 0 or 1, and I want to display the error and the line number if the xml is not valid.

    How can I achieve this?

    Thanks in advance,

    Elad

    Use the XMLType schemaValidate() method. It will throw an exception whose message contains the validation error.

    Get a number of 'line' is not sensible as XML is concerned.

  • 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>
    
  • What is the best way to apply choice relational tables in the XML document?

    I've got an XML document from outside I turn with full DB XSLT document.

    Some parts of the document contain codes I want to tranfsorm to significant labels of relational tables in our database.

    On road is to disassemble the XML into the relational views and join these views with tables of choice and then back, this time with labels translated, using XMLElement, etc...

    Is there another way less heavy? For example,.

    Select updateXML)
    xml_dta
    ,'/ / section_to_translate/node_to_translate/variable / text () '
    ,(
    Select the label
    of table_recherche
    where Group = extractValue (current_node, '... / Group/Text () ')
    and code = extractValue (current_node, '... / variable/Text () ')
    )
    ) xml_dta
    from my_table
    where... criteria

    However, I do not know how to move from the current node to the extractValue function (if it is possible?.)

    Anyone done the second way?

    Thank you

    You didn't tell the version of your database, so I assume one of them later.

    You can include the part of the translation in the XSL transformation, by accessing an external research paper generated from the database beforehand.

    Here is an example of use of the HR diagram example:

    (1) the source document that are to be processed: emp.xml

    
    
     
      198
      Donald
      OConnell
      SH_CLERK
     
     
      199
      Douglas
      Grant
      SH_CLERK
     
     
      200
      Jennifer
      Whalen
      AD_ASST
     
     
      201
      Michael
      Hartstein
      MK_MAN
     
     
      202
      Pat
      Fay
      MK_REP
     
     
      203
      Susan
      Mavris
      HR_REP
     
     
      204
      Hermann
      Baer
      PR_REP
     
     
      205
      Shelley
      Higgins
      AC_MGR
     
     
      206
      William
      Gietz
      AC_ACCOUNT
     
     
      100
      Steven
      King
      AD_PRES
     
    
    

    (2) the lookup table:

    SQL> create table lookup_table as
      2  select job_id, job_title
      3  from hr.jobs;
    
    Table created
    
    SQL> select * from lookup_table;
    
    JOB_ID     JOB_TITLE
    ---------- -----------------------------------
    AD_PRES    President
    AD_VP      Administration Vice President
    AD_ASST    Administration Assistant
    FI_MGR     Finance Manager
    FI_ACCOUNT Accountant
    AC_MGR     Accounting Manager
    AC_ACCOUNT Public Accountant
    SA_MAN     Sales Manager
    SA_REP     Sales Representative
    PU_MAN     Purchasing Manager
    PU_CLERK   Purchasing Clerk
    ST_MAN     Stock Manager
    ST_CLERK   Stock Clerk
    SH_CLERK   Shipping Clerk
    IT_PROG    Programmer
    MK_MAN     Marketing Manager
    MK_REP     Marketing Representative
    HR_REP     Human Resources Representative
    PR_REP     Public Relations Representative
    
    19 rows selected
     
    

    (3) generate us the document search and store it in the XML DB repository (so that it can be referenced in the XSLT):

    SQL> show user
    User is "dev"
    
    SQL>
    SQL> declare
      2   res boolean;
      3  begin
      4   res := dbms_xdb.CreateResource(
      5    abspath => '/public/temp/lookup.xml',
      6    data => dburitype('/DEV/LOOKUP_TABLE').getXML
      7   );
      8   commit;
      9  end;
     10  /
    
    PL/SQL procedure successfully completed
    
    SQL> set long 10000
    SQL> select xdburitype('/public/temp/lookup.xml').getCLOB() from dual;
    
    XDBURITYPE('/PUBLIC/TEMP/LOOKU
    --------------------------------------------------------------------------------
    
    
      
        AD_PRES
        President
      
      
        AD_VP
        Administration Vice President
      
      
        AD_ASST
        Administration Assistant
      
      
        FI_MGR
        Finance Manager
      
      
        FI_ACCOUNT
        Accountant
      
      
        AC_MGR
        Accounting Manager
      
      
        AC_ACCOUNT
        Public Accountant
      
      
        SA_MAN
        Sales Manager
      
      
        SA_REP
        Sales Representative
      
      
        PU_MAN
        Purchasing Manager
      
      
        PU_CLERK
        Purchasing Clerk
      
      
        ST_MAN
        Stock Manager
      
      
        ST_CLERK
        Stock Clerk
      
      
        SH_CLERK
        Shipping Clerk
      
      
        IT_PROG
        Programmer
      
      
        MK_MAN
        Marketing Manager
      
      
        MK_REP
        Marketing Representative
      
      
        HR_REP
        Human Resources Representative
      
      
        PR_REP
        Public Relations Representative
      
    
     
    

    (4) the sheet XSLT stylesheet (stored in XDB repository as well): emp.xsl

    
    
     
     
     
     
     
      
     
     
     
      
      
       
       
        
       
      
     
    
    

    The transformation is rather bland, but the interesting part lies in access to external document within it.
    I used a key to index the JOB_ID/function pairs.

    (5) last step, apply the transformation:

    SQL> select xmlserialize(document
      2   xmltransform(
      3    xmltype(bfilename('DUMP_DIR','emp.xml'),nls_charset_id('AL32UTF8')),
      4    xdburitype('/public/temp/emp.xsl').getXML()
      5   ) as clob indent
      6  )
      7  from dual;
    
    XMLSERIALIZE(DOCUMENTXMLTRANSF
    --------------------------------------------------------------------------------
    
    
      
        Donald OConnell
        Shipping Clerk
      
      
        Douglas Grant
        Shipping Clerk
      
      
        Jennifer Whalen
        Administration Assistant
      
      
        Michael Hartstein
        Marketing Manager
      
      
        Pat Fay
        Marketing Representative
      
      
        Susan Mavris
        Human Resources Representative
      
      
        Hermann Baer
        Public Relations Representative
      
      
        Shelley Higgins
        Accounting Manager
      
      
        William Gietz
        Public Accountant
      
      
        Steven King
        President
      
    
     
    

    The input document is transformed and each job_id is replaced by its corresponding label.

  • Is it safe to remove the date in the name of the xml document?

    Hi, the iTunes library xml document is titled "iTunes Library" 2015-07-11. Is this correct and problems can occur if l remove the name date?

    L ask because my Sonos system has trouble with importing iTunes playlists and they are suggesting that the document name length perhaps the question.

    Thank you

    This file is a copy of the database (.itl) iTunes created by iTunes, during an update.  The XML version of the library is always called iTunes Library.xml.  Is there is no basis for comment by Sonos, that it may be related to the length of the absolute path of the XML file - where it is on your system?

  • Merge the XML with regular Adobe Reader (DC)?

    Hi all

    We have developed a PDF file containing several form fields.

    We use a VBScript file to merge an XML file with the PDF file.

    It works perfectly on my pc with Adobe Acrobat Pro DC development.

    However, when I try to run the same code on a pc with (only) the Adobe Acrobat Reader installed, the script fails and the following error code is displayed:

    Component ActiveX cannot create object.

    Is it really necessary to have Adobe Acrobat Pro DC installed on each client pc?

    We understand that it is necessary to purchase a license Adobe Acrobat Pro DC to be able to create the PDF file, but we assumed that it was possible to run this code with just the installed Adobe Acrobat Reader? Or are there additional libraries (for Adobe Acrobat Reader) which must be installed on the client computers?

    Thank you.

    Best regards

    You can do this via a file FDF or XFDF referring to the original PDF file. In your VBScript, you will need to prepare such a file and open with the reader. Player will then open the referenced PDF file and fill in the fields on the form.

  • Insert the XML document with values of characters &lt; or &gt;

    Hello world

    Used Oracle: version 11.2.0.3.0

    I want to insert an XML document in a binary XML field. But for an element, the value includes characters such as > or <.

    Here's an example query:

    Update / * + no_xml_query_rewrite * / ms2 set mstag = XMLQuery (' copy $tmp: = .modify (for $i in $tmp/tags/fields[@id="MS"]))

    back insert nodes (< value > TEST\n & lt; Address1 & gt; < / value >) in $i) return $tmp' from mstag content back) where psid = 5900;

    But because we're using the character & in a SQL query, this request has failed. We invited to specify the 2 values.

    So, what is the way of giving the < Address1 > value to the value of the element in the example?

    Thanks in advance

    The command is not really "fail" in itself. It is just the tool that you are using recognizes '&' characters and treats the following identifiers as replacement variables.

    What tool do you use?

    For example, in SQL * Plus you can disable this behavior through the SET DEFINE OFF or SET SCAN OFF command.

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

  • How to merge the 4 document files under 1 name of file under XP?

    I have four documents, each filed under a different name. How can I join together under the same name?

    Hi AURORE1707,
     
    -What type of documents do you mean?
    -Are the four documents that you're talking about, the same document type of request?
     
    After return with more information pertaining to the matter for us help to help you better.
  • I really need professional help in the analysis of XML to the XML Document, or I want to read XML

    Hi all

    I'm really looking for your sweet help. I have suffered for two days. I'm working on Blackberry java app. I have the xml file is located in "file:///store/home/user/myNotes.xml".

    I want to be able to parse the XML into XMLDocument to confront the NodeList and ChildNode.

    I always get Eception Exception RunTimeError

    NOTE the following prayer:

    1 - my JDK is 1.7.0.5.5 (SE) only

    2. I don't have "XMLSerializer" or "Transformer", or "TransformerFactory', 'KXML.

    3. all I want is just to be able to read XML above and analyzed to XMLDocument.

    Find my Java code below:

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

    Private Sub parseXmlFile() raises {RuntimeException
    try {}

    XMLDocument DOM = null;
    private static final String fileN = "file:///store/home/user/myNotes.xml";
    FileConnection fc = (FileConnection) Connector.open (fileN);
    fc.openDataInputStream ();
    DocumentBuilderFactory plant = DocumentBuilderFactory.newInstance ();
    DocumentBuilder builder = factory.newDocumentBuilder ();
    InputStream is = getClass () .getResourceAsStream (fileN);
    DOM = builder.parse (is);
        
    } catch (Exception pce) {}
    Dialog.Alert (PCE. ToString());
    }
            
    }

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

    End of my Code

    Thank you very much for your time of reading and you answer to help me.

    I appreciate really.

    Dear all,

    Hello and thank you from the bottom of my heart. This works. My problem was absent "normalization."

    Thank you once again I ng3epa enjoyed your valuable contribution.

  • Error: There is an error in the XML document

    I get the following messages on a couple of my backup jobs

    Error: There is an error in the XML (21, 88).

    and

    Error: There is an error in the XML (20, 331).

    I searched the Forum and support site and saw recommendations on globalmanifest files get corrupted, but all these articles, related to CIFS/HFS of depository shares.

    I get these errors on jobs, save them in the areas of data and cannot find any info on the exact error numbers above.

    GlobalManifest has the same structure of any type of report that you use. It is a text based with xml content file. So here is a quick check: copy the file to your local disk, edit the XML extension, open with Firefox or Chrome. If the xml structure is valid, you will see the content. Otherwise the browser will display error. Probably the same you see in store. Follow the steps in KB.

  • Change the namespace in the XML document in PLSQL

    Hi friends,

    by creating an XML namespace, I used a query as below

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

    || () XMLSERIALIZE

    (XMLELEMENT) DOCUMENT

    "DeriveCoverageRequest,"

    XmlAttributes)

    "urn: xyz:ccw:config:common: data ' AS 'xmlns '.

    ("urn: xyz:ccw:config:msa: data ' AS 'xmlns:ns1'),

    (l_xmltype) AS CLOB)

    its working fine. But... There are no changes in ie.

    DeriveCoverageRequest should be like "ns1:DeriveCoverageRequest".

    I modified the code as

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

    || () XMLSERIALIZE

    (XMLELEMENT) DOCUMENT

    "ns1:DeriveCoverageRequest,"

    XmlAttributes)

    "urn: xyz:ccw:config:common: data ' AS 'xmlns '.

    ("urn: xyz:ccw:config:msa: data ' AS 'xmlns:ns1'),

    (l_xmltype) AS CLOB)

    but his mistake to launch.

    Please help out to as below

    < ns1:DeriveCoverageRequest xmlns = "urn: xxx:ccw:config:common: data" xmlns:ns1 = "urn: xxx:ccw:config:msa: data" >

    Thanks in advance.

    Arun

    BTW, 10.2, you can make use of XMLROOT, no necessary concatenation... (and no risk of implicit conversion of character)

    SELECT XMLSERIALIZE ( DOCUMENT xmlroot
                                  (XMLELEMENT (
                                   "ns1:DeriveCoverageRequest",
                                   xmlattributes (
                                      'urn:cisco:ccw:config:common:data' AS "xmlns",
                                      'urn:cisco:ccw:config:msa:data' AS "xmlns:ns1"),
                                   dummy)
                                   , VERSION '1.0', STANDALONE YES
                                   )
                                   AS CLOB)
    from dual;   
    
    X
    
  • Open the .pdf document in a table with scroll bars cell?

    How do I would have created a table where loading the page in a scrolling .pdf document appears in a table cell?

    Files PDF is media files.  How they are treated is entirely at the mercy of your end-users system software and browser settings.  Many people like me prefer to download a PDF file, then open them directly in Acrobat Pro, thus avoiding any need for browser support.    The best you can do is to provide a direct link to the PDF file and let people manage their own path.

    Nancy O.

  • Through the XML file in a table?

    Hi all

    I am having trouble interrperting how I should browse a XML file and pushing it toward a table to display data sets.

    Here is my as:

    myXML = new XML();
    myXML.ignoreWhite = true;
    myXML.onLoad = {function (ok)}

    If {(ok)
    ALLDATA = this.firstChild.childNodes;
    allEntries = this.firstChild.firstChild.childNodes;

    for (i = 0; i < alldata.length; i ++) {}
    trace (newline + "letter:" + alldata [i] .nodeName);

    for (r = 0; r < allEntries.length; r ++) {}
    trace(allEntries[r].nodeName+":"+allEntries[r].firstChild);
    }

    }

    } else {}
    trace ("loading error");
    }
    };
    myXML.load ("temp_glossary.xml");

    This is my XML:

    <? XML version = "1.0" encoding = "iso-8859-1? > <!-this - >
    < Glossary >

    < A >

    < aardvark > he is an Aardvark < / Aardvark > <! - firstChild.firstChild.firstChild - >
    < Apple > it is an Apple < / Apple >
    < EPA > it's a monkey < / EPA >
    < /A >

    < B >
    < Ball > it is a ball < / balls >
    < bat > it is a bat < / Bat >
    < bike > it is a bike < / Bike >
    < /B >

    < C >
    < drive > it is a car < / car >
    < heading > it is a cap < / Cape >
    < Cook > This is a Cook < / Cook >
    / < C >
    < / Glossary >

    Output is currently:

    Letter: A
    Aardvark: he is an Aardvark
    Apple: this is an Apple
    EPA: it is a monkey

    Letter: B
    Aardvark: he is an Aardvark
    Apple: this is an Apple
    EPA: it is a monkey

    Letter: C
    Aardvark: he is an Aardvark
    Apple: this is an Apple
    EPA: it is a monkey

    The output, I see I only have access to the firstChild whenever I write the words, but I do not know how to go about it increments to the next block of words.  I guess I can do with a 2D array and iteration, but don't know how to implement.

    Any help would be greatly appreciated, thank you.

    Chris

    :

    myXML = new XML();
    myXML.ignoreWhite = true;
    myXML.onLoad = {function (ok)}
    If {(ok)
    ALLDATA = this.firstChild.childNodes;
    allEntries = this.firstChild.firstChild.childNodes;
    for (i = 0; i
    trace (newline + "letter:" + alldata [i] .nodeName);
    for (r = 0; r
    trace (Alldata [i] Sublst.ChildNodes(1).ChildNodes(0) [r].firstChild.nodeValue);
    }
    }
    } else {}
    trace ("loading error");
    }
    };

Maybe you are looking for