Canonical XML

hi all,
iam working on AGILE to SAP scenario.
from agile iam getting AXML file which is in ZIP format. iam using one file adapter module to unzip into XML and procesing the data. the XML is normal XML, but my client want that XML should be canonical XML.
can any one tell me how to convert into canonical XML instead of normal XML.
Regards,
Madhav

Hi Madhav,
The canonical form of an XML document is physical representation of the document produced by the method described in this specification. The changes are summarized in the following list:
1. The document is encoded in UTF-8
2. Line breaks normalized to #xA on input, before parsing
3. Attribute values are normalized, as if by a validating processor
4. Character and parsed entity references are replaced
5. CDATA sections are replaced with their character content
6. The XML declaration and document type declaration (DTD) are removed
7. Empty elements are converted to start-end tag pairs
8. Whitespace outside of the document element and within start and end tags is normalized
9. All whitespace in character content is retained (excluding characters removed during line feed normalization)
10. Attribute value delimiters are set to quotation marks (double quotes)
11. Special characters in attribute values and character content are replaced by character references
12. Superfluous namespace declarations are removed from each element
13. Default attributes are added to each element
14. Lexicographic order is imposed on the namespace declarations and attributes of each element
The term canonical XML refers to XML that is in canonical form. The XML canonicalization method is the algorithm defined by this specification that generates the canonical form of a given XML document or document subset. The term XML canonicalization refers to the process of applying the XML canonicalization method to an XML document or document subset.
For more, please go through:
http://www.w3.org/TR/xml-c14n
http://www.ibm.com/developerworks/library/x-c14n/
Thanks,
Varun

Similar Messages

  • Canonical XML parser

    Do anybody know or have some XML parser to make Canonical XML? I need it to make digital signature.
    Thanx,
    erx

    By the way, i found this example and it works well:
    import java.io.ByteArrayInputStream;
    import org.w3c.dom.*;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.apache.xml.security.c14n.Canonicalizer;
    public class CanonicalizationExample
    static String input = "<book>\n\t<Author>Joe</Author>\n\t<ISBN value=\"12300093456\"/>\n</book>";
    public static void main(String args[]) throws Exception
    org.apache.xml.security.Init.init();
    DocumentBuilderFactory dfactory = DocumentBuilderFactory.newInstance();
    dfactory.setNamespaceAware(true);
    dfactory.setValidating(true);
    DocumentBuilder documentBuilder = dfactory.newDocumentBuilder();
    // this is to throw away all validation warnings
    documentBuilder.setErrorHandler(new org.apache.xml.security.utils.IgnoreAllErrorHandler());
    byte inputBytes[] = input.getBytes();
    Document doc = documentBuilder.parse(new ByteArrayInputStream(inputBytes));
    Canonicalizer c14n = Canonicalizer.getInstance(
         "http://www.w3.org/TR/2001/REC-xml-c14n-20010315#WithComments");
    byte outputBytes[] = c14n.canonicalizeSubtree(doc );
    System.out.println("Input (Uncanonicalized) Document\n" + input);
    System.out.println("\nOutput (Canonicalized) Document\n" + new String(outputBytes));
    }

  • Producing canonical XML

    Hi,
    I need to convert an XML document to its canonical form according to W3C standards. I tried to use http://xom.nu/ but it didn't work for some reason. Does anyone know other utilities that may do the work?
    Thanks,
    Daniel

    Thanks for the reply. Yeah, I did post on Javaranch too, trying to catch the widest cross section of people in the hope of an answer to this problem.
    You have a very good point about the attribute order. I must admit I hadn't thought of that. You are right, one of the things the canonical form requires is for the attributes to be in alphabetical order.
    I still find it hard to believe that there isn't a Sun library that does this. There is a javax package to support the other two steps in signing a message (MessageDigest and Signature) so it seems odd that there isn't one for this. Unless I'm simply missing it.
    I'm not entirely sure what you mean by an XML serializer, sorry I'm not that experienced in the whole XML, XSLT, etc firld yet. Is it the sort of thing that is Java uses when a Document is produced from a string containing XML?
    Thanks again for your help,
    Adrian

  • Canon XML tags lost or just hidden?

    I'm using Aperture to catalog JPEGs taken with a Canon 2S IS. It seems not all of Canon's XML tags are imported. I can see all the info in Canon's own Image Browser software, but not in Aperture. Color balance, ASA and things like that seem to get lost in the translation.
    I remember reading somewhere awhile ago that Canon doesn't use standard XML fields. Is that true? And if so, can't Apple just import all extraneous XML data into random unnamed fields that the user can then tag?
    Is this data really in Aperture and I just can't find it, or is it not imported because it doesn't match what Apple expects to find?
    Thanks for any tips.
    1.25 gHz G4 Powerbook w/ 1 gig RAM   Mac OS X (10.4.6)  

    Is that camera officially supported?

  • XSQL: How to embed the XML document(s) instead of posting?

    Dear all.
    I'm trying to use XSQL for a self-contained database schema setup. This setup should be able to handle DML (INSERT/UPDATE/DELETE), PL/SQL calls etc and I thought XSQL looks perfect for the job. As such, I wouldn't be using XSQL as a publishing framework but as kind of an ETL tool. The only output I would be interested in would be the xsql-status in order to check that the number of rows processed matches my expectations. I would prefer XSQL to run entirely within the database and not depend on any servlet container.
    However, it seems that XSQL's only way of obtaining the canonical XML (ROWSET/ROW) that is used by xsql:insert-request/xsql:update-request/xsql:delete-request is through HTTP POST/GET. It doesn't seem that it's possible to embed the XML directly in the page, nor does it seem possible to handle more than one XML.
    I'm trying to achieve something like this:
    <?xml version="1.0"?>
    <page connection="scott" xmlns:xsql="urn:oracle-xsq">
    <xsql:insert-request table="DEPT">
    <ROWSET>
    <ROW>
    <DEPTNO>-10</DEPTNO>
    <DNAME>NEW DEPT 1</DNAME>
    <LOC>COPENHAGEN</LOC>
    </ROW>
    <ROW>
    <DEPTNO>-20</DEPTNO>
    <DNAME>NEW DEPT 2</DNAME>
    <LOC>LONDON</LOC>
    </ROW>
    </ROWSET>
    </xsql:insert-request>
    <xsql:insert-request table="EMP">
    <ROWSET>
    <ROW>
    <EMPNO>-10</EMPNO>
    <ENAME>NEW EMP 1</ENAME>
    </ROW>
    <ROW>
    <EMPNO>-20</EMPNO>
    <ENAME>NEW EMP 2</ENAME>
    </ROW>
    </ROWSET>
    </xsql:insert-request>
    </page>
    or perhaps
    <?xml version="1.0"?>
    <page connection="scott" xmlns:xsql="urn:oracle-xsq">
    <request>
    <parameters>
    <dept>
    <ROWSET>
    <ROW>
    <DEPTNO>-10</DEPTNO>
    <DNAME>NEW DEPT 1</DNAME>
    <LOC>COPENHAGEN</LOC>
    </ROW>
    <ROW>
    <DEPTNO>-20</DEPTNO>
    <DNAME>NEW DEPT 2</DNAME>
    <LOC>LONDON</LOC>
    </ROW>
    </ROWSET>
    </dept>
    </parameters>
    </request>
    <xsql:insert-request table="DEPT" param="dept"/>
    <xsql:insert-request table="EMP" param="emp"/>
    </page>
    I need both INSERT/UPDATE/DELETE so xsql:insert-param isn't enough, would also need an xsql:update-param and xsql:delete-param.
    A way of referring to the canonical XML through an URI or XPath expression (referring to a registered XML document in the database) would also be cool.
    Perhaps implementing custom action handlers would work but not sure whether they'll be able to refer to any child XML elements within them? Furthermore, the syntax for these would also be slightly inconvenient:
    <xsql:action handler=com.ellebaek-consulting.xsql.InsertActionHandler" table="DEPT">
    My alternative would be to re-implement an extended version of XSQL (XSQLX :-)?) but I'm trying to avoid that.
    Any pointers and ideas are very much appreciated.
    Thanks in advance.
    Best regards
    Finn Ellebaek Nielsen

    Hi.
    Thanks for your reply but the article only talks about how to query data with XSQL and I need to INSERT/UPDATE/DELETE data embedded in XSQL pages into the database so I'm afraid that the article doesn't apply.
    Cheers
    Finn

  • XML parsing in Stored procedure

    Hi friends,
    PLease help to resove my issue mentioned below.
    I am tring to parse one large xml whic i am getting from calling a webservice.I am reading line by line from the request and storing into a clob variable.
    I convert it to xml type for some manipulation after that When i am trying to convert it back to Clob by using getClobVal() data is getting truncated.
    Please help how can i resolve this issue

    hI,
    i AM TRYING TO CALL A WEBSERVICE FROM MY ORACLE STORED PROCEDURE .tHE REQUEST IS LIKE
    soap_request:= '<soapenv:Envelope xmlns:soapenv="" xmlns:web="">
    <soapenv:Header/>
    <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="">
    <web:getEmpInfo>
    <Param>
    <WST/>
    <EmpId>'I am giving certain value here'</EmpId>
    <requestId/>
    </Param>
    </web:getEmpInfo>
    </soapenv:Body>
    </soapenv:Envelope>';
    http_req:= utl_http.begin_request
    ( 'Webservice URL'
    , 'POST'
    , 'HTTP/1.1'
    utl_http.set_header(http_req, 'Content-Type', 'text/xml'); -- since we are dealing with plain text in XML documents
    utl_http.set_header(http_req, 'Content-Length', length(soap_request));
    utl_http.set_header(http_req, 'SOAPAction', ''); -- required to specify this is a SOAP communication
    utl_http.write_text(http_req, soap_request);
    http_resp:= utl_http.get_response(http_req);
    utl_http.read_text(http_resp, soap_respond);// soap_request CLOB;
    // soap_respond CLOB;
    utl_http.end_response(http_resp);
    resp:= XMLType.createXML(soap_respond);// resp XMLType;
    My REsponse from webservice is in the following format
    <soapenv:Body><p663:getEmpInfoResponse xmlns:p663=""><getEmpInfoReturn><errorLevel>1</errorLevel>
    <returnMessage>.</returnMessage>
    <returnSet>My result is in here</returnSet>
    After that i am
    EXTRACTING the resp for getting result set
    Then to get canonical XML format(I mean with out any < or> symbols i am using
    respStr := resp.getClobVall();
    respStr := DBMS_XMLGEN.CONVERT(respStr,1);
    resp:= XMLType.createXML(respStr);
    parser := xmlparser.newParser;
    xmlparser.parseBuffer(parser, respStr);
    doc := xmlparser.getDocument(parser);
    xmlparser.freeParser(parser);
    The data is getting truncated when resp.getClobVall() is calling
    . So end tag missing error is coming while parsing.
    I am using 9i version oracle. XML that is returning from webservice is more that 80K
    Edited by: user9138090 on Feb 12, 2010 10:55 AM
    Edited by: user9138090 on Feb 12, 2010 11:16 AM
    Edited by: user9138090 on Feb 12, 2010 12:02 PM
    Edited by: user9138090 on Feb 12, 2010 12:03 PM

  • XML Document Insert fails : NULL is an invalid

    Hi,
    I am trying to inseert a valid Oracle Canonical XML document
    into my table . But i get the following error :
    2001-07-01 19:50:16,167 <ERROR>
    NULL is an invalid column name.</ERROR>
    The table definition is as follows :
    create or replace table Internal_Message_Impl (
    processId &ID_TYPE primary key,
    transactionHeader THeader_t,
    payloadCollection clob,
    manifest clob,
    messageHeader MessageHeader_t
    In my input XML document I have columns corresponding to the processId (primary
    key) and transactionHeader. But I don't any xml tags for the remaining columns.
    In the OracleSaveXML java API I am setting which columns should be inserted or
    updated :
    OracleXMLSave save = new OracleXMLSave(_conn, DB_TABLE_NAME);
    save.setIgnoreCase(true);
    // default Oracle Date format is 'MM/dd/yyyy HH:mm:ss' . See JDBC
    documentation on
    // java.text.SimpleDateFormat to get the list of valid date formats.
    // save.setDateFormat(java.lang.String mask);
    String[] columnNames = new String[3];
    columnNames[0] = IM_PRIMARY_KEY;
    columnNames[1] = TRANSACTION_HEADER_COLUMN_NAME;
    String[] keyColumnNames = new String[2];
    keyColumnNames[0] = IM_PRIMARY_KEY;
    save.setUpdateColumnList(columnNames);
    save.setKeyColumnList(keyColumnNames); // ignored in the case of insert and
    delete
    if(isNew()) {
    save.insertXML(oraXmlStr);
    } else {
    save.updateXML(oraXmlStr);
    Can somebody tell me whether this approach is o.k. ?
    Here is the xml document I am trying to insert :
    Oracle Canonical XML string for TransactionHeader :
    <?xml version="1.0" encoding="UTF-8"?>
    <ROWSET>
    <ROW>
    <processId>1</processId>
    <TransactionHeader>
    <process>
    <listId>-99</listId>
    <revisionId>-9</revisionId>
    <packetId>-9</packetId>
    </process>
    <providerId>10001</providerId>
    <serviceId>12</serviceId>
    <adapterId>-9</adapterId>
    <customerId>7</customerId>
    <transactionElement>
    <name/>
    <value>1</value>
    </transactionElement>
    <transactionKind>
    <tKind>
    <value>-9</value>
    <name/>
    </tKind>
    <subKind>
    <value>-9</value>
    <name/>
    </subKind>
    </transactionKind>
    <state>
    <code>
    <value>-9</value>
    <name/>
    </code>
    <subCode>
    <value>-9</value>
    <name/>
    </subCode>
    <value/>
    </state>
    <trackingNumber>7UDZED</trackingNumber>
    <controllerNumber/>
    <completionTime>2001-07-08T19:50:05</completionTime>
    <creationTime>2001-07-04T19:50:05</creationTime>
    </TransactionHeader>
    </ROW>
    </ROWSET>
    Appreciate any responses for this problem.
    Thanks
    Mahesh
    null

    Hallo,
    I have same problem but all parameters seems ok...
    <Table> is an invalid table element or appears in the wrong order.
    <variant>
      <Table xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0" xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" aid5:tablestyle="Art.-Table" aid:table="table" aid:trows="64" aid:tcols="7">
        <cell aid5:cellstyle="Art.-Cell" aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="58">
    I am using Indesign CC 2014

  • Using REGEXP_REPLACE to remove XML data from between XML tags

    Hello there,
    I am trying to use the REGEXP_REPLACE SQL function on a piece of XML, to remove the actual XML data from the elements. My end goal is to end up with a comma-delimited list of XML element names. As part of the first step, I just want to rip out all the actual data.
    I tested the following query, and it initially appeared to work:
    SELECT REGEXP_REPLACE('&gt;THIS IS A TEST&lt;',
                          '&gt;([[:alnum:]]\s|\S)*&lt;',
                          '&gt;&lt;' ) AS test_result
      FROM dual;Unfortunately, when I applied this to a full XML string, it didn't work. Here is the test query I used:
    SELECT REGEXP_REPLACE('&lt;ROW&gt;&lt;TEST_ELEMENT1&gt;123&lt;/TEST_ELEMENT1&gt;&lt;TEST_ELEMENT2&gt;THIS IS A TEST!&lt;/TEST_ELEMENT2&gt;&lt;/ROW&gt;',
                          '&gt;([[:alnum:]]\s|\S)*&lt;',
                          '&gt;&lt;') AS test_result
      FROM dual;I ended up with the following output:
    *&lt;ROW&gt;&lt;/ROW&gt;*
    What I was trying for was:
    *&lt;ROW&gt;&lt;TEST_ELEMENT1&gt;&lt;/TEST_ELEMENT1&gt;&lt;TEST_ELEMENT2&gt;&lt;/TEST_ELEMENT2&gt;&lt;/ROW&gt;*
    If you're reading this and you're a Posix RegExp Guru, please could you let me know exactly where I'm going wrong? RegExps are not my strong point, but I'd like to get better at them.

    jmcnaug2 wrote:
    Just out of interest, how would you go about writing the XQuery function so that it returns the actual XML Element values in comma-delimited form (This is Oracle Canonical XML, so has a very basic layout)? ;)Do you mean like this ?
    SQL> SELECT xmlquery(
      2    'for $i in $d/ROWSET/ROW
      3     return string-join($i/*, ",")'
      4    passing dbms_xmlgen.getXMLType('SELECT employee_id, last_name, first_name FROM employees WHERE rownum < 10') as "d"
      5    returning content
      6  ).getClobVal() as csv
      7  FROM dual;
    CSV
    100,King,Steven
    101,Kochhar,Neena
    102,De Haan,Lex
    103,Hunold,Alexander
    104,Ernst,Bruce
    105,Austin,David
    106,Pataballa,Valli
    107,Lorentz,Diana
    108,Greenberg,Nancy
    SQL>

  • Inserting XML files with attribute and frontslash(/) in database

    Hi,
    I want to get and insert the data from XML file into database. Below is the XML file:
    <bne:document xmlns:bne="http://www.oracle.com/bne" bne:apiVersion="1.0">
         <bne:workspace>
              <bne:layout id="242:AMW_PROC_UPLOAD">
                   <header><line/>
                   </header>
              </bne:layout>
         </bne:workspace>
         <bne:collection id="collection_1">
              <bne:data bne:id="data_1" bne:integrator="242:AMW_PROCESS_IMPORT_INTG" bne:layout="242:AMW_PROC_UPLOAD" bne:date_format="yyyy-MM-dd" bne:validation="full" bne:recreate="TRUE" bne:columns_mapped="FALSE" bne:nls_numeric_characters=".,">
                   <header AMW_PROCESSES_INTERFACE.HEADER_PARENT_PROCESS_ID="All Processes">
                   <line bne:IDX="1"
    AMW_PROCESSES_INTERFACE.PROCESS_DISPLAY_NAME="Process test 1" AMW_PROCESSES_INTERFACE.SIGNIFICANT_PROCESS_FLAG="Yes"
    AMW_PROCESSES_INTERFACE.REVISE_PROCESS_FLAG="N"
    AMW_PROCESSES_INTERFACE.PROCESS_CATEGORY="Routine"
    AMW_PROCESSES_INTERFACE.APPROVAL_STATUS="Approved"
    AMW_PROCESSES_INTERFACE.STANDARD_PROCESS_FLAG="Yes"
    AMW_PROCESSES_INTERFACE.PROCESS_OWNER_ID=""
    AMW_PROCESSES_INTERFACE.FINANCE_OWNER_ID=""
    AMW_PROCESSES_INTERFACE.APPLICATION_OWNER_ID=""
    AMW_PROCESSES_INTERFACE.PARENT_PROCESS_NAME=""/>
                   </header>
              </bne:data>
         </bne:collection>
    </bne:document>
    and the table structure is:
    12:53:58 SQL> desc bne
    Name Null? Type
    HEADER_PARENT_PROCESS_ID VARCHAR2(80)
    PROCESS_DISPLAY_NAME VARCHAR2(80)
    SIGNIFICANT_PROCESS_FLAG VARCHAR2(3)
    REVISE_PROCESS_FLAG VARCHAR2(1)
    PROCESS_CATEGORY VARCHAR2(30)
    APPROVAL_STATUS VARCHAR2(30)
    STANDARD_PROCESS_FLAG VARCHAR2(3)
    PROCESS_OWNER_ID VARCHAR2(80)
    FINANCE_OWNER_ID VARCHAR2(80)
    APPLICATION_OWNER_ID VARCHAR2(80)
    PARENT_PROCESS_NAME VARCHAR2(80)
    So I want specific attribute values to be inserted into this table. I know the way to insert the simple XML document into database by using DBMS_XMLSave methods, but in this case I need to extract specific attribute values. I have learned that in order to use XML SQL Utility to "auto-load" XML into relational tables, I have to transform this XML file into Oracle's "canonical XML format" perhaps by using XSLT, not sure.
    Can someone please advise the correct way to accomplish above thing.
    Thanks in Advance.
    Manoj

    Great detective work. It's odd how that click-to-call extension creates such random issues...

  • XML schema in ABAP

    can you give me resources and example programs to create
    XML schema in abap

    Hi,
    The real question is: qhat Shema do you want to build.
    To do that, you have learn about XML schema. Then You can create you schema and for that there are several Methods:
    - Create the schema Nodes and piece them together into an XML document. An XML Schema Document is just a special type of XML document, so you have to create the correct nodes and put them together into an XML document.
    For that you have the IXML library. It is well documented in Help.sap.com and all relevant interface names start with "IF_IXML_"
    Just search for it.
    There is a class called CL_XML_DOCUMENT_BASE from the workflow group which wraps some things up and simplifies the creation and rendering (=conversion into text) of XML documents.
    I don't know if that class is released for general use.
    - Use XSLT (CALL TRANSFORMATION), if you have a XML-Document to start from, that contains all information which allows you to Transform any XML format into a different XML format.
    - If you have Dictionary Structures as your basis then the somewhat old function module SDIXML_DOM_TO_ABAP can create a Schema fragment for your data structure. Just search for its usage to get examples and play around with the parameters.
    The format is Itendtical to the "canonical XML format" of SAP, also known as ASXML.
    You can create it with CALL TRANSFORMATION ID ... <-- the name is important.
    More information about this format and how to create and use it you can find in an article called "From XML to ABAP and back again". This article is available on SDN, just search for it.
    All of this stuff exists only since 6.10 and later. But there has been XSLT-Support earlier with some ABAP classes, before CALL TRANSFORMATION entered into ABAP with 6.10.
    Also there are some other SDIXML_* function modules, in case you use an old module, but it's better to use the IXML-Library, wherever possible, if your release should be current enough.
    Cheers
    Christian

  • Change exported XML from a report

    Hello,
    I need to export a XML from a report button with this structure:
    <LOTE CONTABLE>
    <CONFIG />
    <LOTE>LOTE</LOTE>
    <LINEAS>
    <LINEA>
    <FAC_CODI>1</FAC_CODI>
    <EFDESC>F/pruebass N 1</EFDESC>
    <EFTYPENT>P</EFTYPENT>
    <EFCOMPTE>960</EFCOMPTE>
    </LINEA>
    </LINEAS>
    I have a report with all the columns that I need. I have created a Report Queries (from Shared Components) to generate a XML with the same sql as the report but the XML that APEX generates by default has this structure:
    <ROWSET>
    <ROW>
    <FAC_CODI>1</FAC_CODI>
    <EFDESC>F/pruebass N 1</EFDESC>
    <EFTYPENT>P</EFTYPENT>
    <EFCOMPTE>960</EFCOMPTE>
    </ROW>
    </ROWSET>
    How can I change this structure? I want to add a header and replace "rowset" and "row" to "lineas" and "linea". Is it possible?
    Thank you very much in advance.
    Kind regards,
    Amparo

    >
    The issue is that in the following code, I've replaced this line:
    qryCtx := dbms_xmlgen.newContext('select hash_value from hash');
    with this line:
    qryCtx := dbms_xmlgen.newContext(V_Return);
    I did this because the value that I want to be in XML is in the variable V_Return and not in a table. I get a compilation error:
    PLS-00382: expression is of wrong typeCompilation failed
    Is there a way to use newContext with a variable value rather than a select statement from a table?
    >
    It seems unlikely. The DBMS_XMLGEN documentation says:
    >
    The DBMS_XMLGEN package converts the results of a SQL query to a canonical XML format. The package takes an arbitrary SQL query as input, converts it to XML format, and returns the result as a CLOB.
    >
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10577/d_xmlgen.htm#i1012053
    If <tt>VReturn</tt> is not a SQL query then you will need to use one of the (many) other ways of generating XML. This question has nothing to do with APEX and would be better addressed to the XML DB.
    Additionally, the recommended methods for XML generation, encryption and hashing are heavily version-dependent and you should always quote the relevant DB version/edition information to ensure an appropriate answer. For example, DBMS_OBFUSCATION_TOOLKIT is deprecated as of Oracle 10g and replaced by DBMS_CRYPTO.

  • Crossgate Canonical Structure

    Hello Experts,
    Can you please clarify a query regarding Crossgate Canonical XML structure.
    As per documentation available on internet
    "Crossgate has standardized their processes into one canonical form for each transaction type"
    we are currently dealing with EDIFACT messages and have a canonical XML structure for each message type ,e.g. for ORDERS
    If we switch to some other EDI standard, say, ANSI X12, will this canonical XML structure for ANSI X12 ORDERS will remain the same or do we have different canonical XML structures for ANSI X12.
    Basically, what would be the changes in mapping for an existing customer when we switch from EDIFACT to ANSI X12?
    Thanks a lot!
    Best Regards,
    Shweta

    Hello Raja,
    Thanks for the reply.I too think the same because the qualifiers used in mapping instruction for EDIFACT Orders seem to be specific to EDIFACT syntax.
    But then what is the advantage of having a canonical XML which would change for different EDI standard and hence would force PI mapping to be changed ?
    Is this fact documented somewhere?
    Thanks and best regards,
    Shweta

  • Non-canonical format

    I am working on a non-canonical xml document, which needs to be moved to the database, does any one know any work arounds to move the non-canonical xml to the database.

    Can you provide more information. What does the document look like, is it associated with an XML Schema, if not can you generate an XML Schema describing the document, what do want to do with the document once it is loaded into the database.

  • Creating XML from Relational Tables using java

    I would like to create an XML document by querying relational tables in java
    try {
            connection = getConnection();
            final String qryStr = "select XMLElement( foo, 'bar' ) from dual";
            final OracleXMLQuery qry = new OracleXMLQuery(connection, qryStr);
            final String xmlString = qry.getXMLString();
    I would expect this to give the following result that I get from running the statement in SQL Developer
    select XMLElement( foo, 'bar' ) from dual
    <FOO>bar</FOO>
    Instead I get
    <?xml version = '1.0'?>
    <ERROR>oracle.xml.sql.OracleXMLSQLException: Character ')' is not allowed in an XML tag name.</ERROR>
    Is this the correct way to go about this?

    Is this the correct way to go about this?
    Not really.
    OracleXMLQuery class is the Java-side implementation of DBMS_XMLQUERY APIs.
    It's mostly designed to generate a canonical XML document out of a SQL query.
    Assuming a query like "SELECT col1, col2 FROM my_table", the resulting XML should appear like this :
    <ROWSET>
      <ROW>
        <COL1>123</COL1>
        <COL2>ABC</COL2>
      </ROW>
      <ROW>
        <COL1>456</COL1>
        <COL2>XYZ</COL2>
      </ROW>
    </ROWSET>
    So in your test, since the resulting column is not aliased (XMLElement), you're actually trying to generate something like this :
    <ROWSET>
      <ROW>
        <XMLELEMENT(FOO,'BAR')>
          <FOO>bar</FOO>
        </XMLELEMENT(FOO,'BAR')>
      </ROW>
    <ROWSET>
    which of course is invalid, hence the error message.
    If you want to generate only <FOO>bar</FOO> as output, just use a regular PreparedStatement with your query and access the document in the ResultSet with the proper getter.

  • XML from a procedure

    Hello,
    I am trying to pass a value in XML from a procedure to another (non-apex) application.
    The issue is that in the following code, I've replaced this line:
    qryCtx := dbms_xmlgen.newContext('select hash_value from hash');
    with this line:
    qryCtx := dbms_xmlgen.newContext(V_Return);
    I did this because the value that I want to be in XML is in the variable V_Return and not in a table. I get a compilation error:
    PLS-00382: expression is of wrong typeCompilation failed
    Is there a way to use newContext with a variable value rather than a select statement from a table?
    Thank you for any help!
    Matt
    create or replace PROCEDURE DO_HASH2 (p_username in VARCHAR2, p_app_id in VARCHAR2, p_app_name in VARCHAR2) is
      v_pad_amt NUMBER;
      v_salt RAW( 2048 );
      v_encrypted_str RAW( 2048 );
      v_return VARCHAR2( 255 );
      p_str VARCHAR2(255);
      p_thing_to_hash VARCHAR2(255);
      v_hash_date TIMESTAMP;
      qryCtx DBMS_XMLGEN.ctxHandle;
      result CLOB;
      nextval NUMBER;
    Begin
    p_thing_to_hash := p_app_name;
      -- Create Salt
      V_Salt := Utl_Raw.Cast_To_Raw( Substr( To_Char( Sqrt(( 8438/12*4-7/256 ) ) ), 3, 38 ) );
        -- If p_thing_to_hash is not null then
        -- Pad the string so that it will encrypt properly
        IF LENGTH( p_thing_to_hash ) MOD 8 > 0 THEN
            v_pad_amt        := TRUNC( LENGTH( p_thing_to_hash ) / 8 ) + 1;
            p_str  := RPAD(p_thing_to_hash, v_pad_amt * 8, '^' );
        END IF;
        -- Encrypt the string
        Dbms_Obfuscation_Toolkit.Desencrypt(Input => Utl_Raw.Cast_To_Raw( p_str ), Key => V_Salt, Encrypted_Data => V_Encrypted_Str );
        -- Now change the raw to hex
        V_Return := Rawtohex( V_Encrypted_Str );
    --qryCtx := dbms_xmlgen.newContext('select hash_value from hash');
    qryCtx := dbms_xmlgen.newContext(V_Return);
      -- set the row header to be HASH
      DBMS_XMLGEN.setRowTag(qryCtx, 'HASH');
      -- now get the result
      result := DBMS_XMLGEN.getXML(qryCtx);
    -- Set the timestamp
    select localtimestamp into v_hash_date from dual;
    -- Insert the user info into the HASH table
    INSERT INTO hash(USERNAME,APP_ID,APP_NAME,HASH_VALUE,HASH_DATE,RESULT) VALUES (p_username, p_app_id,p_app_name,V_Return,v_hash_date,result);
      --close context
    DBMS_XMLGEN.closeContext(qryCtx);
    END DO_HASH2;
    HASH Table structure:
    Column Name     Data Type
    ID     NUMBER
    USERNAME     VARCHAR2(250)
    APP_ID     VARCHAR2(250)
    APP_NAME     VARCHAR2(250)
    HASH_VALUE     VARCHAR2(250)
    HASH_DATE     TIMESTAMP(6)
    RESULT     CLOB

    >
    The issue is that in the following code, I've replaced this line:
    qryCtx := dbms_xmlgen.newContext('select hash_value from hash');
    with this line:
    qryCtx := dbms_xmlgen.newContext(V_Return);
    I did this because the value that I want to be in XML is in the variable V_Return and not in a table. I get a compilation error:
    PLS-00382: expression is of wrong typeCompilation failed
    Is there a way to use newContext with a variable value rather than a select statement from a table?
    >
    It seems unlikely. The DBMS_XMLGEN documentation says:
    >
    The DBMS_XMLGEN package converts the results of a SQL query to a canonical XML format. The package takes an arbitrary SQL query as input, converts it to XML format, and returns the result as a CLOB.
    >
    http://download.oracle.com/docs/cd/E11882_01/appdev.112/e10577/d_xmlgen.htm#i1012053
    If <tt>VReturn</tt> is not a SQL query then you will need to use one of the (many) other ways of generating XML. This question has nothing to do with APEX and would be better addressed to the XML DB.
    Additionally, the recommended methods for XML generation, encryption and hashing are heavily version-dependent and you should always quote the relevant DB version/edition information to ensure an appropriate answer. For example, DBMS_OBFUSCATION_TOOLKIT is deprecated as of Oracle 10g and replaced by DBMS_CRYPTO.

Maybe you are looking for

  • HELP! Second time...Some attributes of one or more of the files.

    I allready post this question in the morning, but got no answer. I want to know if someone have had this problem before. Maibe I didn't explain myself well, please let me know if you understand what is the problem I am having. I really need to sove t

  • SAP ABAP Proxy - recursive data structure problem

    Hi, For our customer we try to bind SAP with GW Calendar using GW Web Services. We tried to generate ABAP Proxy from groupwise.wsdl file but there are problems: GW uses recursive data structures what ABAP Proxy can not use. Is there any simple soluti

  • Firefox doesn't download files using Download Helper

    When I use the "add-on" Download Helper icon to select a video file (FLV) for download, I'm asked which folder it should go into (as usual). But when I click "Download," the file never appears to start downloading. The number in parentheses next to t

  • Connect older vhs to 50L1350U

    I recently purchased a 50L1350U and I'm having trouble watching vhs tapes using an older (10+/- years) dvd/vhs player, SONY slvd530P. I found another thread that refers specifically to different devices, but it may give a hint to my problem: http://f

  • FBWE Posting

    Hi, My problem is  that in transaction FBWE when i select different bills of exchange and finally post them what i want to do is post those bills of exchange to a different bank account. Let me explain myself better: First i enter FBWE and choose the