XML document lack of implementation in the form after adding the node

Hi all

I'm adding a new node to my XML document using java.

After I add, when I print the doc, I can see the xml code is not properly 'indexed' or 'formatted' (with a step internal node within the parent node.)

I have put OutputKeys.INDEX that Yes. But I still have this problem.


Kindlly help me regarding this.


Thank you
Sabarisri. N

After I add, when I print the doc, I can see that xml is not properly "indexed" (sic, "indented") or 'formatted' (with a step internal node within the parent node.)

It is indeed a common place of what to get. Rarely these whitespace contravene semantic aspects of xml, but it's annoying to the human eye. The OutputKeys.INDENT on the transformer fixing certainly wouldn't heal and makes it worse.

If the lack of alignment gets enough wide, sometimes I use a custom xsl file to put an order of it. This is how the xsl looks like: it is just a slight development of an identity transformation. And I assume you are using jdk1.5 + packaged xerces and xalan.






    
        
    


    


Suppose to be called indenter.xsl, and put themselves in the working directory. Printing to a file may seem just that.

TransformerFactory tf = TransformerFactory.newInstance();
Transformer t = tf.newTransformer(new StreamSource("indenter.xsl"));
//suppose the doc is the document parsed and edited in the memory, and outfile is the path to output file
t.transform(new DOMSource(doc), new StreamResult(new FileOutputStream(outfile)));

I use xalan namespace to control the amount of space to indent. If you don't use of xalan, just leave these namespace declaration and the xalan:indent - amounted to and let the xsl processor using its default value.

If you prefer instead of writing your own small xsl utilities, you can maybe google (mainly in using key as pretty print or a utility called htmltidy with w3c) to clean the misaligned output. Or check the documentation on the xsl processor used, some processor could have custom method to do the same.

But cleaning may still run the risk of too interpret what can hold and is not. It is important to know what you finally want what to do and adjust according to your need.

Published by: tsuji on Sep 21, 2011 07:57

Tags: Oracle Development

Similar Questions

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

  • Convert flat file to XML document and store it in the Oracle database

    First of all:
    I have a flatfile and created an external table to read this file in Oracle
    Now, I want to create an XML document for each line and insert in the Oracle database, I think as XMLtype.
    Could you please give me some information/steps.

    Second:
    Are there performance issues, because every day, I need to check that the XML document stored in the database against the next file.
    Thank you.

    I won't tell it not in the same words that Marco used, but your solution is impassable and an invitation for bad things to happen.

    Wait miserable performance, and you will not be disappointed.

    The concept of total flexibility works up a code that you depend on has no idea what to do with what is playback.
    Will happen to enough short term and is roughly the equivalent of the absurdity of Java to be independent of the database.

    I would recommend you take the concept and consider, with your data volumes, something more likely to succeed.

  • Problem with parsing XML with html as part of the node content

    Hi all

    I am facing problem with XML parsin when the node has a HTML content, if the node does not have any html content then it works fine. Similar analysis logic works for Java Standard, but not for the Blackberry API. I have an obligation to remove not HTML content prior to analysis. As that would display in the browser.

                              String xml="" +
                    "<p> Dummy content </p> " +
                    "" +
                    "";
                              DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
                DocumentBuilder dBuilder;
                Document doc;
                bis = new ByteArrayInputStream(xml.getBytes("UTF-8")); 
    
                dBuilder = dbFactory.newDocumentBuilder();
    
                doc = dBuilder.parse(bis);
                doc.getDocumentElement().normalize();
    
                NodeList nList = doc.getElementsByTagName("disclaimer");
    
                Element activeTagElmnt = (Element) nList.item(0);
                NodeList activeTag = activeTagElmnt.getChildNodes(); 
    
                tagValue=((Node) activeTag.item(0)).getNodeValue();
                              System.out.println(tagValue); //This prints "<" with HTML content. If i remove HTML then "Dummy Content" is printed
    

    If I need to remove html content, then I would need to reformat the content according to the HTML as the newline to a linebreak.

    Any suggestions would be helpful.

    Thank you

    Sandeep

    I feel xml parser was mature enough to handle these characters if sills, you get the error explore CDATA. It might help you.

  • How to change the value of string clustered, to implement using the node value of property instead of writing directly on the flow of data or using the variable

    new to labview :-) and I have a problem when I want to change the value of a string in bunches, and I want to implement this using the node value of property instead of writing directly to the stream or by using the variable, enclosed is the picture.   No matter, I have change in cluster (control) or value of Popery out (indicator) cluster, the value (sensor 7) dataflow keeps unchanged even I gave the new value by value of property node. Thank you to give me some advice about this.

    Hi GerdW

    Thanks a lot for your answer. The reason I'm stubbornly tring to break the flow of DATA is: we have a test system that have about 100 screws, they have a few connected flow, some of them will be unbundling a cluster dataflow chain to check the value in order to make the different cases.  Now I want to insert user event by changing the control and influential cases during run time.

    As I initially uses a global variable (to control cases) instead of unbundle string data flow, it works well.  But then, I found there are a lot of screws that are using the string unbundle.  One of the 'lazy' means, I tried is to change the value via the property node (because that way, I did not need to find all the places where using the unbundle string and replace them with the global variable), then I noticed a problem with "dataflow", the value in the stream of cluster in fact will not be changed by changing the value of the property node.

    I did a test with VI simple (like the picture in last post), and after reading your advice, I tell myself that I need to understand the concept of "DATAFLOW" in labview, it seems that my "lazy" way can not work in this scenario.

    I have attached the criterion VI here, have you furthur suggestions on what I can do in this case?

    Mant thanks!

    Minyi

  • Get error FRM-92101 after adding a node of the Web to an existing Instance.

    Hello

    I added a node of the web to R12 existing EBS who already have a node of the Web. After I added the node, I get the error FRM-92101 while opening one of the nodes in the web forms. Before adding the new web level there is no problem with the forms. I ran the new autoconfig from all nodes again but the problem is still there. I am able to open the login page of two nodes, but only the question is coming with the forms. Am I missing somethig? Any suggestion please.


    Thank you

    Shashi.

    Hello

    Now that I've added the node of the Web 2 Finally using auto clone and adadnode.pl scripts. Therefore all URLs accessing EBS of browser web are to redirect to the Web node 2, no matter if I have access to the application of Web node 1 or Web 2.

    Did you run the AutoConfig successfully on both nodes?

    Seems something must be corrected in the context file or the database for other FND tables. I don't know why it's happening. Please help me.

    I still wonder why you have not enabled the file application.log until now. So, please report it the full error log here.

    Thank you
    Hussein

  • TextScrap lack of implementation in the form

    With the latest weekly version, we need spending:

    var textScrap:TextScrap = textFlow.interactionManager.createTextScrap ();
    var sTxt:String is String (TextFilter.export (textScrap.textFlow, TextFilter.TEXT_LAYOUT_FORMAT, ConversionType.STRING_TYPE));.

    TO:
    var textScrap:TextScrap = TextScrap.createTextScrap (textFlow.interactionManager.getSelectionState ());
    var newTextFlow:TextFlow = new TextFlow();
    newTextFlow.interactionManager = new EditManager();
    EditManager (newTextFlow.interactionManager) .pasteTextScrap (textScrap, new SelectionState (newTextFlow, 0, 0));
    var sTxt:String is String (TextFilter.export (newTextFlow, TextFilter.TEXT_LAYOUT_FORMAT, ConversionType.STRING_TYPE));.

    However, now my formatting is missing (fontFamily, textAlign, etc.).  What is the best way to complete the formatting of the selection to the TextScrap?

    Do you need a TextScrap at all? What happens if you did this:

    var textFlowCopy:TextFlow = textFlow.deepCopy (start, end);

    var sTxt:String is String (TextFilter.export (textFlowCopy, TextFilter.TEXT_LAYOUT_FORMAT, ConversionType.STRING_TYPE));.

  • Get HTML to an XML document and then by posting the code as HTML.

    If it is possible to do what my title says, is exactly how to do?

    I guess it goes like this

    Download the XML file

    It parse

    find HTML tags

    Shop HTML into something

    Open the browser window

    Use browser to display HTML - referenced file?

    Sounds just for me...

    A question:

    How can I get the XML parser to find the HTML tags?  Not DOM just pull as text and not attention that it is a tag?

    It's not exactly what we are doing, but it gives the same result.  Then you should be able to extract the CDATA for the html as a string element and use it to display in a BrowserField or a browser.

    Not sure if you understand the problems with browsers and BrowserField and various levels of release.  You would like to search in the forum for the various responses to the question:

    "How to display a string of html in the browser.

  • How to generate an xml document with a BLOB on the inside?

    Hello

    Using the Oracle 11 g Release 11.2.0.4.0 database, I actually use dbms_xmldom to generate xml data.

    When generated, it is sent using utl_http.

    All right, except that I have to include a child that contains a BLOB (stored in the database) in the exact way that it is stored in the XML structure.

    (Field value contains an encoded 64 base pdf file). Length of the file can be up to 2 MB

    My nearest solution was to Convert Oracle XML BLOB to type even if I'm really stuck with LPX-00210 error.

    Is there another way than dbms_xmldom do?

    In fact, I'm totally lost.

    Can you give me a hand on this or show me an example of work?

    Kind regards

    Stone

    Here goes...

    SQL> create table images (
      2    id       integer
      3  , name     varchar2(256)
      4  , content  blob
      5  );
    
    Table created
    
    SQL>
    SQL> declare
      2
      3    bf          bfile := bfilename('XML_DIR','base64.bin');
      4    lob_ptr     blob;
      5    dest_offs   integer := 1;
      6    src_offs    integer := 1;
      7
      8  begin
      9
    10    insert into images (id, name, content)
    11    values (1, 'Koala.jpg', empty_blob())
    12    returning content into lob_ptr;
    13
    14    dbms_lob.open(bf, dbms_lob.lob_readonly);
    15    dbms_lob.loadblobfromfile(lob_ptr, bf, dbms_lob.getlength(bf), dest_offs, src_offs);
    16    dbms_lob.close(bf);
    17
    18  end;
    19  /
    
    PL/SQL procedure successfully completed
    
    SQL> commit;
    
    Commit complete
    
    SQL>
    SQL> select id
      2       , name
      3       , utl_raw.cast_to_varchar2(dbms_lob.substr(content, 30)) as first_bytes
      4       , dbms_lob.getlength(content) as lob_size
      5  from images
      6  /
    
       ID NAME         FIRST_BYTES                      LOB_SIZE
    ----- ------------ -------------------------------- ----------
        1 Koala.jpg    /9j/4AAQSkZJRgABAgEAYABgAAD/7g      1068504
    
    SQL>
    SQL> declare
      2
      3    x_doc       xmltype;
      4    domdoc      dbms_xmldom.DOMDocument;
      5    domnode     dbms_xmldom.DOMNode;
      6    domtext     dbms_xmldom.DOMText;
      7    ostream     sys.utl_BinaryOutputStream;
      8    chunksize   pls_integer;
      9    offset      pls_integer := 1;
    10    buf         raw(32767);
    11    image       blob;
    12
    13  begin
    14
    15    select xmlelement("image",
    16             xmlelement("id", t.id)
    17           , xmlelement("name", t.name)
    18           , xmlelement("content")
    19           )
    20         , t.content
    21    into x_doc
    22       , image
    23    from images t
    24    where t.id = 1 ;
    25
    26    domdoc := dbms_xmldom.newDOMDocument(x_doc);
    27
    28    -- get /image/content node so that we can append a text node and stream the BLOB to it :
    29    domnode := dbms_xslprocessor.selectSingleNode(dbms_xmldom.makeNode(domdoc), '/image/content');
    30    domtext := dbms_xmldom.createTextNode(domdoc, null);
    31    domnode := dbms_xmldom.appendChild(domnode, dbms_xmldom.makeNode(domtext));
    32
    33    ostream := DBMS_XMLDOM.setNodeValueAsBinaryStream(domnode);
    34    chunksize := dbms_lob.getchunksize(image);
    35
    36    loop
    37      begin
    38        -- read BLOB in chunk of  :
    39        dbms_lob.read(image, chunksize, offset, buf);
    40      exception
    41        when no_data_found then
    42          exit;
    43      end;
    44      -- write chunk to DOM node :
    45      ostream.write(buf, chunksize);
    46      offset := offset + chunksize;
    47    end loop;
    48
    49    ostream.flush();
    50    ostream.close();
    51
    52    dbms_xmldom.writeToFile(domdoc, 'XML_DIR/image.xml');
    53    dbms_xmldom.freeDocument(domdoc);
    54
    55  end;
    56  /
    
    PL/SQL procedure successfully completed
    

    Image.xml release:

    
      1
      Koala.jpg
      /9j/4AAQSkZJRgABAgEAYABgAAD/7gAOQWRvYmUAZAAAAAAB/+EUI0V4aWYAAE1NACoAAAAIAAcB
    MgACAAAAFAAAAGIBOwACAAAABwAAAHZHRgADAAAAAQAEAABHSQADAAAAAQA/AACcnQABAAAADgAA
    AADqHAAHAAAH9AAAAACHaQAEAAAAAQAAAH0AAADnMjAwOTowMzoxMiAxMzo0ODoyOABDb3JiaXMA
    ...
    aWpkRY6dqaJY42qFjs8ZZ5nlkjZpmJUiJ1+ijn3dVeTtb4B1R5NJVaEkn/V8+u4Xijpp6SFlimp6
    qNHgjlVIgrtLCyxll1NpaT6An6W92mA8HwkyadMeEZJjEDmvE/t/1f5uv//Z
    
    
  • ANE ADT: lack of implementation of the platform: by default

    Hello

    I'm trying to update an old DONKEY in support of 64-bit (this one: appirater-ane - Appirater DONKEY - Google Project Hosting, which I moved here: appirater-Tawng/ane ·) GitHub). I got pretty far, but I'm running a mistake, now that I can't make any sense of.

    Here is the command I am running (of my git directory, where I have collected all these files):

    / Users/kevin/SDK/AIR17SDK/bin/adt - package - target ane Appirater.ane extension.xml CFC - appirater.swc - iPhone-ARM libAppirater - ANE .to library.swf platform

    My extensions.xml file looks like this:

    " < extension xmlns =" http://ns.Adobe.com/air/extension/3.4 ">

    com.palDeveloppers.ane.Appirater < id > < /ID >

    < versionNumber > 1 < / versionNumber >

    <>platforms

    < platform name 'iPhone-ARMS' = >

    < applicationDeployment >

    < nativeLibrary > libAppirater - ANE .to < / nativeLibrary >

    < initializer > AppiraterExtInitializer < / initializer >

    < finalizer > AppiraterExtFinalizer < / finalizer >

    < / applicationDeployment >

    < / platform >

    < platform name = "default" >

    < applicationDeployment / >

    < / platform >

    < / platforms >

    < / extension >

    As far as I know, I got any other building (xcode, CFC project, etc.), but I can't understand why he said on a 'default' platform, when I specified "iPhone-ARMS" in the world.

    Note: The original project has a build.xml file which might be easier to operate - but I don't know what it is and how to use it. Pointers are appreciated!

    Thank you

    Kevin N.

    The initial project uses Apache Ant to compile. Install Ant, editing the build.properties file, navigate to the folder that contains build.xml and type Ant on the command line.

    Or add the following line to the adt command:

    -platform default library.swf

  • ADT error: Lack of implementation of the platform: MacOS - x 86

    Hi, I tried to build ANE of the native extension of Hello World example, but I get this error ADT:

    "Application missing platform: Mac OS - x 86."

    What does that mean?

    I use Mac OS X 10.7.4, flash builder 4.6 and xcode 4.3.1

    Thank you.

    Hello J,

    This error appears when you have inserted a platform in the extension.xml but while packing the donkey, you missed it. The command that you use for packaging what DONKEY should look like:

    ADT-package - target ane x.ane - CFC - platform MacOS - x 86 library.swf

  • No data when querying XML document which does not have all the elements that are populated

    Hi people

    Following the previous post http://bit.ly/beyCdc forum, I met a new show that I'm looking to solve today.

    General information:

    The xml document, I try to shred them may exist in 2 forms; b limited form and (b) complex form, which
    to comply with the same xmlschema.

    The structure of the two forms of the document is:

    b limited version

    (1) under the parent node (of BASANTA) is a child node - RTDRFileHeader
    (2) also under the parent node is a node of complex "ConnectionList. This can consist of thousands of child nodes 'connection '.
    (3) below a given node of "Connection" are child nodes that are of interest, they are:
          
          Connection/HPMN
          Connection/VPM
          Connection/FileItemList/FileItem/FileType/InitTAP/TAPSeqNo
          Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TAPTxCutoffTmstp
          Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TAPAvailTmstp
          Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TAPCurrency
          Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TotalNetCharge
          Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TotalTax
    (b) extended version

    The structure of the Extended version is identical to the above limited version but there are elements of additional group under the /chargeInfo. element
    It's TrafficBreakdownList and AdditionalChargeInfo. In addition, the TrafficBreakdownList has child nodes that contain elements of the group.
    For example.
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/CallEventType
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/CallEventType/CallEventInfo/NumberOfEvents
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/CallEventType/CallEventInfo/TotNetCharge
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/CallEventType/CallEventInfo/TotTaxValue
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/InvPeriod
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/TotalNetChargeSDR
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/TotalTaxSDR
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/VPMNLocCurr
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/TotalNetChargeVLCSR
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/TotalNetChargeVLCCD
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/TotalTaxVLCCD
        Connection/FileItemList/FileItem/FileType/InitTAP/ChargeInfo/TrafficBreakdownList/TrafficBreakdownItem/AdditionalChargeInfo/TotalTaxVLCCD
    What I'm trying to achieve, if possible, is to have a SQL statement that can interrogate the two versions of the xml document. Currently
    the following SQL statement works properly against the extended version XML document, but when used against the limited version he returns no rows.

    I guess what I'm after is like a LEFT JOIN XML :-) If the node is not present, returns NULL for this element.

    b limited Version of XML
    <RTDR>
      <RTDRFileHeader>
        <Prefix>MRTDR</Prefix>
        <Sender>EDSCH</Sender>
        <Recipient>NXTMP</Recipient>
        <PMN>UKRAS</PMN>
        <ReportSeqNo>5</ReportSeqNo>
        <TADIGGenSchemaVersion>2.2</TADIGGenSchemaVersion>
        <RTDRSchemaVersion>1.1</RTDRSchemaVersion>
        <CreationTmstp>2009-09-04T04:04:00.000000+02:00</CreationTmstp>
      </RTDRFileHeader>
    <ConnectionList>
     <Connection>
          <VPMN>UKRAS</VPMN>
          <HPMN>LIEK9</HPMN>
          <FileItemList>
            <FileItem>
              <FileID>CDUKRASLIEK901274-00005-m</FileID>
              <ExchTmstp>2009-08-24T12:07:22.000000+02:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>1274</TAPSeqNo>
                  <NotifFileInd>true</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2009-08-24T12:52:10.000000+03:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2009-08-24T11:52:10.000000+02:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>0</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
            <FileItem>
              <FileID>CDUKRASLIEK901280-00005-m</FileID>
              <ExchTmstp>2009-08-30T12:14:39.000000+02:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>1280</TAPSeqNo>
                  <NotifFileInd>true</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2009-08-30T12:52:34.000000+03:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2009-08-30T11:52:34.000000+02:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>0</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
          </FileItemList>
        </Connection>
      <Connection>
          <VPMN>UKRZZ</VPMN>
          <HPMN>LIEZZ</HPMN>
          <FileItemList>
            <FileItem>
              <FileID>CDUKRZZLIEZZ01274-00005-m</FileID>
              <ExchTmstp>2009-08-24T12:07:22.000000+02:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>1274</TAPSeqNo>
                  <NotifFileInd>true</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2009-08-24T12:52:10.000000+03:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2009-08-24T11:52:10.000000+02:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>0</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
            <FileItem>
              <FileID>CDUKRZZLIEZZ01280-00005-m</FileID>
              <ExchTmstp>2009-08-30T12:14:39.000000+02:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>1280</TAPSeqNo>
                  <NotifFileInd>true</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2009-08-30T12:52:34.000000+03:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2009-08-30T11:52:34.000000+02:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>0</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
          </FileItemList>
        </Connection>
     </ConnectionList>
     </RTDR> '
    (b) extended version of XML
    <RTDR xmlns:tadig-gen="https://infocentre.gsm.org/TADIG-GEN" xmlns="https://infocentre.gsm.org/TADIG-RTDR">
      <RTDRFileHeader>
        <Prefix>DRTDR</Prefix>
        <Sender>EDSCH</Sender>
        <Recipient>NXTMP</Recipient>
        <PMN>AAAAA</PMN>
        <ReportSeqNo>1</ReportSeqNo>
        <TADIGGenSchemaVersion>2.2</TADIGGenSchemaVersion>
        <RTDRSchemaVersion>1.1</RTDRSchemaVersion>
        <CreationTmstp>2010-03-17T12:32:37.000000+01:00</CreationTmstp>
      </RTDRFileHeader>
      <ConnectionList>
        <Connection>
          <VPMN>AAAAA</VPMN>
          <HPMN>GRCCO</HPMN>
          <FileItemList>
            <FileItem>
              <FileID>CDAAAAAGRCCO04164-00001-d</FileID>
              <ExchTmstp>2010-03-16T00:30:27.000000+01:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>4164</TAPSeqNo>
                  <NotifFileInd>false</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2010-03-16T00:15:25.000000+01:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2010-03-16T00:15:25.000000+01:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>48.546</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                    <TrafficBreakdownList>
                      <TrafficBreakdownItem>
                        <CallEventType>CS MO</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>7</NumberOfEvents>
                          <TotNetCharge>11.16</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>CS MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>2</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>GPRS Calls</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>26</NumberOfEvents>
                          <TotNetCharge>37.35</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MO</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>1</NumberOfEvents>
                          <TotNetCharge>.036</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>3</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                    </TrafficBreakdownList>
                    <AdditionalChargeInfo>
                      <InvPeriod>2010-03</InvPeriod>
                      <TotalNetChargeSDR>48.546</TotalNetChargeSDR>
                      <TotalTaxSDR>0</TotalTaxSDR>
                      <VPMNLocCurr>EUR</VPMNLocCurr>
                      <TotalNetChargeVLCSR>54.687</TotalNetChargeVLCSR>
                      <TotalTaxVLCSR>0</TotalTaxVLCSR>
                      <TotalNetChargeVLCCD>54.216</TotalNetChargeVLCCD>
                      <TotalTaxVLCCD>0</TotalTaxVLCCD>
                    </AdditionalChargeInfo>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
            <FileItem>
              <FileID>CDAAAAAGRCCO04165-00001-d</FileID>
              <ExchTmstp>2010-03-16T09:27:15.000000+01:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>4165</TAPSeqNo>
                  <NotifFileInd>false</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2010-03-16T09:15:20.000000+01:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2010-03-16T09:15:20.000000+01:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>7.114</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                    <TrafficBreakdownList>
                      <TrafficBreakdownItem>
                        <CallEventType>CS MO</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>5</NumberOfEvents>
                          <TotNetCharge>4.985</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>CS MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>1</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>GPRS Calls</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>10</NumberOfEvents>
                          <TotNetCharge>2.057</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MO</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>2</NumberOfEvents>
                          <TotNetCharge>.072</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>6</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                    </TrafficBreakdownList>
                    <AdditionalChargeInfo>
                      <InvPeriod>2010-03</InvPeriod>
                      <TotalNetChargeSDR>7.114</TotalNetChargeSDR>
                      <TotalTaxSDR>0</TotalTaxSDR>
                      <VPMNLocCurr>EUR</VPMNLocCurr>
                      <TotalNetChargeVLCSR>8.014</TotalNetChargeVLCSR>
                      <TotalTaxVLCSR>0</TotalTaxVLCSR>
                      <TotalNetChargeVLCCD>7.959</TotalNetChargeVLCCD>
                      <TotalTaxVLCCD>0</TotalTaxVLCCD>
                    </AdditionalChargeInfo>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
            <FileItem>
              <FileID>CDAAAAAGRCCO04166-00001-d</FileID>
              <ExchTmstp>2010-03-16T14:28:43.000000+01:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>4166</TAPSeqNo>
                  <NotifFileInd>false</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2010-03-16T14:15:23.000000+01:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2010-03-16T14:15:23.000000+01:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>1.638</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                    <TrafficBreakdownList>
                      <TrafficBreakdownItem>
                        <CallEventType>CS MO</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>2</NumberOfEvents>
                          <TotNetCharge>1.458</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>CS MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>7</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MO</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>5</NumberOfEvents>
                          <TotNetCharge>.18</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>15</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                    </TrafficBreakdownList>
                    <AdditionalChargeInfo>
                      <InvPeriod>2010-03</InvPeriod>
                      <TotalNetChargeSDR>1.638</TotalNetChargeSDR>
                      <TotalTaxSDR>0</TotalTaxSDR>
                      <VPMNLocCurr>EUR</VPMNLocCurr>
                      <TotalNetChargeVLCSR>1.845</TotalNetChargeVLCSR>
                      <TotalTaxVLCSR>0</TotalTaxVLCSR>
                      <TotalNetChargeVLCCD>1.832</TotalNetChargeVLCCD>
                      <TotalTaxVLCCD>0</TotalTaxVLCCD>
                    </AdditionalChargeInfo>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
          </FileItemList>
        </Connection>
        <Connection>
          <VPMN>AAAAA</VPMN>
          <HPMN>GRCSH</HPMN>
          <FileItemList>
            <FileItem>
              <FileID>CDAAAAAGRCSH03283-00001-d</FileID>
              <ExchTmstp>2010-03-16T00:30:29.000000+01:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>3283</TAPSeqNo>
                  <NotifFileInd>false</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2010-03-16T00:15:25.000000+01:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2010-03-16T00:15:25.000000+01:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>0</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                    <TrafficBreakdownList>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>1</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                    </TrafficBreakdownList>
                    <AdditionalChargeInfo>
                      <InvPeriod>2010-03</InvPeriod>
                      <TotalNetChargeSDR>0</TotalNetChargeSDR>
                      <TotalTaxSDR>0</TotalTaxSDR>
                      <VPMNLocCurr>EUR</VPMNLocCurr>
                      <TotalNetChargeVLCSR>0</TotalNetChargeVLCSR>
                      <TotalTaxVLCSR>0</TotalTaxVLCSR>
                      <TotalNetChargeVLCCD>0</TotalNetChargeVLCCD>
                      <TotalTaxVLCCD>0</TotalTaxVLCCD>
                    </AdditionalChargeInfo>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
            <FileItem>
              <FileID>CDAAAAAGRCSH03284-00001-d</FileID>
              <ExchTmstp>2010-03-16T09:27:16.000000+01:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>3284</TAPSeqNo>
                  <NotifFileInd>false</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2010-03-16T09:15:20.000000+01:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2010-03-16T09:15:20.000000+01:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>.072</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                    <TrafficBreakdownList>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MO</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>2</NumberOfEvents>
                          <TotNetCharge>.072</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>2</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                    </TrafficBreakdownList>
                    <AdditionalChargeInfo>
                      <InvPeriod>2010-03</InvPeriod>
                      <TotalNetChargeSDR>.072</TotalNetChargeSDR>
                      <TotalTaxSDR>0</TotalTaxSDR>
                      <VPMNLocCurr>EUR</VPMNLocCurr>
                      <TotalNetChargeVLCSR>.081</TotalNetChargeVLCSR>
                      <TotalTaxVLCSR>0</TotalTaxVLCSR>
                      <TotalNetChargeVLCCD>.081</TotalNetChargeVLCCD>
                      <TotalTaxVLCCD>0</TotalTaxVLCCD>
                    </AdditionalChargeInfo>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
            <FileItem>
              <FileID>CDAAAAAGRCSH03285-00001-d</FileID>
              <ExchTmstp>2010-03-16T14:28:45.000000+01:00</ExchTmstp>
              <FileType>
                <InitTAP>
                  <TAPSeqNo>3285</TAPSeqNo>
                  <NotifFileInd>false</NotifFileInd>
                  <ChargeInfo>
                    <TAPTxCutoffTmstp>2010-03-16T14:15:24.000000+01:00</TAPTxCutoffTmstp>
                    <TAPAvailTmstp>2010-03-16T14:15:24.000000+01:00</TAPAvailTmstp>
                    <TAPCurrency>SDR</TAPCurrency>
                    <TotalNetCharge>0</TotalNetCharge>
                    <TotalTax>0</TotalTax>
                    <TrafficBreakdownList>
                      <TrafficBreakdownItem>
                        <CallEventType>SM-MT</CallEventType>
                        <CallEventInfo>
                          <NumberOfEvents>1</NumberOfEvents>
                          <TotNetCharge>0</TotNetCharge>
                          <TotTaxValue>0</TotTaxValue>
                        </CallEventInfo>
                      </TrafficBreakdownItem>
                    </TrafficBreakdownList>
                    <AdditionalChargeInfo>
                      <InvPeriod>2010-03</InvPeriod>
                      <TotalNetChargeSDR>0</TotalNetChargeSDR>
                      <TotalTaxSDR>0</TotalTaxSDR>
                      <VPMNLocCurr>EUR</VPMNLocCurr>
                      <TotalNetChargeVLCSR>0</TotalNetChargeVLCSR>
                      <TotalTaxVLCSR>0</TotalTaxVLCSR>
                      <TotalNetChargeVLCCD>0</TotalNetChargeVLCCD>
                      <TotalTaxVLCCD>0</TotalTaxVLCCD>
                    </AdditionalChargeInfo>
                  </ChargeInfo>
                </InitTAP>
              </FileType>
            </FileItem>
          </FileItemList>
        </Connection>
      </ConnectionList>
    </RTDR>’
    It's the query I want to be able to run against the two XML documents. As mentioned, this works very well against the complex XML but no result against the simple XML.
    SELECT
             rtd.rtdr_document_id
            ,rtd.filename
            ,EXTRACTVALUE(rtd.rtdr , '/RTDR/RTDRFileHeader/PMN' )                                      client_pmn
            ,connXML."VPMN"                                                                            vpmn
            ,connXML."HPMN"                                                                            hpmn
            ,fileXML."TAPSeqNo"                                                                        tap_seq_no
            ,chrgXML."TAPTxCutoffTmstp"                                                                tap_tx_cut_off_tmstp
            ,chrgXML."TAPAvailTmstp"                                                                   tap_avail_tmstp
            ,chrgXML."TAPCurrency"                                                                     tap_currency
            ,chrgXML."TotalNetCharge"                                                                  total_net_charge
            ,chrgXML."TotalTax"                                                                        total_tax
            ,traffXML."CallEventType"                                                                  call_event_type     
            ,callEvtXML."NumberOfEvents"                                                               number_of_events
            ,callEvtXML."TotNetCharge"                                                                 call_event_ttl_net_charge
            ,callEvtXML."TotTaxValue"                                                                  call_event_ttl_tax_value
    FROM     t   rtd
            ,XMLTABLE(
                      XMLNAMESPACES
                      (
                        DEFAULT 'https://infocentre.gsm.org/TADIG-RTDR'
                      ),
                      '/RTDR/ConnectionList/Connection'
                      PASSING  rtd.myXML
                      COLUMNS
                      "VPMN"       VARCHAR2(5)    PATH '/Connection/VPMN'
                     ,"HPMN"       VARCHAR2(5)    PATH '/Connection/HPMN'
                     ,"FileXML"    XMLTYPE        PATH '/Connection/FileItemList/FileItem/FileType/InitTAP'
                     )  connXML
           ,XMLTABLE(
                      XMLNAMESPACES
                      (
                        DEFAULT 'https://infocentre.gsm.org/TADIG-RTDR'
                      ),
                      '/InitTAP'
                      PASSING  connXML."FileXML"
                      COLUMNS
                      "TAPSeqNo"       VARCHAR2(50)   PATH '/InitTAP/TAPSeqNo'
                     ,"ChargeInfoXML"  XMLTYPE        PATH '/InitTAP/ChargeInfo'
                    )  fileXML
           ,XMLTABLE(
                      XMLNAMESPACES
                      (
                        DEFAULT 'https://infocentre.gsm.org/TADIG-RTDR'
                      ),
                     '/ChargeInfo'
                      PASSING  fileXML."ChargeInfoXML"
                      COLUMNS
                      "TAPTxCutoffTmstp"          VARCHAR2(30)     PATH '/ChargeInfo/TAPTxCutoffTmstp'
                     ,"TAPAvailTmstp"             VARCHAR2(30)     PATH '/ChargeInfo/TAPAvailTmstp'
                     ,"TAPCurrency"               VARCHAR2(30)     PATH '/ChargeInfo/TAPCurrency'
                     ,"TotalNetCharge"            NUMBER(22,5)     PATH '/ChargeInfo/TotalNetCharge'
                     ,"TotalTax"                  NUMBER(22,5)     PATH '/ChargeInfo/TotalTax'
                     ,"TrafficBreakdownListXML"   XMLTYPE          PATH 'TrafficBreakdownList/TrafficBreakdownItem'
                    )  chrgXML
           ,XMLTABLE(
                      XMLNAMESPACES
                      (
                        DEFAULT 'https://infocentre.gsm.org/TADIG-RTDR'
                      ),
                     '/TrafficBreakdownItem'
                      PASSING  chrgXML."TrafficBreakdownListXML"
                      COLUMNS
                      "CallEventType"             VARCHAR2(20)     PATH '/TrafficBreakdownItem/CallEventType'
                     ,"CallEventInfoXML"          XMLTYPE          PATH '/TrafficBreakdownItem/CallEventInfo'
                    )  traffXML
           ,XMLTABLE(
                      XMLNAMESPACES
                      (
                        DEFAULT 'https://infocentre.gsm.org/TADIG-RTDR'
                      ),
                     '/CallEventInfo'
                      PASSING  traffXML."CallEventInfoXML" 
                      COLUMNS
                      "NumberOfEvents"            NUMBER           PATH '/CallEventInfo/NumberOfEvents'
                     ,"TotNetCharge"              NUMBER           PATH '/CallEventInfo/TotNetCharge'
                     ,"TotTaxValue"               NUMBER           PATH '/CallEventInfo/TotTaxValue'
                    )   callEvtXML
    Thank you very much

    Kind regards

    Simon Gadd

    Hi Simon,.

    I guess what I'm after looks like a LEFT JOIN XML

    Exactly.

    Try to add a (+) after the last two XMLTABLEs operator:

    ...
           ,XMLTABLE(
                      XMLNAMESPACES
                      (
                        DEFAULT 'https://infocentre.gsm.org/TADIG-RTDR'
                      ),
                     '/TrafficBreakdownItem'
                      PASSING  chrgXML."TrafficBreakdownListXML"
                      COLUMNS
                      "CallEventType"             VARCHAR2(20)     PATH '/TrafficBreakdownItem/CallEventType'
                     ,"CallEventInfoXML"          XMLTYPE          PATH '/TrafficBreakdownItem/CallEventInfo'
                    ) (+)  traffXML
           ,XMLTABLE(
                      XMLNAMESPACES
                      (
                        DEFAULT 'https://infocentre.gsm.org/TADIG-RTDR'
                      ),
                     '/CallEventInfo'
                      PASSING  traffXML."CallEventInfoXML"
                      COLUMNS
                      "NumberOfEvents"            NUMBER           PATH '/CallEventInfo/NumberOfEvents'
                     ,"TotNetCharge"              NUMBER           PATH '/CallEventInfo/TotNetCharge'
                     ,"TotTaxValue"               NUMBER           PATH '/CallEventInfo/TotTaxValue'
                    ) (+)  callEvtXML
    

    HTH.

    PS: the declaration of namespaces does not appear in the 'limited' version, perhaps you simply forgotten in your sample? Could you confirm?

  • 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>
    
  • How to create an XML Document and convert it into a string? (send through wireless network)

    Hello

    I am now able to post data to a web server by using Blackberry JDE (medical use).

    Now, instead of display the plain text, I would like to send an XML file.

    I am able to do it using this code on a 'normal ': Java application

    import java. IO;
    Org.w3c.dom import. *;
    Import javax.xml.parsers. *;
    Javax.xml.transform import. *;
    Javax.xml.transform.dom import. *;
    Javax.xml.transform.stream import. *;

    public class {XML
    Public Shared Sub main (String [] args) {}
    try {}
    DocumentBuilderFactory plant = DocumentBuilderFactory.newInstance ();
    DocumentBuilder builder = factory.newDocumentBuilder ();
    Doc document = builder.newDocument ();
               
    Root element = doc.createElement ("root");
    doc.appendChild (root);
               
    Child element = doc.createElement ("child");
    child.setAttribute ("name", "value");
    root.appendChild (child);

    Add a text element to the child
    Text = doc.createTextNode ("text");
    child.appendChild (text);

    implement a transformer
    TRANSFAC TransformerFactory = TransformerFactory.newInstance ();
    Transformer trans = transfac.newTransformer ();
    trans.setOutputProperty (OutputKeys.OMIT_XML_DECLARATION, 'yes');
    trans.setOutputProperty (OutputKeys.INDENT, 'yes');

    create the string of the xml tree
    StringWriter sw = new StringWriter();
    StreamResult result = new StreamResult (sw);
    DOMSource source = new DOMSource (doc);
    TRANS. Transform (source, result);
    String xmlString = sw.toString ();
    System.out.println (xmlString);
    } catch (Exception e) {}
    make error management
    }
    }
    }

    However, on the Blackberry JDE, many functions is not recognized.

    I saw the class DocumentBuilderFactory (net.rim.device.api.xml.parsers.DocumentBuilderFactory), the DocumentBuilder (net.rim.device.api.xml.parsers.DocumentBuilder) class and the interface of Document in the docs of Blackberry Java (4.2.1).

    So, I'm able to create an XML Document... but I don't know how to convert to a string?

    How can I do this? The TransformerFactory class doesn't seem to exist... and I did not find an alternative yet.

    At the present time, here is the code I use to publish data:

    String coord = lat + ";" + LNG; post data
    con = (HttpConnection) Connector.open (url); Open the connection URL
    con.setRequestMethod (HttpConnection.POST); POST method
    con.setRequestProperty ("Content-Type", "application/x-www-formulaires-urlencoded");
    out = con.openOutputStream (); display the results in a stream
    out. Write (Coord.GetBytes ());

    responseCode = con.getResponseCode (); Send data and receive the response code
    If (responseCode! = HttpConnection.HTTP_OK) {}
    System.out.println ("HTTP STATUS CODE: 404"); error
    } else {}
    System.out.println ("HTTP STATUS CODE: 200"); successful
    }
    If (con! = null) con. Close; close the connection to the URL

    As mentioned, rather than display a string with a delimiter between each value (there will be a lot more than two values finally), I would like to publish an XML.  It will be more "elegant" and easier to parse by my code on the web server.

    Maybe I don't have to convert it to a string?

    In other words, how can I convert my XML Document to send it via the wireless network?

    Thanks for your help!

    TransformerFactory does not exist in the BlackBerry API.  As far as I can tell, you need to implement yourself.  You can do this by walking the DOM and the output of channels.  They have an example of the market of the DOM in the XMLDemo, but they view as fields, you just need to write strings.

  • Watched folder processing XML document

    Hello!

    We are trying to convert an Adobe Central documents above to Adobe LiveCycle. We are currently working on the process of work. We have one where we have created a watched folder. The process is expected to work with XML and produce an output document. The input variable must be of type 'Document' or 'XML '? I kept it in as long as 'Document' because the XML documents will be placed in the folder. After that I don't know how to retrieve the XML data in the document. Anyone have ideas on this?

    I appreciate it!

    Wendy

    Once you store the XML in the document variable

    You can use the value set stage to assign the XML document type

    Lets you know if have problems you doing this

Maybe you are looking for

  • Apple pays - refunds/correction

    Hi guys,. I have a scenario where I have several options to process the order. For example, application iOS, system of trade electronics website and Windows Desktop POS. All orders processed by iOS and e-commerce site application comes to Desktop POS

  • Satellite Pro A300-1NT - update of the BIOS has not

    Hi, I'm an island here can someone help me solve this problem without sending it to the workshop of maintenance if possible. I've just updated tempro informed me a bios update. I ran the update, but it froze completely the system (Vista). I waited 15

  • The multimedia touch panel on Satellite A500 buttons are not all workers

    Hello I recently bought a laptop computer (PSAR9A-02J001) A500 under Windows 7 (32-bit) Home Premium. Not all the albums multimedia touch panel buttons work. When the buttons are pressed, brands of laptop beep (which is normal) but the corresponding

  • Device Manager cannot recognize Installed AMD Phenom II X 4 955

    Hello I have HP Pavilion a6560a Desktop and had 9850 AMD processor running Windows 7 Professional with SYSTEM 7.1 rating. I installed AMD Phenom II X 4 955 CPU but or the windows Device Manager recognize my CPU as 955, it reads with 803 Mhz AMD proce

  • Compaq: 73966231 system error

    How do I solve the problem