URGENT start tag needs to be generated in xml output

I am getting the xml output as below
since my value for each element is empty doesn't generate the start tag. BUT I NEED START TAG also to be created with this xml file. What property need to specify while generating it thro' Transformer and TransformerFactory. Please help me
<?xml version="1.0" encoding="UTF-8"?>
<address>
<addressID/>
<streetNumber/>
<addressLine1/>
<addressLine2/>
<addressLine3/>
<city/>
<zipCode/>
<lastUpdatedUserID/>
<deletedFlag/>
<phoneNumber/>
<country/>
<state/>
</address>

I don't quite understand your question. You want to have the start tag of each element outputed or you want one root element start tag to be outputed?
If it's the first case, try separating start and end tags from your elements instead of having them combined, i.e. do the following:
replace
<addressLine1/>by
]<addressLine1>
</addressLine1>I don't know if this is the answer you expect, reply if not.

Similar Messages

  • Query to generate an xml output hierarchically

    Hi I need to write a sql query to generate an xml hierarchically for a tree menu. I have one self-joined table that holds menu hierarchy.
    Following is a sample data in a table.
    MenuID    MenuName       ParentID     href
    1            File
    12           Open              1     Open.jsp     
    11           New               1
    21           Program           11
    61           Program2          11    Program2.jsp
    31           Blank             21    Blank.jsp
    2            View     
    22           Printer          
    28           Printer2          22         
    30           Printer3          28    test.jsp         
    23           Doc                     Doc.jsp
    4            Tools                   Tools.jsp
    5            Win               1     Win.jspFollowing is the sample output want to generate:
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <menus>
        <menu name="File" id="1">
            <menu name="Open" id="12" href="Open.jsp"/>
            <menu name="New" id="11">
                <menu name="Program" id="21">
                    <menu name="Blank" id="31" href="Blank.jsp"/>
                </menu>
                <menu name="Program2" id="61" href="Program2.jsp"/>
            </menu>
            <menu name="Win" id="5" href="Win.jsp"/>
        </menu>
        <menu name="View" id="2">
            <menu name="Printer" id="22">
           <menu name="Printer2" id="28">
             <menu name="Printer3" id="30" href="test.jsp">
           </menu>      
         </menu>
        </menu>
        <menu name="Doc" id="3" href="Doc.jsp"/>
        <menu name="Tools" id="4" href="Tools.jsp"/>
    </menus>Thanks

    You can use SYS_CONNECT_BY_PATH to get the complete hierarchical path to an object, and then order by that. Here is an example:
    with menutbl as
    (select 1 as MenuId,'File' as MenuName, null as ParentId, null as href from dual
    union all
    select 12,'Open',1,'Open.jsp' from dual
    union all
    select 11,'New',1,null  from dual
    union all
    select 21,'Program',11,null  from dual
    union all
    select 61,'Program2',11,'Program2.jsp'  from dual
    union all
    select 31,'Blank',21,'Blank.jsp'  from dual
    union all
    select 2,'View',null,null  from dual
    union all
    select 22,'Printer',null,null  from dual
    union all
    select 28,'Printer2',22,null  from dual
    union all
    select 30,'Printer3',28,'test.jsp'  from dual   
    union all
    select 23,'Doc',null,'Doc.jsp'  from dual
    union all
    select 4,'Tools',null,'Tools.jsp'  from dual
    union all
    select 5,'Win',1,'Win.jsp'  from dual)
    select * from (
    select menutbl.*,  SYS_CONNECT_BY_PATH(MenuId, '/') as path from menutbl start with parentid is null connect by
    NOCYCLE PRIOR MenuId = ParentId) order by path;this prints
    1     File               /1
    11     New     1          /1/11
    21     Program     11          /1/11/21
    31     Blank     21     Blank.jsp     /1/11/21/31
    61     Program2     11     Program2.jsp     /1/11/61
    12     Open     1     Open.jsp     /1/12
    5     Win     1     Win.jsp     /1/5
    2     View               /2
    22     Printer               /22
    28     Printer2     22          /22/28
    30     Printer3     28     test.jsp     /22/28/30
    23     Doc          Doc.jsp     /23
    4     Tools          Tools.jsp     /4I guess that you can take over from here and add html elements around the text...
    gojko adzic
    http://gojko.net

  • How to generate as XML output from Oracle Apps 11

    Hi Anyone has the experience to generate the output from Oracle Apps 11 as XML file? Database is 8.1.7, Oracle Apps 11. The concurrent program can be written in PL/SQL or can report 2.5 generate the output as XML?
    The scenario is:
    1) Run a concurrent program in Oracle Apps 11
    2) Output generated is XML (.xml)
    Regards.

    This forum is for Oracle XML DB features. XML DB is only available as of database 9iR2.
    You may be better off in legacy XML Features forum...
    PL/SQL XML Programming

  • Functions needed in Data Template for XML output

    Hi ,
    Are there any oracle functions like abs() available
    in data_template to be used as follows
    group name="listItem" source="Q2">
    <element name="amount" value="abs(amount)"/>
    <element name="serialNumber" value="TXN_SERIAL_NO"/>
    I want the absolute value of the amount .
    OR
    Can I HIDE the xml Element like
    <element name="amount" value="amount"/> (i want to hide this tag in output?)
    Please do not suggest to do the same in the SQL query as I am using the SQL query to do something else and resolve another issue.
    rdgs
    xyz

    You can do this abs in Template.
    use xdoxslt:abs or abs from xsl.
    if you want the data in the xml to habe absolute value , then write pl/sql package to this .
    <element name="amount" value="yourpcakage.yourabs(amount)"/>
    or do it in sql query, which you dont want to.

  • Having a xml output with custom xml tags

    Hi All,
    I have a requirement where we need to generate an xml output with a custom set of tags as given below.
    <templates>
    <list>
    <List_no></list_no>
    <List_name> </List_name>
    </List>
    </templates>
    I am not sure how to get the list part as tags within tags.
    I am able to get the output if the tag level is just one level like ,
    <templates>
    <List_no></list_no>
    <List_name> </List_name>
    </List>
    </templates>
    Does anybody know how I could get the multi-level tags. Any help would be much appreciated. Thank you all.
    -Vin

    Hi, you can FOR XML PATH for a finer degree of control over your XML.  Use the @ symbol to create attributes.  Here's a simple example:
    DECLARE @t TABLE ( rowId INT IDENTITY PRIMARY KEY, [address] VARCHAR(50), city VARCHAR(30), floor INT, suite INT, doorType VARCHAR(20) )
    INSERT INTO @t VALUES
    ( '123 Fake St', 'Springfield', 10, 512, 'Metal' )
    SELECT
    [address] AS "Address",
    city AS City,
    [floor] AS "Location/@Floor",
    suite AS "Location/@Suite",
    doorType AS "Location/@DoorType"
    FROM @t
    FOR XML PATH ('Company'), ROOT ('Companies'), ELEMENTS;

  • Generating structured XML file based on relational data base

    Hi,
    I need to use XML DB to generate a structured XML file based on the relational oracle database. I start by using Oracle default table, emp,
    Here is EMP data,
    EMPNO ENAME DEPNO SAL
    123.00 E1 20.00 1,000.00
    124.00 E2 20.00 2,000.00
    125.00 E3 20.00 2,000.00
    126.00 E4 30.00 3,000.00
    127.00 E5 30.00 3,000.00
    128.00 E6 30.00 4,000.00
    129.00 E7 40.00 7,000.00
    I used this SQL statement to generate an XML output,
    select XMLElement ("Department",
    XMLAttributes(deptno as "DEPARTMENTNO"),
    XMLElement("EmployeeName", ename),
    XMLElement("Salary", sal)
    ) "Result"
    from
    emp
    where
    deptno=20
    The result was
    <Department DEPARTMENTNO="20">
    <EmployeeName>E1</EmployeeName>
    <Salary>1000</Salary>
    </Department>
    <Department DEPARTMENTNO="20">
    <EmployeeName>E2</EmployeeName>
    <Salary>2000</Salary>
    </Department>
    <Department DEPARTMENTNO="20">
    <EmployeeName>E3</EmployeeName>
    <Salary>2000</Salary>
    </Department>
    but I need this structure instead,
    <Department DEPARTMENTNO="20">
    <EmployeeName>E1</EmployeeName>
    <Salary>1000</Salary>
    <EmployeeName>E2</EmployeeName>
    <Salary>2000</Salary>
    <EmployeeName>E3</EmployeeName>
    <Salary>2000</Salary>
    </Department>
    Could you guide me how I can generate this kind of structure like master-detail structure and which document you recommend to obtain this point.
    Thanks,
    Shiva

    Hi,
    If you want to write an xml into file, I think you should use PL/SQL.
    Is it even possible to spool output into file without the query itself?
    doen't show me a proper xml fileTo get well-formed xml, you also have to make a root element.
    If you want <?xml version="1.0"?> also then use xmlroot(), but I haven't figure out
    how to specify the encoding.
    SQL> WITH xtab AS(SELECT 'E1' ename,20 depno,1000 sal FROM dual
      2               UNION ALL
      3               SELECT 'E2',20,2000 FROM dual
      4               UNION ALL
      5               SELECT 'E3',40,3000 FROM dual
      6               UNION ALL
      7               SELECT 'E4',30,4000 FROM dual)
      8  SELECT XMLRoot(XMLElement("Company",XMLAgg(XMLElement("Department",
      9           XMLattributes(depno as "DEPARTMENTNO"),
    10             XMLAgg(XMLForest(
    11                      ename AS "EmployeeName",
    12                      sal   AS "Salary"))))),version '1.0') company_xml
    13  FROM xtab
    14  GROUP BY depno;
    COMPANY_XML                                                                    
    <?xml version="1.0"?>                                                          
    <Company>                                                                      
      <Department DEPARTMENTNO="20">                                               
        <EmployeeName>E1</EmployeeName>                                            
        <Salary>1000</Salary>                                                      
        <EmployeeName>E2</EmployeeName>                                            
        <Salary>2000</Salary>                                                      
      </Department>                                                                
      <Department DEPARTMENTNO="30">                                               
        <EmployeeName>E4</EmployeeName>                                            
        <Salary>4000</Salary>                                                      
      </Department>                                                                
      <Department DEPARTMENTNO="40">                                               
        <EmployeeName>E3</EmployeeName>                                            
        <Salary>3000</Salary>                                                      
      </Department>                                                                
    </Company>
    [pre]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Generate XML output using DBMS_XMLGEN.getxmltype and not from rdf

    Hi,
    I have a requirement to display output from a particular table in XL format. Out of all the known possible options, I am planning to use the XML publisher to generate XL output.
    For the data source, instead of using the conventional way of creating XML data using rdf,I am planning to use DBMS_XMLGEN.getxmltype pl/sql procedure to generate the XML output. And from the output, call the template to generate the required Excel output.
    Now, I am using the following code to generate XML output but am not sure how to proceed from here. I need to first print the XML data in the FND Output file after which I was planning to call the 'XML Report Publisher' (XDOREPPB) program and use the current request id to get the excel output but I am not able to find the way to print the XML data in the output file as:
    fnd_file.put_line (fnd_file.output, l_xml_type); - is throwing an error as l_xml_type is an XML data output.
    PROCEDURE xml_main (
    errbuf OUT VARCHAR2
    ,retcode OUT VARCHAR2
    ,p_project_from IN VARCHAR2
    ,p_project_to IN VARCHAR2
    AS
    l_xml_type XMLTYPE;
    BEGIN
    SELECT DBMS_XMLGEN.getxmltype
    ('SELECT fnd_global.conc_request_id
    ,TO_CHAR (segment1)
    ,to_char(start_date,''MM/DD/RRRR'')
    ,to_char(xxmcc_project_details_pkg.current_profit_projection
    (project_id),''999,999,990.90'')
    ,to_char(xxmcc_project_details_pkg.cost_to_date (project_id),''999,999,990.90'')
    ,''1''
    FROM pa_projects_all
    WHERE segment1 BETWEEN NVL (p_project_from, segment1)
    AND NVL (p_project_to, segment1)')
    INTO l_xml_type
    FROM DUAL;
         fnd_file.put_line (fnd_file.output, l_xml_type);
    END xml_main;
    Can anyone point me as to how to publish XML output using a PL/SQL procedure (DBMS_XMLGEN.getxmltype)
    Thanks.

    Pl see if the example included in this presentation helps http://www.oracle.com/technology/products/applications/Events/OOW-2006/EBS/S281401_Sridhar_Bogelli.pdf
    Also, you do not need to explicitly call XDOREPPB in later versions of XML Publisher. If you set up everything correctly (as described in the presentation above and the link below) the Output Post Processor is called automatically after the XML file is generated successfully.
    Another excellent tutorial is at http://www.oracle.com/technology/obe/fusion_middleware/fusion/bi/xmlp_ebiz/index.html
    HTH
    Srini

  • XML output with multiple tags in one line

    I have not done much XML exporting with SQL. Previously I had just been ending my SQL queries with
    FOR XML RAW ('Company'), ROOT ('Companies'), ELEMENTS;
    and it formatted my query nicely in an XML output. That put every column name as a tag and the cell data within the tag.
    However, now the criteria has changed on me. I need to create a tag with multiple sub tags in it.
    Example: <Location Floor="10" Suite="512" DoorType="Metal">
    But I'll still need other tags to be normal in the XML output such as
    <Address>123 Fake St</Address>
    <City>Springfield</City>
    <Location Floor="10" Suite="512" DoorType="Metal">
    Is there any way to get this XML mixed in the output like above?
    Thank you for any help. 

    Hi, you can FOR XML PATH for a finer degree of control over your XML.  Use the @ symbol to create attributes.  Here's a simple example:
    DECLARE @t TABLE ( rowId INT IDENTITY PRIMARY KEY, [address] VARCHAR(50), city VARCHAR(30), floor INT, suite INT, doorType VARCHAR(20) )
    INSERT INTO @t VALUES
    ( '123 Fake St', 'Springfield', 10, 512, 'Metal' )
    SELECT
    [address] AS "Address",
    city AS City,
    [floor] AS "Location/@Floor",
    suite AS "Location/@Suite",
    doorType AS "Location/@DoorType"
    FROM @t
    FOR XML PATH ('Company'), ROOT ('Companies'), ELEMENTS;

  • Easiest and/or best methods for generating XML output (not with a report)

    Hi, several of our EBS customers (11.5.10) are converting their PDF reports to use XML/BI publisher to produce output. The data stream comes from a report that generates the XML output, and then the XML template is applied. This works great ... no problems, etc. From what I have read, however, Oracle intends to treat the traditional Forms and Reports Developers as legacy tools (although still supporting them, of course).
    My question is if I wanted to ditch using Reports to generate XML output, what, in your opinion or in your current usage, is the easiest way of getting this data? In Reports, the data modeler is excellent in providing a method to write your queries, split them into different repeating groups, write formula and summary columns, link multiple queries, etc, etc. If one were to become Reports Developer free, what comparable tools are available to take its place? I would expect this tool to handle a mix of GUI and coding like the Reports data modeler. Please note that I'm not looking for an EBS-specific solution -- say for a custom application using regular Oracle 10g DB and iAS, with BI Publisher for reporting.
    Thanks for your feedback,
    Ryan

    What I'm looking for is to not use Oracle Reports to generate the XML data output since Oracle's statement of direction is pushing BI Publisher rather than Oracle Reports as the preferred tool for reporting. That said, the data modeler in Reports provides a very flexible tool to construct and link multiple queries and to manipulate the queries into several levels of a master/detail relationship. Further, the mix of GUI and coding makes setting up the data model a lot more efficient. What I'm looking for (and I don't know if anything exists) is something comparable that can be used to generate XML output from the DB -- the idea being that I wouldn't use legacy tools, like Reports, for this task. I hope that is clearer.
    Really, another way of answering my question is, aside from Reports and the APIs mentioned so far, what are my fellow developers using, if anything, to extract XML data in a way that handles the features i list above?

  • Unable to generate the XML file through SQL script. getting error PLS-00306

    I am fetching the data from cursor and generating the xml output I am getting the below error.
    When I have checked the cursor query it is fetching the data in to single column.
    Input truncated to 1 characters
    Enter value for 7: EXEC FND_CONC_STAT.COLLECT;
    DBMS_LOB.append (tmp_file, r.core_xml);
    ERROR at line 95:
    ORA-06550: line 95, column 7:
    PLS-00306: wrong number or types of arguments in call to 'APPEND'
    ORA-06550: line 95, column 7:
    PL/SQL: Statement ignored

    Hi Alex,
    thanks for the responce..
    i have fixed the issue
    i have used XMLAttributes to get the value
    SELECT XMLELEMENT (
    NAME "TranACK",
    XMLAttributes ('1' as "TranNum",
    (select distinct to_char(SYSDATE,'yyyy-mm-dd')
    from DUAL) as "PrcDate"),
    XMLFOREST (
    a.PAYMENT_ID AS "PmtID"),
    XMLFOREST (
    a.ACK_TRANSACTION_RECEIVER AS "Name1"),
    XMLFOREST (
    to_char(a.VALUE_DATE,'yyyy-mm-dd') as "ValueDate" ),
    XMLFOREST (
    a.PAYMENT_AMOUNT AS "CurAmt"),
    XMLFOREST (
    a.CURRENCY_CODE AS "CurCode")
    ).getclobval ()
    AS line_xml
    FROM XXWAP_PAYMENT_LINE_TBL a
    where a.PAYMENT_BATCH_ID=P_batch_id;

  • Error: An attribute cannot appear more than once in the same start tag

    Hi Everyone,
    when i run the page sometimes it works fine but sometimes it throws Compilation Error as below.
    "Error(502,1224): file:/C:/Jdeveloper/jdevhome/jdev/myhtml/OA_HTML/fwk/t/Session_2055663493/region1.uix<Line 502, Column 1224>: XML-20124: (Fatal Error) An attribute cannot appear more than once in the same start tag."
    And i delete the particular file from the path and run the page so this time it works fine.
    But later after sometime i get the same error but the session number will be changed, then again i need to delete it and run.
    What can be the permanent solution for this issue?
    Plz let me know any suggetions.
    Thanks.

    Seems like the mdl file is corrupted or was not generated correctly.
    Can you try to create the mdl file again and then try the import ?
    If it doesn't work then try contacting Oracle Support.

  • Facing problem while removing XML tags which has been generated from SAP

    Hi All,
    I am facing problem in MII, while i trying to remove 1st 2 XML tags of XML as generated from SAP.
    Here is XML which has been generated from SAP
    u201C<?xml version="1.0"; encoding="UTF-8"?>
    <ZCIFSCHEDULE>
    <SCHEDULE>
    <MESSAGE_TYPE/>
    <SITE>A300</SITE>
    <SHOP_ORDER>2012020856</SHOP_ORDER>
    <QTY_TO_BUILD>6.000<;/QTY_TO_BUILD>
    <DATE_TIME>08-FEB-2012 20:57:21 +05:30</DATE_TIME>
    <OPERATION>PRS</OPERATION>
    <ITEM>IN-CT00228</ITEM>
    <DPICS_CODE>1229</DPICS_CODE>
    <REVISION/>
    <CYC_TIME_CURING/>
    <FLAG_AGING/>
    <AGING_MIN/>
    <PRODUCTION_VERSION/>
    <CYC_TIME_OC/>
    <CYC_TIME/>
    </SCHEDULE>
    </ZCIFSCHEDULE>u201D
    From above i want to remove 1st 2 tags and last one tag i.e.  u201C<?xml version="1.0"; encoding="UTF-8"?> , <ZCIFSCHEDULE> and last tag ZCIFSCHEDULE>u201D
    Its urgent!
    Did anyone done regarding this issues. Thanks in advance.
    Kind Regards,
    Praveen Reddy

    Hi Praveen,
    Are you trying to make the xml into a string?  I think if you remove the first tag, it will either automagically reappear or it will throw and error as being poorly formed xml. 
    In general, you can remove the nodes by the use of indexes.  Since you are operating at the root level, I am not sure how well it will work, but if your xml is in a property, you can reference the specific nodes by something like this:  myXML.Output{/*[1]} which if you put it in a tracer will display the contents of the first node (or blank if there are child nodes).  The node index can be dynamically set, but start with the simple hard coded one.  I would also start at the lowest child level to verify that it is working properly (a tracer will display the contents specified by the index).  You can also google xml indices (or indexes) and it will point to some other useful xml operators.
    I suggest that you play around with it and also work with the Link Types (hint: removeXML).
    Regards,
    Mike

  • Urgent export help needed

    Extremely urgent help needed! I'm on a tight deadline. I'm working on a sequence, with all my settings set to DV. My client needs an AVI file as an output. After exporting using conversion, the file looks and plays fine, except for any transitions. At the start of each transition, there is 1 frame that is unrendered. I have rendered the entire sequence, and tried the export many times now, and I can't figure out what's wrong. I'm working on v5.1.4. Can someone please help?????

    Thank you, kind sir! < </div>
    Careful who you're callin' names around here, buddy!
    Thank you for the kind words, that's why we're here. Hrdly anyone ever closes their threads on a positive note, I thank you for that, too.
    Good luck with your future projects and those squeaky deadlines.
    bogiesan

  • XML tag  need to  be change in the sorce file (ENCODING)

    Hi
         my source file XML format.. in this file I'm getting as a first tag as  like this..   <b><?xml version="1.0" encoding="ISO-8859-1"?>..</b> but actually in my Message mapping source code i have starting tag is like this...
    <b><?xml version='1.0' encoding = 'UTF-8" ?></b>
    so, som encoding  is    different.. for this how can   solve the problem.. wether i need to change in the source file itself.. or is there any solution to change  that in our scenario itself..
    plz clarryfy this..
    Thanks
    babu

    Hi Babu,
    Check out my answers in this Link
    Re: How to change the incoming xml to a different namespace
    this way you can modify the XML tags which are beyond the reach of mapping
    Regards
    Vishnu

  • Embed HTML tag inside XSLT to generate email content

    I want to Embed HTML tag inside XSLT to generate email content .
    XSLT is not working in Jdeveloper , when i use the syntax <xsl:output method="html" indent="yes" version="1.0"/> in transformation activity .
    Can anyone help to resolve the issue .

    in the <xsl:template match=""/> element you can just start with creating your html document
    so for example
         <xsl:template match="/">
              <html>
    the graphical mapper itself won't i think but when you test the xsl it will still procedure a html document, we use it too to generate the email body contents

Maybe you are looking for

  • Good Image Browser

    Hi all, Can anyone recommend an Image Browser for OS 9.x that works as well as ACDSee for the PC? Unfortunately, the version of ACDSee available for Mac is old and very limited. I'd like to be able to quickly flip through all the images in a folder a

  • Development and product environment

    Dear all, I want to setup two databases in seperated server. One for development purpose and another for product environment. Which good method/tool in oracle can transfer data (like pl/sql,tables,fields) from development to product environment? Than

  • My ipod 6th generation doesnt seem to be working properly. what can I do?

    When I connect my iPod to my computer all my music is there and I am able to play them with no complications but the screen doesn't display anything. Its been like this for over four weeks now and I am unable to use it. I've tried the down button and

  • Space between DIV with image and DIV with image background

    I have just about finalized the new design on my website. The only issue I am having now is on the gallery page.  There is a thin space between a DIV with an image and DIV with an image background.  I am using these DIV's to give the illusion of a bl

  • Does PI 7.1 EHP1 supports java version 1.6?

    Does PI 7.1 EHP1 supports java 1.6? Where do i find these details?