XML Difference

Hi,
We need to compare two XML objects and get the difference as an XML Document. We are looking for an efficient XML API that does differencing on large XML objects. Does anyone know if Apache has an XML Diff package?
We tried Oracle XDK, but came across a bug. It will not get fixed until the next Oracle database patch, so we're looking to use something else.
Thanks for your help,
Maria

I see quite a few open source APIs available on the site below
http://www.roseindia.net/opensource/xmldiff.php
Let me give you a word of advice. Ignore anything and everything you find on that site. It is a notorious source of drivel.

Similar Messages

  • Help needed !  How to find out 'XML Difference' using XDK

    I'm using oracle.xml.differ.XMLDiff.
    I have set XML files.
    Then calling generateXSLFile("somefile")
    While running facing :
    Exception in thread "main" java.lang.NullPointerException
    at oracle.xml.differ.XMLDiff.generateXSL(XMLDiff.java:383)
    at oracle.xml.differ.XMLDiff.generateXSLFile(XMLDiff.java:330)
    at XMLDiffTest.main(XMLDiffTest.java:38)
    Same prob if I use setDocuments(xd1,xd2) ....
    What is the way out ?
    Does anyone have any sample code ?
    TYI
    Kaniska

    To compare XML documents with the XMLDiff class.
    -Add /lib/xml.jar and /lib/xmlparserv2.jar to the Classpath.
    -Parse the two documents to be compared with the DOMParser.
        DOMParser parser=new DOMParser();
                 parser.parse("file://c:/xmlFile1.xml");
    XMLDocument document1=parser.getDocument();
    XMLDocument document2;-Create an object of type XMLDiff
    XMLDiff xmlDiff=new XMLDiff(); -Set the documents to be compared.
    xmlDiff.setDocuments(document1, document2);-Compare the XML documents.
    boolean diff=xmlDiff.diff();If diff is 'true', the documents are different.
    -Generate the XSLT for the differences between the XML documents.
    xmlDiff.generateXSLFile("diff.xslt");

  • Java XML Difference APIs

    Hello all,
    I am trying to do an analysis on Open source APIs for finding the difference between 2 XMLs. Both the XML documents would belong to the same schema and the individual differences between the tags have to be found. For eg. Lets say the XML A is the initial version of a XML and XML B is updated version of XML A, I should be able to prepare a report on which I should be able to find out what are all the new XML tags which have been added, what XML tags have been modified and what XML tags have been deleted. And the size of these XMLs could be anywhere from few Kbs to 500 Mb.
    I see quite a few open source APIs available on the site below
    http://www.roseindia.net/opensource/xmldiff.php
    But it would help if someone had worked on these APIs before and provide a feedback and suggestions about the same.
    Thanks
    IK
    Edited by: IronKnight on Apr 20, 2010 8:47 AM

    I see quite a few open source APIs available on the site below
    http://www.roseindia.net/opensource/xmldiff.php
    Let me give you a word of advice. Ignore anything and everything you find on that site. It is a notorious source of drivel.

  • JWSDP1.0 XML differences

    We are using SUN's JWSDP 1.0 API to do a call to WEBSERVICE and parse the XML result set on Websphere 5.x application server. Everything worked fine until we appy the new recommended patch for the Applicaiton server.
    We are using DOM parser(Xerces) to parse the XML result set. We observe the XML string returned from WEBSERVICE include NAME SPACE DEFINITIONS. When we do a DOM API call 'getelement' we get the Name space elements along with actual 'element' which causes the parsing logic to fail. We have a workaround solutions ignoring the name space elements and take into account only the actual elements.
    We want to know how do we resolve this issue.
    Is there a standard way to filter the Name space elements on DOM API?
    Given below the XML string retured:
    XML String(NO NAME SPACE TAGS)
    Result:<?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><AddressSearchResponse xmlns="http://www.usps.gov/2002/07/AMS"><ErrorCode>331</ErrorCode><Message/><RecordCount>1</RecordCount><Flags/><AddressRecords><AddressRecord><Street1>2555 CHASE WELLESLEY DR</Street1><Street2/><Firm/><City>HERNDON</City><State>VA</State><Zip>20171</Zip><Zip4>3496</Zip4><Urbanization/><Route>R032</Route><County>059</County><CountyName>FAIRFAX</CountyName><Barcode>557</Barcode><Type>S</Type></AddressRecord></AddressRecords></AddressSearchResponse></soap:Body></soap:Envelope>
    XML STRING (WITH NAME SPACE TAGS)
    Result:<?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><AddressSearchResponse xmlns="http://www.usps.gov/2
    002/07/AMS"><ErrorCode xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.usps.gov/2002/07/AMS">331</ErrorCode
    <Message xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.usps.gov/2002/07/AMS"/><RecordCount xmlns:soap="h
    ttp://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.usps.gov/2002/07/AMS">1</RecordCount><Flags xmlns:soap="http://schemas.x
    mlsoap.org/soap/envelope/" xmlns="http://www.usps.gov/2002/07/AMS"/><AddressRecords xmlns:soap="http://schemas.xmlsoap.org/soap/enve
    lope/" xmlns="http://www.usps.gov/2002/07/AMS"><AddressRecord><Street1>2555 CHASE WELLESLEY DR</Street1><Street2/><Firm/><City>HERND
    ON</City><State>VA</State><Zip>20171</Zip><Zip4>3496</Zip4><Urbanization/><Route>R032</Route><County>059</County><CountyName>FAIRFAX
    </CountyName><Barcode>557</Barcode><Type>S</Type></AddressRecord></AddressRecords></AddressSearchResponse></soap:Body></soap:Envelop
    e>
    We would appreciate feedback and suggestions.
    Nathan

    I would like to correct the version informaiton. We are using SUN JAVA WEBSERVICES DEVELOPERS PACK (JWSDP1.1).
    Nathan

  • How to compare two xmltypes in oracle 10g ?

    Hi,
    I have a requirement that i have to compare two xmltypes of a table.
    Is there any function available in oracle 10g that compares two xmltypes.
    Regards
    Krishna

    This can help for this question
    Re: Help needed !  How to find out 'XML Difference' using XDK

  • Importing CS4 Keyboard Shortcuts to CS5

    I've  discovered that you can open your custom keyboard shortcuts xml file in a  text editor, and copy/paste shortcuts into your CS5 keyboard shortcuts  file. Anyone else tried this? Is there an easier way to import all of  your keyboard shortcuts from CS4 to CS5?

    I did some experimentation, and I stand corrected! Apparently my memory was dodgy. In particular:
    My experience is that it basically works fine, though it's been a while.
    I thought we had tested this from CS3 to CS5, but it looks like maybe we only did it from CS5 to CS5.5. Which are a lot more similar.
    (And yes, I did recall people having complaints about it, but my experience disagreed...)
    Indeed, you have some problems with CS4 to CS5, but they are not subtle. At least, initially, I was getting a dialog box informing me that there were defined shortcuts in the shortcut set that were invalid (Somewhere along the way that stopped happening, which is Interesting, but probably not relevant).
    Anyhow, I certainly don't disagree that pasting the XML differences is the better way to go -- I said as much in post #13.
    But by way of recompense, here are a pair of scripts to make it easier.
    Both require you to create a special shortcut set called "defaults" (i.e. defaults.indk) that they use as a baseline for differences. For a variety of reasons, it is insufficient for the script to use the Default.indk file in the application directory. Both scripts pop up an error if you have not done this, and tell you how to do it.
    The first one, extractShortcuts.jsx, prompts you to select a shortcut file to extract from, compares it against the default shortcut set, and outputs and differences to a file on the Desktop, extracted.xml. Run this in CS4.
    The second one, importShortcuts.jsx, prompts you to select the extracted.xml file from previous, asks you for the name of the new shortcut set, and then merges the two. It merges them in a fairly stupid way (just plain appending just before the end), but it's probably sufficient.
    So here we go, exportShortcuts.jsx:
    #target InDesign
    (function() {
         var appdir = app.filePath,
              prefs, shortcuts,
              i, s,
              defaults, readcuts,
              defxml, readxml,
              e, ea, action, context, string,
              defaultsByAction, d;
         var includes = $.includePath.split(";");
         for (i=0; i<includes.length; i++) {
              s = includes[i];
              if (s.match("Preferences") && s.match(/Scripts$/)) {
                   prefs = new File(s).parent;
                   break;
         if (!prefs) {
              alert("Could not find User Preferences directory");
              exit(1);
         // $.writeln(prefs.fsName);
         shortcuts = prefs.getFiles("InDesign Shortcut Sets")[0];
         defaults = shortcuts.getFiles("defaults.indk")[0];
         if (!defaults) {
              alert(
         'The script requires a special shortcut set called "defaults" to exist.\n'+
         'The app-folder Defaults.indk is NOT sufficient. Please go to '+
         'Edit > Keyboard Shortcuts, and select the the [Default] shortcut set,'+
         '  modify it in a trivial way (for instance, assign F1 to About InDesign),'+
         ' name the new set "defaults", remove the modification, and save the set.'+
         ' Then re-run this script.');
              exit(1);
         readcuts = shortcuts.openDlg("Select an INDK file to extract shortcuts from.","*.indk");
         writecuts = new File(Folder.desktop.fullName+"/extracted.xml");
         defaults.open("r");
         defxml = new XML(defaults.read());
         defaults.close();
         readcuts.open("r");
         readxml = new XML(readcuts.read());
         readcuts.close();
         writecuts.open("w");
         writecuts.writeln("<shortcut-sets>"); // hack
         defaultsByAction = {};
         for (i=0; i<defxml.shortcut.length(); i++) {
              e = defxml.shortcut[i];
              ea = e.elements()[0];
              if (ea.name() != "action-id") {
                   alert("Parse failure on element "+ea);
                   exit(1);
              action = ea.attributes();
              context = e.context[0];
              string = e.string[0];
              defaultsByAction[action] = { context: context, string: string };
         for (i=0; i<readxml.shortcut.length(); i++) {
              e = readxml.shortcut[i];
              ea = e.elements()[0];
              if (ea.name() != "action-id") {
                   alert("Parse failure on element "+ea);
                   exit(1);
              action = ea.attributes();
              context = e.context[0];
              string = e.string[0];
              d = defaultsByAction[action];
              if (!d ||
                   d.context != context ||
                   d.string != string) {
                   writecuts.writeln(e);
         writecuts.writeln("</shortcut-sets>"); // matching hack
         writecuts.close();
    And its mating half, importShortcuts.jsx:
    #target InDesign
    (function() {
        var appdir = app.filePath,
            prefs, shortcuts,
            i, s,
            defaults, readcuts,
            writename, writecuts,
            defxml, readxml,
            e, ea, action, context, string,
            defaultsByAction, d;
        var includes = $.includePath.split(";");
        for (i=0; i<includes.length; i++) {
            s = includes[i];
            if (s.match("Preferences") && s.match(/Scripts$/)) {
                prefs = new File(s).parent;
                break;
        if (!prefs) {
            alert("Could not find User Preferences directory");
            exit(1);
        // $.writeln(prefs.fsName);
        shortcuts = prefs.getFiles("InDesign Shortcut Sets")[0];
        defaults = shortcuts.getFiles("defaults.indk")[0];
        if (!defaults) {
            alert(
        'The script requires a special shortcut set called "defaults" to exist.\n'+
        'The app-folder Defaults.indk is NOT sufficient. Please go to '+
        'Edit > Keyboard Shortcuts, and select the the [Default] shortcut set,'+
        '  modify it in a trivial way (for instance, assign F1 to About InDesign),'+
        ' name the new set "defaults", remove the modification, and save the set.'+
        ' Then re-run this script.');
            return 1;
        readcuts = Folder.desktop.openDlg("Select an XML file to import shortcuts from","*.xml");
        writename  = prompt("Choose a name for the new shortcut set. One word, no spaces, please.",
        "new");
        writecuts = new File(shortcuts+"/"+writename+".indk");
        defaults.open("r");
        defxml = new XML(defaults.read());
        defaults.close();
        readcuts.open("r");
        readxml = new XML(readcuts.read());
        readcuts.close();
        defxml.appendChild(readxml.elements());
        writecuts.open("w");
        writecuts.write(defxml);
        writecuts.close();
    These are written on a Mac. I suppose there's they might not work perfectly under Windows if the logic to find the user's keyboard shortcuts directory doesn't work.
    As always, install scripts by saving each script as a plain text file (in TextEdit or Notepad) and following directions at, e.g., How to Install InDesign Scripts.
    Good night.

  • SQL to find out changes

    Hi,
    I have a table with 50 columns, lets call it Table_A . There is a identical table called Table_B. The data in Table_B gets flushed every night and data from Table_A is moved to Table_B. A new set of data is inserted into Table_A. Now I need to find out which field value is changed and what is changed . A minus command can give the changed records, but how to get the what was prior value for each changed field . Here is what I am looking for
    WITH TABLE_A AS  (  SELECT 1 ID, 'JOHN' NAME,  'SALES' DIV FROM DUAL
    UNION
            SELECT 2 ID, 'MARRY' NAME,  'ACCOUNTS' DIV FROM DUAL
    UNION
            SELECT 3 ID, 'KIM' NAME,  'SERVICE' DIV FROM DUAL),
    TABLE_B AS  (  SELECT 1 ID, 'JOHN' NAME,  'SALES' DIV FROM DUAL
    UNION
            SELECT 2 ID, 'MARRY' NAME,  'ACCOUNTS' DIV FROM DUAL
    UNION
            SELECT 3 ID, 'KIM' NAME,  'SALES' DIV FROM DUAL) 
    SELECT * FROM TABLE_A
    MINUS
    SELECT * FROM TABLE_B
    what i want is something that will spit out this (only one record, because there is only one diff record found in the above query.)
    ID,     OLD_ID,     NAME,   OLD_NAME ,  DIV ,       OLD_DIV
    3           3       KIM       KIM       SERVICE     SALESThe above one is for sample purpose, The actual table has 50 fields, and except the ID field, all other field values might change.
    All ideas and solutions are appreciated.
    Thanks in advance.

    >
    I understand your frustration. Here is the scenario. There are set of 5 tables. 1 master and 4 child tables ( and an identical set of 5 tables called "prior" tables, to store the flushed data from the "current" 5 tables). Every night data comes in XML files, the data from the 5 "prior" tables get flushed out . The data from the 5"current" table set moves to 5 "prior" tables. Then XML data gets loaded into the 5 "current"tables. Now once XML gets loaded into the original table ,I have to find out the diffs in those 5 tables(between current and prior) and generate result sets listing only the columns that have changed value. So what is current value and what was the prior value(from the prior table) side by side .
    >
    I'm not frustrated. It's just that any suggestions we make are solely based on the information provided. Sometimes posters start focusing on the solution they want to use (which is ok for their viewpoint) and don't explain the actual problem they are trying to solve. That often limits our ability to understand the options.
    Now that you posted the above there is another option you could use that might better deal with some of the issues people have mentioned.
    That solution is to compare the XML versions of the data. You haven't mentioned HOW you load that XML data into relational tables (what tool and process) but there is one VERY USEFUL feature of data in XML format:
    ALL data is already in TEXT format (excluding the obvious LOB possibilities, which you also haven't mentioned).
    That means ALL datatypes can use simple string comparison to detect differences: numbers, dates, character data. The actual meaning doesn't matter. If even a single byte is different the value can be considered different.
    Oracle uses XML and XSLT functionality as the base for their DBMS_METADATA_DIFF package. That package is used to compare schemas or databases to detect object (e.g. tables, views) differences and to automatically produce DDL for ALTER statements that can modify an object to have the same structure as the objects being compared.
    I suggest that you consider doing your comparisons on the XML versions of the data. Each night you would compare the new XML file data against the previous night's XML data. You can use XSLT to do the comparison and also to produce an XML file that contains the differences. Then you can use that 'difference' file as the source of your process to ultimately display the data.
    An additional advantage of doing the XML comparisons is that you can do them asynchronously as soon as the new file is available. And the, if you don't really need the 'change' info in the database you never need to load it. Just transform the change XML into an Excel file or flat file format for users to load into Excel for review.
    Do you license the partitioning option? If so then another suggestion would be to stop doing your nightly 'flush and move'. Recreate your 'prior' tables as partitioned tables that have just ONE range partition; a MAXVALUE partition that covers ALL data. Then each night you would:
    1. TRUNCATE the prior table
    2. Do an EXCHANGE partition between the 'current' table and the associated 'prior' table. Very fast, metadata only - no data actually gets moved.
    3. Load the 'current' table with new data.
    The above process avoid any actual data movement between the 'current' and 'prior' tables.
    Not picking on you but you also haven't said how that new daily 'current' data is being used. If the only reason you are loading it into a table is to compare it to yesterday's data you could just do that with XML like I mentioned above.
    Or you could load the XML itself into a table (e.g. XMLTYPE) and uses Oracle's built-in XDB fuctionality and do the XML comparison 'inside' the database. Then load a standard heap table from the XML table when you need to.
    Maybe the above helps explain why the more info we have about the actual end-to-end problem you have the more options we can suggest for dealing with it. You are the only one that can determine if an option is viable for your particular use case and constraints.
    Updated to add links to Oracle's XML functionality
    See the XMLDiff function that you can use IN the database if you load the XML files themselves. From the SQL Language doc
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/functions241.htm#SQLRF20025
    >
    Purpose
    The XMLDiff function is the SQL interface for the XmlDiff C API. This function compares two XML documents and captures the differences in XML conforming to an Xdiff schema. The diff document is returned as an XMLType document.
    For the first two arguments, specify the names of two XMLType documents.
    For the integer, specify a number representing the hashLevel for a C function XmlDiff. If you do not want hashing, set this argument to 0 or omit it entirely. If you do not want hashing, but you want to specify flags, then you must set this argument to 0.
    For string, specify the flags that control the behavior of the function. These flags are specified by one or more names separated by semicolon. The names are the same as the names of constants for XmlDiff function.
    See Also:
    Oracle XML Developer's Kit Programmer's Guide for more information on using this function, including examples, and Oracle Database XML C API Reference for information on the XML APIs for C
    Examples
    The following example compares two XML documents and returns the difference as an XMLType document:
    >
    See Oracle' own XML Developer's Kit for out-of-the-box functionality for 'diffing' XML documents:
    http://docs.oracle.com/cd/E11882_01/appdev.112/e23582/adx_c_diff.htm
    >
    21 Determining XML Differences Using CThe Oracle XDK includes components that help you to determine the differences between the contents of two XML documents and then to apply the differences (patch) to one of the XML documents.
    This chapter contains these topics:
    Overview of XMLDiff in C
    Using XmlDiff
    Using XmlPatch
    Using XmlHash
    Overview of XMLDiff in C
    You can use Oracle XmlDiff to determine the differences between two similar XML documents. XmlDiff generates an Xdiff instance document that indicates the differences. The Xdiff instance document is an XML document that conforms to an XML schema, the Xdiff schema.
    You can then use XmlPatch, which takes the Xdiff instance document and applies the changes to other documents. This can be used to apply the same changes to a large number of XML documents.
    XmlDiff only supports the DOM API for input and output.
    XmlPatch also supports the DOM for the input and patch documents.
    XmlDiff and XmlPatch can be used through a C API or a command line tool, and they are exposed by two SQL functions.
    An XmlHash C API is provided to compute the hash value of an XML tree or subtree. If hash values of two trees or subtrees are equal, the trees are identical to a very high probability.
    >
    Did you notice that part about 'XmlDiff generates an Xdiff instance document that indicates the differences'? That is EXACTLY what your initial question was asking about, albeit from a DB perspective.
    But XML is XML, DIFF is DIFF, a date/number/text are all strings. So XML 'database data' works the same as XML 'test or complex hierarchy' data.
    Here is a pretty good writeup of how to do XML diff. See the XMLDIFF2 section for the best Oracle sample:
    http://ellebaek.wordpress.com/2011/02/01/comparing-xml-in-oracle/
    >
    XMLDIFF2
    The algorithm in our extended XMLDIFF function that we’re going to call XMLDIFF2 is:
    1.Prepare CLOB variable for constructing the difference XML.
    2.Find minimum number of leading elements that form primary key values (unique lookup).
    3.Look for primary key values in XML1 not present in XML2: These primary key values have been deleted.
    4.Look for primary key values in XML2 not present in XML1: These primary key values have been inserted.
    5.Diff all common primary key values, ie in both XML1 and XML2.
    6.Return NULL if no differences found.

  • Difference between Oracle Text and XML DB?

    We are currently storing XML's in Oracle text. I understand that XML DB is faster to retrieve XML's based on conditional search within XML.
    Is there a place I could find the difference between these two?

    Text offer xpath like searching, assuming that you don't need to worry about little things like namespaces :). Oracle XML DB offers native XML storage, indexing and searching fully compliant with rellevant XML standards.

  • Difference/relationship between XML and XSD

    Hi All,
    Correct me if i am wrong,
    When we create a source and a target datatype in IR automatically objects will be created in XSD.
    The same way it does when we create message type.
    In message mapping, We map source and target message type and when we test with sample data, we can view source and target in xml
    My question is what is the difference/relationship between XML and XSD ?
    Thanks,
    ss

    Hi,
    XML (Extensible Markup Language) is a W3C initiative that allows information and services to be encoded with meaningful structure and semantics that computers and humans can understand. XML is great for information exchange, and can easily be extended to include user-specified and industry-specified tags.
    Whereas
    An XML Schema Definition (XSD) is an instance of an XML schema written in the XML Schema language. An XSD defines a type of XML document in terms of constraints upon what elements and attributes may appear, their relationship to each other, what types of data may be in them, and other things. It can be used with validation software in order to ascertain whether a particular XML document is of that type, and to produce a Post-Schema Validation Infoset.
    I hope this clarifies.
    Regards.
    Praveen

  • Compare 2 different xml versions and highlite the differences

    Hi,
    Currently we have xml and that is displayed on the web page using the css style sheets.
    The xml we have remain the same most part but with small changes (say different version created after a week).
    We want to be able to track the differences from the previous version and highlight them, the differences, when showing it in the web page.
    Please advise if this can be done and how.
    Thanks.

    try
    SQL> set serveroutput on
    SQL> set long 50000
    SQL>
    SQL> declare
      2 
      3    --main
      4    xml1 xmltype := xmltype('<ROWSET>
      5                                <ROW>
      6                                  <EMPNO>7934</EMPNO>
      7                                  <ENAME>MILLER</ENAME>
      8                                  <JOB>CLERK</JOB>
      9                                  <MGR>7782</MGR>
    10                                  <HIREDATE>1982-01-23T00:00:00</HIREDATE>
    11                                  <REMOVED>abc</REMOVED>
    12                                  <SAL>1300</SAL>
    13                                  <COMM/>
    14                                  <DEPTNO>10</DEPTNO>
    15                                </ROW>
    16                              </ROWSET>');
    17    --new
    18    xml2 xmltype := xmltype('<ROWSET>
    19                                <ROW>
    20                                  <EMPNO>7934</EMPNO>
    21                                  <ENAME>MILLER</ENAME>
    22                                  <JOB>CLERK</JOB>
    23                                  <MGR>7782</MGR>
    24                                  <ADDED>xyz</ADDED>
    25                                  <HIREDATE>1982-01-23T00:00:00</HIREDATE>
    26                                  <SAL>1300</SAL>
    27                                  <COMM/>
    28                                  <DEPTNO>10</DEPTNO>
    29                                </ROW>
    30                              </ROWSET>');
    31    diff xmltype;
    32 
    33    xtype varchar2(80);
    34    xpath varchar2(80);
    35    xpathChild varchar2(80);
    36    xnodeChild varchar2(80);
    37    new_value xmltype;
    38 
    39    new_xml xmltype;
    40 
    41 
    42  begin
    43 
    44    -- get diff
    45    select xmldiff(xml1, xml2) into diff from dual;
    46    dbms_output.put_line(diff.getclobval());
    47 
    48    -- that have
    49    select x.xtype, x.xpath, x.new_value
    50      into xtype, xpath, new_value
    51      from xmltable(
    52             xmlnamespaces('http://xmlns.oracle.com/xdb/xdiff.xsd' as "xd"
    53                          ,'http://www.w3.org/2001/XMLSchema-instance' as "xsi"
    54                          )
    55           , '/xd:xdiff'
    56             passing diff
    57             columns xtype     varchar2(80) path 'local-name(xd:insert-node-before)'
    58                   , xpath     varchar2(80) path'xd:insert-node-before/@xd:xpath'
    59                   , new_value xmltype path 'xd:insert-node-before/xd:content/*'
    60           ) x;
    61 
    62     dbms_output.put_line('type of doing: ' || xtype);
    63     dbms_output.put_line('path for doing: ' || xpath);
    64     dbms_output.put_line('value for doing: ' || new_value.getclobval());
    65 
    66     if (xtype = 'insert-node-before') then
    67       xpathChild := substr(xpath, 1, instr(xpath, '/',-1)-1);
    68       xnodeChild := substr(xpath, instr(xpath, '/',-1)+1);
    69 
    70       select insertChildXMLbefore (xml1,
    71                                    xpathChild,
    72                                    xnodeChild,
    73                                    XMLType('<HIGHLIGHT>' || new_value || '</HIGHLIGHT>'))
    74       into new_xml
    75       from dual;
    76     end if;
    77 
    78 
    79     dbms_output.put_line(new_xml.getclobval());
    80 
    81  end;
    82  /
    <xd:xdiff xsi:schemaLocation="http://xmlns.oracle.com/xdb/xdiff.xsd http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xd="http://xmlns.oracle.com/xdb/xdiff.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><?oracle-xmldiff operations-in-docorder="true" output-model="snapshot" diff-algorithm="global"?><xd:insert-node-before xd:node-type="element" xd:xpath="/ROWSET[1]/ROW[1]/HIREDATE[1]"><xd:content><ADDED>xyz</ADDED></xd:content></xd:insert-node-before><xd:delete-node xd:node-type="element" xd:xpath="/ROWSET[1]/ROW[1]/REMOVED[1]"/></xd:xdiff>
    type of doing: insert-node-before
    path for doing: /ROWSET[1]/ROW[1]/HIREDATE[1]
    value for doing: <ADDED>xyz</ADDED>
    <ROWSET><ROW><EMPNO>7934</EMPNO><ENAME>MILLER</ENAME><JOB>CLERK</JOB><MGR>7782</MGR><HIGHLIGHT><ADDED>xyz</ADDED></HIGHLIGHT><HIREDATE>1982-01-23T00:00:00</HIREDATE><REMOVED>abc</REMOVED><SAL>1300</SAL><COMM/><DEPTNO>10</DEPTNO></ROW></ROWSET>
    PL/SQL procedure successfully completed
    SQL>
    SQL> select * from v$version where rownum=1;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    SQL>

  • Ann: Find differences in XML files online...

    Bookmark www.dommitt.com! Find differences between XML files in 3 easy steps.
    Upload the two files, view the differences and generate a DTD for the XML
    output. The site also has documents comparing other tools on the market and
    a description of the output XML format.
    Enjoy....
    -From the Team@Dommitt...

    hi,
    im trying to use xmp toolkit for adding metadata to a jpeg file, i didn't get any idea about that, will you tell me how or will you show me the sample code? this will be very much useful for me.
    thanks and regards

  • Store xml data with difference dtd in the same xmltype column?

    Hi, all!
    I want to know, whether i can store the xml data with difference DTD in the same xmltype column.
    thank you for your help
    rabbit

    As long as the column is not based on an XML Schema

  • Whats the difference between servlet-config.xml ang web.xml???

    whats the difference between servlet-config.xml ang web.xml???

    web.xml is the standard configuration for all Java EE web modules.
    servlet-config.xml appears to be pertinent only for Struts apps.
    you don't have to have servlet-config.xml if you don't use Struts, but you've got to have web.xml.
    %

  • Architectural Difference Effect on Signing/Verifying XML Document

    Hi all,
    I am using Apache Santuario for signing XML.
    1. I have a Windows Server 2008 64 Bit, which is using JAVA 7 32 bit JVM. Let's say my signed document is Signed_A. On Windows Server 2008 I am signing the document but the verification fails for Signed_A.
    2. Same application is being run on Windows 7 32 bit with the same JVM version. And the document is Signed_B on this machine. I am signing the document and verifying it without a problem.
    3. If I move the document Signed_B (which I could sign & verify on Windows 7) to Windows 2008 Server, using the same application I can verify the document. So, my spider senses tell me that, there is a problem with signing.
    4. Again if I move the document Signed_A to Windows 7 machine, I could not verify the signature.
    I don't know whether the situation is occur because of the difference of processors on machines. But if you have anything that can help me please let me know. Anything could be helpful for now because I'm stuck in here.
    Please feel free to ask if you need further explanations. I am not providing any code, because I am suspecting a configuration issue here.
    Thanks in advance.

    Hi,
    Can you tell me about your project on short notes. For information.
    Regards
    R.Rajendran

  • Differences xml-db  between R10g2 and R11_2 ?

    HI,
    there are differences in xml-db between R10g2 and R11_2 ?
    where I can find about it
    regards
    Edited by: astramare on Feb 17, 2011 3:04 PM

    ok:
    we have changed our DB from R10.2 to R11_2
    by using DataPump
    we do create a lot of different schema-based xml-Data
    by using DBMS_XMLGEN
    from a sql/xml-function based View
    like
    xmldoc := DBMS_XMLGEN.getXML(ctx);
    xmldoc_xmlType:=(xmltype(xmldoc)) ;
    xmldoc_xmlType.isSchemaValid
    dbms_xslprocessor.clob2file
    all other xml_schema do work fine after migration
    with this one following exception
    while validate the output inside a package
    we get an error
    LSX-00285: Referenzierter Schlüssel "405986.0" ist nicht definiert
    to look at differences
    I have identical created
    one XML-output in the ( old ) 10gR2 -DB
    and
    one XML-output in the ( new ) 11R2 - DB
    both I can ok validate against the same schema inside XML-Spy ( Vers 2006 )
    but
    the R10_2 XMLType does ok validate in DB 10gR2
    the R11_2 XMLType does not validate in R11 !
    by view the xml-data-files in XMLSpy or another editor
    there obvious a difference:
    In the SQL/XML-select I work with .extract
    the xml-output from R10 is correct in a xml-like structure
    the xml-output from R11 is not
    both data-file have the identical ascii-words
    but different size in kByte
    the call to register the schema in R10_2 and R11_2 is identical:
    dbms_xmlschema.registerSchema(
    schemaurl => vschemaurl,
    schemadoc => xsd_file,
    local => FALSE,
    gentypes => TRUE,
    genbean => FALSE,
    gentables => TRUE,
    force => FALSE,
    owner => dbuser
    ,CSID => nls_charset_id('AL32UTF8')
    the xml-schemas looks :
    R10
    <xs:schema targetNamespace="http://www.abcde.de/nsdir"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    xdb:flags="311"
    xdb:schemaURL="http://www.abcde.de/nsdis/SCHEMABEZ.XSD"
    xdb:schemaOwner="USER"
    xdb:numProps="36">
    R11:
    <xs:schema targetNamespace="http://www.abcde.de/nsdir"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified"
    -- new ?!
    xdb:storeVarrayAsTable="true"
    -- flag ?!
    xdb:flags="8503"
    xdb:schemaURL="http://www.abcde.de/nsdis/SCHEMABEZ.XSD"
    xdb:schemaOwner="USER"
    xdb:numProps="36">
    may be its a problem inside the data in the Views ?
    or a difference between R10 and r11 ?
    regards

Maybe you are looking for

  • INDD CS6 error: "InDesign cannot open files in the "InDesign CS5.5 Document" format.

    Working in CS6 on Mac OS X 10.7.5: When I double click an INDD file in the Finder, I get the following error from InDesign: "The document "doc name" could not be opened. InDesign cannot open files in the "InDesign CS5.5 Document" format."  This just

  • Authentication Problem for WebService

    Dear All, I have some existing interface which are SOAP to RFC synchronous.In this I am genreting WSDL and providing this WSDL to sender side and it is working fine. But when I have used same WSDL and Provide to some other application people and when

  • Exchange 2010 - EventID 2090&2102 on DC

    Hi guys. Exchange 2010 is installed on a domain controller (DC.domain.com). Let's skip the part about telling me that Exchange 2010 installed on DC is not a wise idea and please help regarding this Event Viewer Warning: EventID 2090 Process MSEXCHANG

  • Pass by reference and String

    public class Test {     static void method(String str) {         str = "String Changed";     public static void main(String[] args) {         String str = new String("My String");         System.out.println(str);         method(str);         System.o

  • Error in importing flex asset by xmlpost utility

    Hi All, I am trying to import flex attribute from one system to another.After execution following command i got error "java.lang.NoClassDefFoundError: com/fatwire/wem/sso/SSOException". Pls suggest me, to remove this error. java -Xmx1024m -Dfile.enco