How to generate tags < a > < / a > < b > < / b > when no data for tag values?

We generate a huge XML. We broke it down to features. That is, elements are returned as of functions. Function is stored in a variable and use the variable in the select clause. A function is:

The FUNCTION RETURNS XMLTYPE IS f_ci_safetyforest1

v_tem_val NUMBER;

v_version VARCHAR (100);

v_rptid VARCHAR2 (100);

BEGIN

v_version: = get_pega_case_key (p_case_id, p_version = > TRUE);

v_rptid: = get_pega_case_key (p_case_id);

SELECT

XMLFOREST

(

v_version AS 'safetyreportversion '.

, v_rptid AS 'safetyreportid '.

)

IN double v_ret_val;

-IF v_rptid IS NULL THEN

--v_ret_val: = XMLTYPE ("< safetyreportversion > < / safetyreportversion > < safetyreportid > < / safetyreportid > '");

-END IF;

RETURN v_ret_val;

END;

Which is not the case is when v_rptid is null, that is, when there is no value for the id version or the State, we need to print 2 labels null. Now, if v_rptid is NULL, then we don't you tags in the output.

The code at the bottom, either - IF v_rptid IS NULL THEN..., gives an error when generating the XML.

Error is:

ORA-31011: XML parsing failed

ORA-19202: an error has occurred in the processing of XML

LPX-00245: additional data after the end of the document

Error on line 1

How to solve this riddle?  We have to split the 2 2 XMLELEMENTS?

Your expert advice would be greatly appreciated.

Which is not the case is when v_rptid is null, that is, when there is no value for the id version or the State, we need to print 2 labels null. Now, if v_rptid is NULL, then we don't you tags in the output.

Sigh...

As explained in your previous thread: XMLFOREST generates NULL tags. Need workaround or solution?

Why on earth you insist on using XMLForest when it clearly does not fit the requirement?

Just use XMLElement.

To expand on Jason's response on XML fragments, you can generate a fragment via the XMLPARSE function:

declare
  x   xmltype;
begin
  select xmlparse(content '')
  into x
  from dual;
end;
/

But it is not necessary if you use XMLElement in the first place:

select xmlconcat(
         xmlelement("a", v1)
       , xmlelement("b", v2)
       )
into x
from dual;

Tags: Oracle Development

Similar Questions

  • How to generate a public and private key when you use reCAPTCHA anti spam protection forms?

    Hello

    I designed my first website using muse for a customer. now, I want to insert a protection against spam reCAPTCHA. I followed the guide step by step from adobe, but when I want to log in to the google administration console, I'm stuck. can I use my login information to design companies that I have a business google account? and if so, where can I find the app because it does not appear on the console connection that I currently use.

    Help, please!

    Hello

    Please click the link below and login with google/Gmail code. you or your organization

    reCAPTCHA: easy on humans, hard on the Bots

    If you do not have a gmail id then just sign up on google.com or gmail.com.

    Concerning

    Vivek

  • How the message of Confirmation of the display when the data is stored in the DB?

    Hello.

    I'm persistence data entered by the user to the database table. But I want to display a custom as "Stored successfully" or "Unregistered" message

    I use same optics in my controller and AM impl

    of the PFR:
    ----------
    ' Public Sub processFormRequest (pageContext OAPageContext, OAWebBean webBean)
    {
    super.processFormRequest (pageContext, webBean);

    OAApplicationModule am = pageContext.getApplicationModule (webBean);

    am.invokeMethod ("insertDataToDeviceDetailsTable");


    }


    am Impl:
    ------------------

    public void insertDataToDeviceDetailsTable() {}

    getDBTransaction () .commit ();

    delegation of control to the details Page of the device



    }


    How to do? and also what is the best way to show messages in this scenario. As in some pages, a dialog box appears and the page become inactive.

    waiting for response...



    Kind regards
    Ajay

    Hello

    You can message pint after the am.invoke method:

    ' Public Sub processFormRequest (pageContext OAPageContext, OAWebBean webBean)
    {
    super.processFormRequest (pageContext, webBean);

    OAApplicationModule am = pageContext.getApplicationModule (webBean);
    am.invokeMethod ("insertDataToDeviceDetailsTable");
    throw new OAException ("successfully stored", OAException.INFORMATION);
    }

    am Impl:
    --------------------------------------------------------------------------------
    public void insertDataToDeviceDetailsTable() {}
    getDBTransaction () .commit ();
    }

    Sushant-

  • How can I ignore the differences between databases when reading data from a database?

    My boss wants me to create a text parser that analyzes the sentence below and executes a SQL query.

    "' get the table field1, field2, field3,..., Manyfield [where to SQL conditional statements].

    This corresponds to "select Field1, Field2, field3,..., table Manyfield where blahblah".

    Since different DBMS have different timestamp formats, this sentence should be changed for each DBMS.

    Ignore the differences is to do anlayzer that converts a certain type of timestamp string to one that adapts to each DBMS complex a text.

    But it seems ridiculous to adopt this solution when there might be an elegant solution.

    LabVIEW Toolkit of DB is not able to hide the differences.

    Does anyone have a better idea that I do?

    I remember having a problem like this when you are working with an older version of an Oracle server. I was able to change the session by setting the 'NLS_TIMESTAMP_FORMAT '.

    This page might be of interest; I found this, when searching for "NLS_TIMESTAMP_FORMAT".

    Database portability: Date and Timestamp columns

    (PS String Format and channel Scan functions work well with the correct date format specifiers. See the link below in my signature for the ISO 8601 timestamp/string conversions)

  • How to update HP support assistant in Vista when he says for windows 7 only

    I have some errors that the system can be solved if I upgrade the HP Support Assistant.  When I click on the link for the upgrade, download instructions that it is for Windows 7 only.  I have the camera software on my system which does not work on 7 and that is why I have not changed.  Is there another way to update from HP on Vista

    Hello

    you get the updates from HP and HP's HP program upgrades

    HP support

    http://welcome.HP.com/country/us/en/contact_us.html

    or try the HP support forums

    http://h30434.www3.HP.com/

    and here is the link for the HP drivers and support

    http://welcome.HP.com/country/us/en/support.html

    and for any software camera problems go to the camera manufacturer's website and search the device drivers and the software of the camera

  • To an existing dashboard, how can I go back and discovers the source of data for the items in the dashboard? More precisely to determine why the data not displaying on the dashboard for a host where the agents seem to work fine.

    Here are the servers in the cluster.  The active cluster in the attached image is PrdERx2.  The zeros should have a count associated with them equal to zero.

    Thank you

    Barry

    Hi Barry -.

    If the dashboard in question was created with WCF (our Framework Web component that is included with the product), then using the tab design inspecting dashboard design suggested Bart is a good. WCF dashboard get much of their data by querying the Foglight data model so once you are in the editor of WCF, change views to queries drop-down list and see what queries can exist in this module WCF. Test if you find to make sure they return data. Also change the functions drop-down list and see if you can test as well.

    I hope this helps.

    Robert

  • How to use a PDF form as a source of data for the second form PDF

    Hello world

    I have the following scenario:

    We want that our sales staff to collect data of our clients through a PDF form.

    We do not like to combine with the PDF we print them or sending them by E-Mail.

    Therefore, there is a solution to fill a second PDF with data from the first.

    1. 1 PDF form with input fields

    2. 1 PDF form must be registered with the entry

    3. 2nd PDF form with a table filled with 1 form data

    4. 2nd PDF form displays the data under the graph with the abilty to edit these data to dynamically change table

    I don't want a hollow guide the whole scenario. I just first of all whether it is even possible to supply a PDF form with data in another form PDF.

    If it is possible please give me advice to know what to look for everything.

    If this isn't the case, I would like to read the recommendations for solutions easy possible to solve this task.

    We do not want to send our staff of sales with PDF solutions to our clients, their collection and their work through a big pile of measures to manage this scenario.

    Thank you and regards

    Christian

    You must understand that there is a big difference between the JS, you might be familiar with (the one used in web pages) and one used in PDF files.

    Although the basic syntax is the same most of the objects and methods are different, as PDF files are fundamentally different from web pages.

    You can find the reference to API JS Acrobat here: JavaScript for Acrobat | Adobe Developer Connection

    The form data can be copied by exporting it to a file FDF then import this file into the other PDF (assuming that the field names are the same), or it can be done using a script that uses global variables. The latter is more automatic, but may require adjustment of the parameters of the application or using a function of confidence (IE, a feature that is installed on the local computer instead of just in the file itself).

    The first is easier to implement and use, but requires the intervention of the user.

  • How to generate the xml tag empty when meets elements void inside

    Hi gurus,

    IAM facing a problem to generate the empty tag, here is my file that I'm generating now
    <HEADER>
        <MINISTRY_CODE>RPO</MINISTRY_CODE>
        <DEPARTMENT_CODE>000</DEPARTMENT_CODE>
        <ORDER_CODE>RPO000EPO11001002</ORDER_CODE>
        <EXTERNAL_SYSTEM_CODE>E</EXTERNAL_SYSTEM_CODE>
        <AMENDMENT_NUMBER>0</AMENDMENT_NUMBER>
        <VARIATION_NUMBER>0</VARIATION_NUMBER>
        <EXCEPTIONS>
          <EXCEPTION>
            <EXCEPTION_CODE>PO016</EXCEPTION_CODE>
            <EXCEPTION_LONG_DESC>PO cannot be created/amended successfully</EXCEPTION_LONG_DESC>
          </EXCEPTION>
        </EXCEPTIONS>
      </HEADER>
      <ITEMS>
        <ITEM>
          <LINE_NUMBER>1</LINE_NUMBER>
          <EXCEPTIONS>
            <EXCEPTION>
              <EXCEPTION_CODE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
              <EXCEPTION_LONG_DESC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
            </EXCEPTION>
          </EXCEPTIONS>
          <LOCATIONS>
            <LOCATION>
              <LINE_NUMBER>1</LINE_NUMBER>
              <EXCEPTIONS>
                <EXCEPTION>
                  <EXCEPTION_CODE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
                  <EXCEPTION_LONG_DESC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
                </EXCEPTION>
              </EXCEPTIONS>
              <DISTRIBUTIONS>
                <DISTRIBUTION>
                  <LINE_NUMBER>1</LINE_NUMBER>
                  <EXCEPTIONS>
                    <EXCEPTION>
                      <EXCEPTION_CODE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
                      <EXCEPTION_LONG_DESC xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
                    </EXCEPTION>
                  </EXCEPTIONS>
                </DISTRIBUTION>
              </DISTRIBUTIONS>
            </LOCATION>
          </LOCATIONS>
        </ITEM>
      </ITEMS>
    </GEBIZ_ORDER_ACK>
    current I'm generating tags EXCEPTION even if it is null as
    < EXCEPTIONS >
    < EXCEPTION >
    < EXCEPTION_CODE xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: Nil = "true" / >
    < EXCEPTION_LONG_DESC xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" xsi: Nil = "true" / >
    < / EXCEPTION >
    < / EXCEPTIONS >
    but my requirement is them does not when the exception code is null and generate as
    < EXCEPTIONS / >

    This is sql that I use to generate the above said code let me know how can I control who
                       SELECT xmlserialize(document
                                  xmlelement("GEBIZ_ORDER_ACK"
                                  , xmlagg(
                                      xmlconcat(hdr, dtls)
                                    )
                                  )
                                  as clob indent size = 2
                                )
                       --  INTO lv_out
                         FROM (
                               SELECT xmlelement("HEADER"
                                           , xmlelement("MINISTRY_CODE", poh.ministry_code)
                                           , xmlelement("EXCEPTIONS"
                                                 , xmlelement("EXCEPTION"
                                                             , xmlelement("EXCEPTION_CODE"   --,NVL(poh.exception_code,'NULL')
                                                             , xmlattributes(
                                                               NVL2(poh.exception_code,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                             , NVL2(poh.exception_code,null,'true') as "xsi:nil"
                                                               )
                                                             ,poh.exception_code)
                                                             , xmlelement("EXCEPTION_LONG_DESC"
                                                             , xmlattributes(
                                                               NVL2(poh.exception_long_desc,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                             , NVL2(poh.exception_long_desc,null,'true') as "xsi:nil"
                                                               )
                                                             ,poh.exception_long_desc)
                                                             )
                                                       )
                                           ) hdr
                                     , xmlelement("ITEMS"
                                     , xmlagg(
                                              xmlelement("ITEM"
                                               ,xmlelement("LINE_NUMBER", v1.line_no)
                                               ,xmlelement("EXCEPTIONS"
                                                        , xmlelement("EXCEPTION"
                                                                    , xmlelement("EXCEPTION_CODE"    --,NVL(v1.exception_code,'NULL')
                                                                    , xmlattributes(
                                                                      NVL2(v1.exception_code,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                                    , NVL2(v1.exception_code,null,'true') as "xsi:nil"
                                                                      )
                                                                    , v1.exception_code)
                                                                    , xmlelement("EXCEPTION_LONG_DESC"
                                                                    , xmlattributes(
                                                                      NVL2(v1.exception_long_desc,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                                    , NVL2(v1.exception_long_desc,null,'true') as "xsi:nil"
                                                                      )
                                                                    ,v1.exception_long_desc)
                                                                    )
                                                          )
                                               ,xmlelement("LOCATIONS"
                                               ,( SELECT xmlagg(
                                                          xmlelement("LOCATION"
                                                        , xmlelement("LINE_NUMBER",v2.location_line_no)
                                                        , xmlelement("EXCEPTIONS"
                                                        , xmlelement("EXCEPTION"
                                                        , xmlelement("EXCEPTION_CODE"   --,NVL(v2.exception_code,'NULL')
                                                        , xmlattributes(
                                                          NVL2(v2.exception_code,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                        , NVL2(v2.exception_code,null,'true') as "xsi:nil"
                                                          )
                                                        , v2.exception_code)
                                                        , xmlelement("EXCEPTION_LONG_DESC"
                                                        , xmlattributes(
                                                          NVL2(v2.exception_long_desc,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                        , NVL2(v2.exception_long_desc,null,'true') as "xsi:nil"
                                                          )
                                                        ,v2.exception_long_desc)
                                                                    )
                                                          )
                                               ,xmlelement("DISTRIBUTIONS"
                                               ,(SELECT xmlagg
                                                 (       xmlelement("DISTRIBUTION"
                                                         ,xmlelement("LINE_NUMBER", v3.distribution_line_no)
                                                         ,xmlelement("EXCEPTIONS"
                                                         , xmlelement("EXCEPTION"
                                                         , xmlelement("EXCEPTION_CODE"--,NVL(v3.exception_code,'NULL')
                                                         , xmlattributes(
                                                           NVL2(v3.exception_code,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                         , NVL2(v3.exception_code,null,'true') as "xsi:nil"
                                                          )
                                                         ,v3.exception_code)
                                                         , xmlelement("EXCEPTION_LONG_DESC"
                                                         , xmlattributes(
                                                           NVL2(v3.exception_long_desc,null,'http://www.w3.org/2001/XMLSchema-instance') as "xmlns:xsi"
                                                         , NVL2(v3.exception_long_desc,null,'true') as "xsi:nil"
                                                          )
                                                        ,v3.exception_long_desc)
                                                                    )
                                                            )
                                                          ) ORDER BY v3.distribution_line_no
                                                       ) FROM xgbz_fin_stage_ack_pot_v@dev_1157.RP.EDU.SG v3
                                                        WHERE v2.po_cont_code = v3.po_cont_code
                                                          AND v2.line_no = v3.line_no
                                                          AND v2.location_line_no = v3.location_line_no
                                                          AND v2.fs_timestamp = v3.fs_timestamp
                                                          AND v3.tx_timestamp IS  NULL
                                                     )
                                                   )
                                                 ) ORDER BY v2.location_line_no
                                              ) FROM xgbz_fin_stage_ack_pol_v@dev_1157.RP.EDU.SG v2
                                               WHERE v2.line_no = v1.line_no
                                                 AND v2.po_cont_code = v1.po_cont_code
                                                 AND v2.fs_timestamp = v1.fs_timestamp
                                                 AND v2.TX_TIMESTAMP IS NULL
                                 )
                               )
                             ) ORDER BY v1.line_no
                           )
                         ) dtls
                    FROM xgbz_fin_stage_ack_poh_v@dev_1157.rp.edu.sg poh,
                         xgbz_fin_stage_ack_pod_v@dev_1157.rp.edu.sg v1
                   WHERE v1.po_cont_code = poh.po_cont_code
                     AND v1.fs_timestamp = poh.fs_timestamp
                     AND v1.tx_timestamp IS NULL
                     AND poh.tx_timestamp IS NULL
                     AND poh.po_cont_code = rec_po_ack.po_cont_code
                   GROUP BY poh.po_cont_code,poh.ext_system_code,poh.amendment_no,poh.variation_no,poh.exception_code,poh.exception_long_desc,
                            poh.ministry_code, poh.dept_code)
    It's urgent please help in this regard.

    Thanks in advance.

    Concerning
    Mr. Nagendra

    Hello

    Here are two possible solutions:

    xmlelement("EXCEPTIONS",
      xmlforest(
        xmlforest(
          v1.exception_code as "EXCEPTION_CODE"
        , v1.exception_long_desc as "EXCEPTION_LONG_DESC"
        ) as "EXCEPTION"
      )
    )
    

    Mun

    xmlelement("EXCEPTIONS",
      case when v1.exception_code is not null
             or v1.exception_long_desc is not null
        then xmlelement("EXCEPTION",
               xmlforest(
                 v1.exception_code as "EXCEPTION_CODE"
               , v1.exception_long_desc as "EXCEPTION_LONG_DESC"
               )
             )
      end
    )
    
  • How to generate 3 Wick using digital signals

    Hello

    I am in the course of generations bit 3 digital using 9403 digital module and cRIO 9014.I signal must generate all combinations from 000 to 111.la so I have to give the Boolean constant either true or false 9403.I output module'm not gettimg how incrase step value of 000 001 and so on... Should I use the shift register?

    I know how to use the registry to offset for integer value bt I don't hv any idea on the Boolean value.

    in the hope of solution...

    Here is a small example that uses the number to array of Boolean function.  The digital indicator has its display of the binary value (%b) formatting.

  • How to generate random numbers from 1 to 5

    How to generate random numbers from 1 to 5

    -1110340081

    Thank you I ended up

  • How to generate an impulse to test short circuit in an inducer

    Hello

    IM new to labview and am in need of complete SURG - SURGE STRESS TEST

    This test is intended to detect a short tour inter by applying a number of high
    voltage pulses (or surge) for the selected winding.
    Each pulse should produce one sinusoidal transient that eventually decreases to zero.

    How to generate the impulse using labview.

    Hi Jessica,.

    Please see the "pulse pattern.vi" function--> pallets of signal processing signal generation.

    Otherwise, you can browse through examples of LabVIEW.

    Kind regards

    Srikrishna.J

  • How to generate a vector under LabVIEW?

    How to generate a vector as n = 0:Ts:T in LabVIEW with the need for the mathscript node and with out of the loop?

    Focus on the ramp VI model.  It is located in the treatment-> Palette generation of Signal of the Signal.

  • How to generate curves under labVIEW

    Hi all
    Can someone please tel me how to generate the following curves under LabVIEW.
    Haversine curve 1.)
    2 Lorentz curve.)
    3 bell curve.)
    4.) exponential rise curve
    5. exponential decay curve)

    Note: Entries required for this curves are Amplitude, Phase, Offset
    Frequency and number of samples

    Have you read the second part of my post above?

  • How to generate a field real-time tiara?

    Hello

    I tried a lot of things, but it is not working properly.

    I logfiles with the data of one ore more test ports. All entries in log file has a time stamp.  Timestamps are not equidistant. I can read the log file and get a table 1 d (n long elements) of the timestamps and a table 2D data (n x m elements m test ports).

    How to generate a report in the tiara with the time that x-axis it? The difficult is, I can't transfer the timescale to tiara.

    I could first convert timestamps double and double transfer al. This does not solve my problem. The tiara-channel resulting if of type 'float' and not 'time '. I need a script to swich the channel to 'time'. I see no solution to load a layout of report (TDR), to call a script to transfer data from additional text.

    Hello bohm,.

    When you write a channel timestamp in a PDM file, tiara automatically identifies it as a weather channel. So when you export the right data, you will get good results ;-).

    To illustrate this, I wrote an example VI: it creates two TDMS files with random timestamps and displays then the two files into a single report of DIAdem. I hope that you find it useful.

    Best regards
    SFK

  • How to generate the report on rules

    How to generate the report on rules with id recipient and with a few keyoword in a rule.

    The rule management dashboard has an integrated 'report rules', you can configure properties and input parameters.

    For rule management dashboard, click homes > Administration > rules. In the upper right, next to the date and time, click reports.

    You can also find these helpful videos: http://edocs.quest.com/foglight/5610/Foglight_Reports_videos.php

    Hope this helps,

    Shay

Maybe you are looking for

  • 8 window

    Dear Sirs, My HP TouchSmart 610-1188D desktop PC, which installed with window 7, Prod. # QP237AA, serial number {removed privacy}, now I think that if I change the window update 8, she is taken in charge or not? Thank you, best regards. [Personal inf

  • HP Pavilion Slimline s5120f: hard drive

    I'm quickly running out of storage on my hard drive and would like to add a hard disk or change the original. After combing through the manual of the product, I'm as lost as ever. It sounds from the manual that this is not an expandable system. Howev

  • Satellite A210-103 and battery problem

    I have an A210-103:HTTP://DE.COMPUTERS.TOSHIBA-EUROPE.COM/INNOVATION/JSP/SUPPORTSECTION/DISCONTINUEDPRODUCTPAGE.DO?SERVICE=DE&PRODUCT_ID=1 33099 & DISC_MODEL = 1and I bought a new battery 9 cells:http://www.Amazon.de/GP/product/B000RSQX6U/ref=oh_o00_

  • HP envy m6-k010dx upgrade question

    Ive met recently pages on AMD XGP and I am very interested in the potential to make my phone able to cope with new games that wouldn't run acceptable fps on my laptop, for those of you who read this and do not know what it is here is the link: http:/

  • Anyone know how to "password protect" a folder and content?

    I share a computer at home with my teenage son. I also do work at home and my customer information must be secure (confidential data). How do I password protect folders for work and other private files?