Remove unwanted xml tags

Hello All,
I have the below xml message as my input,
<Header1>
<Header2>
<Transaction>
     <item1>test1</item1>
     <item2>test2</item2>
</Transaction>
</Header2>
</Header1>
I want to remove the first <Header1> </Header1> tag when assigning to an output.
I was wondering, how do we achieve this.
Thanks
Ram

Hi,
For this, u can
1) Use Java embedding to remove the header 1 tags and then assign to the output variable.
2) Create a new variable which should have the structure <header2>... </header2> as in the below xml. Assign the input data to this new variable. Then assign this variable to output variable.
Hope this helps.
Regards,
MJ

Similar Messages

  • Remove Empty XML Tags using module parameters

    Hi All,
    In my lanscape I have two PI Systems.
    My scenario is an IDOC reaches 1st PI system gets converted into an EDIFACT and then goes to the 2nd PI and from there it gets routed to the respective AS2 Party.
    I am using SOAP to pass message between the PI systems and B2B Toolkit's AS2 Adapter for the communication with AS2 party.
    The issue is when the message is getting converted from IDOC to EDIFACT there are a few feilds with occurence 1..1 and due to these fields i get an empty XML tag at the output. These empty XML tags give me an error in the B2B Toolkit's AS2 Adapter Receiver Channel
    I cannot change the occurence in the structure of the EDIFACT nor can I use an XSLT mapping to remove empty tags before the message reaches the Communication Channel.
    I want to know if there are any module parameters which i can use either in SOAP Channel or the AS2 Channel to remove the XML Tags.

    Hi Muni,
    "1..1 means, you must send some values for that fields. try to find out why these are not getting any values."
    This empty tag is expected. Before using B2B Toolkit's AS2 Adapter we used to use Seeburger's AS2 Adpater and the message used to get executed successfully with these empty tags.The issue is coming only when we are using B2B Toolkit's AS2 Adapter.
    "if you want to stop sending(the fields which are not needed in target) you can you can disable the fields in the message mapping."
    I cannot disable the feild in the mapping as some other message may use this field.
    Thanks,
    Farhaan

  • How remove an XML tag and its childs?

    Hi all,
    I'm a newbie with XML library. I would like to remove a specific tag and all its childs from an XML document.
    I've modified an example VI  but Error -2607 is generated (see attachment).
    Thanks in advance
    Attachments:
    xmlTest.jpg ‏167 KB

    Post your code and not a picture about it.

  • Unwanted XML tags in annotations

    I combined a number of PDFs using Adobe PDF Pack.  I then attempted to annotate them on Adobe Reader, using the text box in the Drawing Markups section of the Comments Tab.  For some reason whatever I enter into the text box is automatically surrounded by XML tags as soon as I hit return.  How do I disable this?
    For example this:
    Zambanini A, Diabetes Res Clin Pract. 1999: 243-A-4
    Becomes this:
    <?xml version="1.0"?><body xmlns="http://www.w3.org/1999/xhtml" xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/" xfa:APIVersion="Acrobat:11.0.10" xfa:spec="2.0.2"  style="font-size:12.0pt;text-align:left;color:#FF0000;font-weight:normal;font-style:norma l;font-family:Helvetica,sans-serif;font-stretch:normal"><p dir="ltr"><spandir="ltr" style="">Zambanini A, Diabetes Res Clin Pract. 1999: 243-A-4</p></body>
    as soon as I hit return.

    Hi Jamie,
    Does it happen when you copy the text from the comment list ?
    What is the version of Reader that you're using?

  • Removing specific XML tag in XSLT mapping

    Hi there,
    I've asked before about a XML to string XSLT mapping and the answers provided here helped me to successfully do that mapping! Thanks a lot!
    I'm using the following mapping to convert a string back to XML.
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://my.namespace.com">
         <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/>
         <xsl:template match="/">
              <xsl:for-each select="//m:my_tag">
                   <xsl:value-of select="." disable-output-escaping="yes"/>
              </xsl:for-each>
         </xsl:template>
    </xsl:stylesheet>
    But now, I'm having a problem converting back from string to XML. The response tag "m:mytag" has a string like this:
    "<?xml version="1.0" encoding="UTF-8"?><tag1><tag2>Data</tag2></tag1>".
    And  when I use the XSLT mapping shown above, the output file comes like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <?xml version="1.0" encoding="UTF-8"?>
    <tag1>
    <tag2>Data</tag2>
    </tag1>
    As you can see, the initial <?xml ...> tag is duplicated, and it generates a parsing error in XI.
    How can I eliminate one of the "<?xml version="1.0" encoding="UTF-8"?>" strings in the mapping?
    Thanks a lot.

    Wow!!!
    The output="html" actually worked on XML Spy!
    Removing the XSLT file initial tag didn't work.
    I had already resolved this problem using the replace-string method that I found here: http://aspn.activestate.com/ASPN/Cookbook/XSLT/Recipe/65426
    But your method is way more elegant and efficient. :o)
    I'll test the html method on XI, but I'm almost sure it'll work too.

  • Remove namespace,xml tag in OSB

    OSB
    In Proxy Service:
    Once I get response from Business Service 1, I need to send that as request to Business Service 2.
    Business Service 1 response xml is <Reference>123</Reference>
    Business Service 2 request xml should be <ReferenceId>123</ReferenceId>
    Now, in my Proxy I used assign to variable 'refreq' and then in assign (Xquery/xslt), I wrote
    *<ReferenceId>{$webservices//Reference}</ReferenceId>*
    webserviceres is Response Document Variable for ServiceCallout(which I used for Business Service 1).
    Then, I used ServiceCallout to Business Service 2/operation.
    Issue is request to BS2 is sent as below-
    <ReferenceId>
         <Reference      xmlns:S="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="xmlns.oracle.com/xyz/XyzService/">123</Reference>
         </ReferenceId>
    I just want to send as <ReferenceId>123</ReferenceId>

    Use the full path instead of // and data()
    <ReferenceId>{data($webservices//Reference)}</ReferenceId>

  • Remove XML Tags with White space.

    Hi All, I have a scenario like the below code where I have empty spaces in few columns of my tables. I create XML of the data and send it. There is a lot of code such and I can't add ISNULL() on each and every column. Is there any simple one line code working
    with the XML so that I can remove the tags with only empty spaces. TIA.
    DECLARE @xml1 VARCHAR(max)
    DECLARE @xml2 VARCHAR(max)
    set @xml1 = (SELECT 1 AS Col11, ' ' AS Col21, 'ABC' AS Col31 FOR XML RAW, ELEMENTS)
    set @xml2 = (SELECT 2 AS Col12, ' ' AS Col22, 'ABC' AS Col32 FOR XML RAW, ELEMENTS)
    DECLARE @xml xml;
    SET @xml = Cast('<ROOT>' + ISNULL(@xml1, '') + ISNULL(@xml2, '') + '</ROOT>' as xml)
    SET @xml.modify('delete //*[not(node())]');
    -- Some Way to Remove the XML Tags with Empty space here.
    select @xml as XMLString
    /* Output of the Above script.
    <ROOT>
    <row>
    <Col11>1</Col11>
    <Col21> </Col21> -- This XML Tag with a white space should be removed
    <Col31>ABC</Col31>
    </row>
    <row>
    <Col12>2</Col12>
    <Col22> </Col22> -- This XML Tag with a white space should be removed
    <Col32>ABC</Col32>
    </row>
    </ROOT>
    Welcome to MSDN Forums.
    Feel free to ask your questions and Please Note to Vote all helpful topics and
    Mark all answering posts.
    You Value Community's efforts and Community values your faith.
    - Arun Kumar Allu

    It would have helped if there had been a trim() function in XQuery.
    With some trial and error and inventive thinking I came up with this:
    <span style="color:Blue">SET</span> @xml.modify(<span style="color:#A31515">'delete //*[. <= " "]'</span>);
    As they say: it seems to work. But I leave no warranties.
    Erland Sommarskog, SQL Server MVP, [email protected]
    Wow Erland  this
    seems to work, I need to test it against my data and update on this. Thanks again.
    Welcome to MSDN Forums.
    Feel free to ask your questions and Please Note to Vote all helpful topics and
    Mark all answering posts.
    You Value Community's efforts and Community values your faith.
    - Arun Kumar Allu

  • How to merge all parts of a variable without losing xml tags?

    Hi
    In my Bpel process I have I invoke an operation whose output variable is a multi-part variable. Due to some requirements , I need to merge the data from all the parts (without removing the XML tags) and return them in a single part Bpel output variable. So I'm using the below expression in the copy rule:
    concat(concat(concat(concat(concat('<body>',bpws:getVariableData('Function_OutputVariable','body')),'</body>'),
    '<header>'),bpws:getVariableData('Function_OutputVariable','header')),'</header>')
    But the resultant value (the culprit is getVariableData) is deprived of all xml tags in the output parts. For example if my operation output variable is of 2 parts as ::
    <Function_OutputVariable>
    <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="body">
    <Function_Response_body xmlns:oans="http://xmlns.oracle.com/apps/fnd/rep/ws" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Return>
    <InterfaceFunction>
    <FunctionId>1024976</FunctionId>
    </InterfaceFunction>
    </Return>
    </oans:Function_Response_body>
    </part>
    <part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="header">
    <Function_Response_header xmlns:oans="http://xmlns.oracle.com/apps/fnd/rep/ws" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    Blah
    </oans:Function_Response_header>
    </part>
    </Function_OutputVariable>
    My resultant expression becomes
    <body> 1024976 SERVICEBEAN:/oracle/apps/fnd/rep/ws/IntegrationRepositoryService:getInterfaceFunction INTERFACE get InterfaceFunction Gets a InterfaceFunction based on its primary key attributes. NONE RESP getInterfaceFunction 1 PUBLIC ACTIVE R2V0cyBhIEludGVyZmFjZUZ1bmN0aW9uIGJhc2VkIG9uIGl0cyBwcmltYXJ5IGtleSBhdHRy aWJ1dGVz S S 509 </body>
    <header> blah </header>
    How to avoid this problem? Please advice.
    thanks,
    kannan

    iPhoto Library Manager  is the only application available that can merge libraries and keep albums as well as keywords, comments, places and other meta data.    Keepsakes like books and slideshows will come across as albums.
    The following is from the iPLM help file:
    What can and can't be copied
    Due to technical limitations with iPhoto, not every type of item in an iPhoto library can be copied to another library. The table below summarized what can and can't be copied in each version of iPhoto, with more details explanations of each item below. This applies to copying albums and events between libraries via drag and drop, merging libraries, and rebuilding a library.
    iPhoto 6 or earlier
    iPhoto 7
    iPhoto 8
    iPhoto 9
    Photos with basic metadata (rating, keywords, date, description, title)
    Unsupported
    Yes
    Yes
    Yes
    Modified versions of photos paired with originals
    Unsupported
    Yes
    Yes
    Yes
    Individual photo edits (e.g. cropping, filters, color adjustments, etc.)
    Unsupported
    No
    Yes
    Yes
    Places data
    Unsupported
    n/a
    Yes
    Yes
    Faces data
    Unsupported
    n/a
    Yes
    Yes
    Regular albums
    Unsupported
    Yes
    Yes
    Yes
    Folder albums
    Unsupported
    Yes
    Yes
    Yes
    Smart albums
    Unsupported
    Yes
    Yes
    Yes
    Events
    Unsupported
    Yes
    Yes
    Yes
    Keepsake items (books, slideshows, etc.)
    Unsupported
    No
    No
    No
    MobileMe galleries
    Unsupported
    iPhoto auto-syncs
    iPhoto auto-syncs
    iPhoto auto-syncs
    Facebook/Flickr galleries
    Unsupported
    n/a
    No
    iPhoto auto-syncs
    OT

  • Remove XML tags from XML element in Oracle

    Hi,
    I have a requirement where I have to remove all the xml tags from xml element with banks, currently I'm using replace 4 times to replace all different types of xml tags, performance is really bad. is there any better option to remove xml tags from xml data leaving the actual data. please find the example data below.
    select
    TO_CLOB(REPLACE(REPLACE(REPLACE(REPLACE
    ('<Concatcolumn><ConcatGroupID>MyText Data goes here </ConcatGroupID><ConcatGroupID>Data agian</ConcatGroupID></Concatcolumn>','<ConcatGroupID>'),'<Concatcolumn>'),'</ConcatGroupID>',';'),';</Concatcolumn>')) AS Concatcolumn
    from dual
    **************Out put*************
    MyText Data goes here ;Data agian

    One way is to use xquery:
    SQL> with t as
    select xmltype('<Concatcolumn>
                          <ConcatGroupID>MyText Data goes here </ConcatGroupID><ConcatGroupID>Data agian</ConcatGroupID></Concatcolumn>'
       ) xml from dual
    select xmlquery('string-join(//text(), ";")' passing xml returning content).getclobval() xml from t
    XML                                                              
    MyText Data goes here ;Data agian                                
    1 row selected.

  • Getting unwanted values between the XML tags in XSLT mapping

    Hi Folks
    I have come across a very strange situation with my xslt mapping.
    I am getting unwated values "11" between xml tags
    as follows
    <Tag>0001</Tag>
    11
    <DataID>3</DataID>
    I am not sure why I am getting these values in between the tags. Any suggestions would be appreciated.

    Hi David,
    Here is the code fragment where these 2 tags are mapped, FYI, the source is an IDOC message. The unwanted "11" is coming After the <Tag></Tag> and <DataID></DataID>. FYI, Fof the element <Tag></Tag> its a default value. But for <DataID> </DataID>  I have the mapping logic.
    <Order>
                <OrderHeader>
                  <Tag>009</Tag>
                  <xsl:for-each select="E1EDKA1">
                    <xsl:choose>
                      <xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U960'">
       <DataID>
                        <xsl:value-of select="'1'" />
       </DataID>
                      </xsl:when>
                      <xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U300'">
       <DataID>
                        <xsl:value-of select="'3'" />
           </DataID>
                      </xsl:when>
       <xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U930'">
       <DataID>
                        <xsl:value-of select="'1'" />
       </DataID>
                      </xsl:when>
       <xsl:when test="normalize-space(PARVW) = 'WE' and normalize-space(LIFNR) = 'U400'">
       <DataID>
                        <xsl:value-of select="'3'" />
       </DataID>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:value-of select="'1'" />
                      </xsl:otherwise>
                    </xsl:choose>
                   </xsl:for-each>

  • How to remove the header tag in the XML data ?

    Hi All,
    I am sending an XML data from SFTP to Proxy, in that I want to remove the header tag (first tag) from the xml, while loading the data. how to do that ?

    Hi,
          It is not about the thing that, whether your source is XML or flat file. If you dont want some thing in your source file , dont consider it and dont map it with your target structure. think that, your not getting the header in your source.  What is the header here.
    <Emp_details>
    <Emp_Id> Employee No </Emp_Id>
    <Emp_Name> Employee Name </Emp_Name>
    </Emp_details>
    <Emp_details>
    <Emp_Id> 1234 </Emp_Id>
    <Emp_Name> xxxx </Emp_Name>
    </Emp_details>
    <Emp_details>
    <Emp_Id> 5678 </Emp_Id>
    <Emp_Name> yyy </Emp_Name>
    </Emp_details>
    you have two fields under node Emp_details. What do u want to avoid here?
    Regards,
    Reyaz

  • Remove XML tags in the File Adapter

    Hi,
    I have a JDBC to File interface. However, there is a requirement to remove some of the XML tags from XML produced by the File Adapter.
    For example,
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:MT_XML xmlns:ns0="namespace">
       <XMLIntegration>
             <Prices COLUMNS="Index, Date, Price">
             <Index>Fuel</Index>
             <Date>2007-05-01 00:00:00.0</Date>
             <Price>0</Price>
            </Prices>
          <Prices COLUMNS="Index, Date, Price"/>
      </XMLIntegration>
    </ns0:MT_XML>
    needs to be changed to
       <XMLIntegration>
             <Prices COLUMNS="Index, Date, Price">
             Fuel, 2007-05-01 00:00:00.0, 120.65
            </Prices>
      </XMLIntegration>
    Does anyone know how to do this? I'm using the File Content Conversion Message Protocol but I'm not having much success

    hi,
    you just need to have this:
    <XMLIntegration>
             <Prices COLUMNS="Index, Date, Price">
             Fuel, 2007-05-01 00:00:00.0, 120.65
            </Prices>
      </XMLIntegration>
    as your target message in your mapping
    and map all values to Prices tag
    you don't need no content conversion - just the mapping
    Regards,
    michal

  • How to remove xmlns attribute from XML tag?

    Hello!
    I have a XMLType document:
    --- P R O B L E M # 1 ---
    <?xml version="1.0" encoding="windows-1257" ?>
    <RESPONSE xmlns="http://testserver" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://testserver response.xsd">
    <DATA REQUEST_ID="111">
    <ENTITY name="PACKAGE_001">
    <ATTRIBUTE name="PERS_ID" value="1111" />
    <ATTRIBUTE name="FIRST_NAME" value="OLGA" />
    <ATTRIBUTE name="SURNAME" value="NOVIKOVA" />
    </ENTITY>
    </DATA>
    </RESPONSE>
    I very need to remove from RESPONSE tag all addition information. Result I need is:
    <?xml version="1.0" encoding="windows-1257" ?>
    <RESPONSE>
    <DATA REQUEST_ID="111">
    <ENTITY name="PACKAGE_001">
    <ATTRIBUTE name="PERS_ID" value="1111" />
    <ATTRIBUTE name="FIRST_NAME" value="OLGA" />
    <ATTRIBUTE name="SURNAME" value="NOVIKOVA" />
    </ENTITY>
    </DATA>
    </RESPONSE>
    What can I do in this situation? My Oracle version is 9.2.
    --- P R O B L E M # 2 ---
    How I can create from source XML this one:
    <?xml version="1.0" encoding="windows-1257" ?>
    <MY_RESPONSE>
    <RESPONSE xmlns="http://testserver" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://testserver response.xsd">
    <DATA REQUEST_ID="111">
    <ENTITY name="PACKAGE_001">
    <ATTRIBUTE name="PERS_ID" value="1111" />
    <ATTRIBUTE name="FIRST_NAME" value="OLGA" />
    <ATTRIBUTE name="SURNAME" value="NOVIKOVA" />
    </ENTITY>
    </DATA>
    </RESPONSE>
    </MY_RESPONSE>
    Thanks for your answers!
    Flu

    Maybe the problem#1 can be solved with a simple pl/sql using REPLACE statement. start with the <RESPONSE and look for the end > and get the entire string and replace that with only <RESPONSE> or maybe you can achieve this using xmldom to delete the attributes as part of the element.
    PRoblem#2 can be solved in this way.
    select xmlelement("MY_RESPONSE",
    xmltype('<RESPONSE xmlns="http://testserver" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://testserver response.xsd">
    <DATA REQUEST_ID="111">
    <ENTITY name="PACKAGE_001">
    <ATTRIBUTE name="PERS_ID" value="1111" />
    <ATTRIBUTE name="FIRST_NAME" value="OLGA" />
    <ATTRIBUTE name="SURNAME" value="NOVIKOVA" />
    </ENTITY>
    </DATA>
    </RESPONSE>')).GetClobVal()
    from dual
    /

  • Remove the unnecessary tags in XML using PL/SQL

    Hi Friends
    from the below XML, its generate by a complex SQL query, Now we need to remove all the object type tags, and all the empty tags.
    Version - PL/SQL Release 11.2.0.3.0 - Production
    <MajorLine>
        <MAJOR_LINE_OBJECT_TYPE> -- Need to remove these Objects types showing in the XML
            <LINEID>143424538</LINEID>
            <ITEMNAME>TC-ABC-123</ITEMNAME>
            <ITEMPATH>78245</ITEMPATH>
            <QUANTITY>10</QUANTITY>
            <SERVICELINE/> -- Need to remove all the Empty tags
            <MINORLINE>
                <MINOR_LINE_OBJECT_TYPE> -- Need to remove these Objects types showing in the XML
                    <LINEID>143424799</LINEID>
                    <ITEMNAME>TCC-abc</ITEMNAME>
                    <ITEMPATH>78245</ITEMPATH>
                    <QUANTITY>10</QUANTITY>
                    <SERVICELINE/>-- Need to remove all the Empty tags
                    <MINOR_MINOR_LINES>
                        <M_MINOR_LINE_TYPE> -- Need to remove these Objects types showing in the XML
                            <LINEID>143424798</LINEID>
                            <ITEMNAME>SF15-abc-xyz</ITEMNAME>
                            <ITEMPATH>78245</ITEMPATH>
                            <QUANTITY>10</QUANTITY>
                      </M_MINOR_LINE_TYPE>-- Need to remove these Objects types showing in the XML
                    </MINOR_MINOR_LINES>
                </MINOR_LINE_OBJECT_TYPE>--Need to remove these Objects types showing in the XML
            </MINORLINE>
        </MAJOR_LINE_OBJECT_TYPE>-- Need to remove these Objects types showing in the XML
    </MajorLine>
    i tried one of the queries posted in this blog ,PFB  to remove the empty tags , but it didnt work for me unfortunately. Please help.
    PFB
    WITH sample_data AS (
      SELECT xmltype('<MajorLine>
        <MAJOR_LINE_OBJECT_TYPE>
            <LINEID>143424538</LINEID>
            <ITEMNAME>hijk</ITEMNAME>
            <ITEMPATH>78245</ITEMPATH>
            <QUANTITY>10</QUANTITY>
            <SERVICELINE/>
            <MINORLINE>
                <MINOR_LINE_OBJECT_TYPE>
                    <LINEID>143424799</LINEID>
                    <ITEMNAME>efg</ITEMNAME>
                    <ITEMPATH>78245</ITEMPATH>
                    <QUANTITY>10</QUANTITY>
                    <SERVICELINE/>
                    <MINOR_MINOR_LINES>
                        <M_MINOR_LINE_TYPE>
                            <LINEID>143424798</LINEID>
                            <ITEMNAME>abc</ITEMNAME>
                            <ITEMPATH>78245</ITEMPATH>
                            <QUANTITY>10</QUANTITY>
                        </M_MINOR_LINE_TYPE>
                    </MINOR_MINOR_LINES>
                </MINOR_LINE_OBJECT_TYPE>
            </MINORLINE>
        </MAJOR_LINE_OBJECT_TYPE>
    </MajorLine>') xmldoc
      FROM dual
    SELECT deleteXML( t.xmldoc
                    , '/MajorLine/*[.="" or contains(.,"?")]'
                    ) as result
    FROM sample_data t
    My email ID is [email protected] -- You can reach me
    thanks in advance ... Arun thomas T

    Hey Odie. Great to see you again, the query is
    SELECT XMLELEMENT (
              "MajorLine",
              major_line_object_type (
    oola_major.line_id,
    oola_major.ordered_item,
    oola_major.header_id,
    oola_major.ordered_quantity,
                 CAST (
                    MULTISET (
                       SELECT oola_ser.line_id,
    oola_ser.ordered_item,
    --oola_ser.header_id,
    oola_ser.ordered_quantity,
    CAST (
                                 MULTISET (
    SELECT oola_ser2.service_start_date,
    oola_ser2.service_end_date,
    oola_ser2.service_duration
                                      FROM oe_order_lines_all oola_ser2
                                     WHERE oola_major.line_id =
    oola_ser2.service_reference_line_id
                                           AND oola_ser2.header_id =
    oola_major.header_id) AS service_period_table_type)
    FROM oe_order_lines_all oola_ser
                        WHERE oola_major.line_id =
                                 oola_ser.service_reference_line_id
    AND oola_ser.header_id = oola_major.header_id) --As of now excluding cross order service line
    AS SERVICE_TABLE_TYPE),
                 CAST (
                    MULTISET (
                       SELECT oola_minor.line_id,
    oola_minor.ordered_item,
    oola_minor.header_id,
    oola_minor.ordered_quantity,
    CAST (
                                 MULTISET (
                                    SELECT oola_ser1.line_id,
    oola_ser1.ordered_item,
                                           -- oola_ser1.header_id,
    oola_ser1.ordered_quantity,
                                           CAST (
                                              MULTISET (
                                                 SELECT oola_ser3.
    service_start_date,
    oola_ser3.
    service_end_date,
    oola_ser3.
    service_duration
                                                   FROM oe_order_lines_all oola_ser3
                                                  WHERE oola_minor.line_id =
    oola_ser3.
    service_reference_line_id
    AND oola_ser3.header_id =
    oola_major.
    header_id) AS service_period_table_type)
                                      FROM oe_order_lines_all oola_ser1
                                     WHERE oola_minor.line_id =
    oola_ser1.service_reference_line_id
                                           AND oola_ser1.header_id =
    oola_major.header_id) --As of now excluding cross order service line
    AS SERVICE_TABLE_TYPE),
    CAST (
                                 MULTISET (
                                    SELECT oola_minor_m.line_id,
    oola_minor_m.ordered_item,
                                           oola_minor_m.header_id,
    oola_minor_m.ordered_quantity
                                      FROM oe_order_lines_all oola_minor_m
                                     WHERE oola_minor.line_id =
                                              oola_minor_m.link_to_line_id
                                           AND oola_minor_m.header_id =
    oola_major.header_id) --As of now excluding cross order service line
                                                                       AS m_minor_line_table_type)
    FROM oe_order_lines_all oola_minor
                        WHERE    --oola_minor.top_model_line_id=oola_major.line_id
    oola_minor.link_to_line_id = oola_major.line_id
    AND oola_minor.header_id = oola_major.header_id
    AND oola_minor.item_type_code != 'SERVICE') AS MINOR_LINE_TABLE_TYPE)))
              AS "XMLOutput"
      FROM oe_order_lines_all oola_major
    WHERE oola_major.line_id = 143424538 AND oola_major.link_to_line_id IS NULL;
    can we rewirte it to get the desired out put ..
    Desired output is Just remove the Object_type tags and empty tags coming in the output xml.
    The previous issues i mentioned are not solved yet  . actually will update the challenges ..
    Odie .. thanks.. again

  • XML tag to be removed

    Hi all
    I have a XML file and i wanted to remove the first tag
    <Message> and </Message> from the file.
    <Message><ABC_RD_PRJ_Team xmlns="http://www.ABC.com/RD/ProjectManagement" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ABC.com/RD/ProjectManagement http://rtpsalxv1117.corpnet2.com:8000/bdev/xsd/ABC_RD_PRJ_Team_v1.xsd"><TeamMessage Message_Id="PROJECT_TEAM"><Header><SourceEAN>PDM</SourceEAN><DestinationEAN>PDR</DestinationEAN></Header><Team><TeamId>2739</TeamId><TeamName>51548_Project_Team</TeamName><TeamDescription>51548_Project_Team</TeamDescription><TeamType><Id>URN:LSID:ABC.com/rd:item.DEX:59589</Id><ShortName>Project</ShortName><LongName>Project</LongName><PreferredName>Project</PreferredName></TeamType><CreateDate>2010-12-07T16:11:20</CreateDate><CreateUser>MML83208</CreateUser><ModifyDate>2010-12-07T16:11:20</ModifyDate><ModifyUser>MML83208</ModifyUser><TransactionType>I</TransactionType></Team><Trailer><thisDocumentGenerationDateTime>2010-12-09T13:09:01-05:00</thisDocumentGenerationDateTime><thisDocumentIdentifier>20101209130901</thisDocumentIdentifier></Trailer></TeamMessage></ABC_RD_PRJ_Team></Message>
    and it should look like this.
    <ABC_RD_PRJ_Team xmlns="http://www.ABC.com/RD/ProjectManagement" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ABC.com/RD/ProjectManagement http://rtpsalxv1117.corpnet2.com:8000/bdev/xsd/ABC_RD_PRJ_Team_v1.xsd"><TeamMessage Message_Id="PROJECT_TEAM"><Header><SourceEAN>PDM</SourceEAN><DestinationEAN>PDR</DestinationEAN></Header><Team><TeamId>2739</TeamId><TeamName>51548_Project_Team</TeamName><TeamDescription>51548_Project_Team</TeamDescription><TeamType><Id>URN:LSID:ABC.com/rd:item.DEX:59589</Id><ShortName>Project</ShortName><LongName>Project</LongName><PreferredName>Project</PreferredName></TeamType><CreateDate>2010-12-07T16:11:20</CreateDate><CreateUser>MML83208</CreateUser><ModifyDate>2010-12-07T16:11:20</ModifyDate><ModifyUser>MML83208</ModifyUser><TransactionType>I</TransactionType></Team><Trailer><thisDocumentGenerationDateTime>2010-12-09T13:09:01-05:00</thisDocumentGenerationDateTime><thisDocumentIdentifier>20101209130901</thisDocumentIdentifier></Trailer></TeamMessage></ABC_RD_PRJ_Team>
    Please help
    Edited by: 787819 on Dec 16, 2010 11:47 AM

    If stored in an XMLType column in a table (I think this is what you have but you left off a lot of details)
    SELECT first_nd
       FROM XMLTable('/Message'
                     PASSING XMLTYPE('<Message>
         <ABC_RD_PRJ_Team xmlns="http://www.ABC.com/RD/ProjectManagement" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ABC.com/RD/ProjectManagement http://rtpsalxv1117.corpnet2.com:8000/bdev/xsd/ABC_RD_PRJ_Team_v1.xsd">
              <TeamMessage Message_Id="PROJECT_TEAM">
                   <Header>
                        <SourceEAN>PDM</SourceEAN>
                        <DestinationEAN>PDR</DestinationEAN>
                   </Header>
                   <Team>
                        <TeamId>2739</TeamId>
                        <TeamName>51548_Project_Team</TeamName>
                        <TeamDescription>51548_Project_Team</TeamDescription>
                        <TeamType>
                             <Id>URN:LSID:ABC.com/rd:item.DEX:59589</Id>
                             <ShortName>Project</ShortName>
                             <LongName>Project</LongName>
                             <PreferredName>Project</PreferredName>
                        </TeamType>
                        <CreateDate>2010-12-07T16:11:20</CreateDate>
                        <CreateUser>MML83208</CreateUser>
                        <ModifyDate>2010-12-07T16:11:20</ModifyDate>
                        <ModifyUser>MML83208</ModifyUser>
                        <TransactionType>I</TransactionType>
                   </Team>
                   <Trailer>
                        <thisDocumentGenerationDateTime>2010-12-09T13:09:01-05:00</thisDocumentGenerationDateTime>
                <thisDocumentIdentifier>20101209130901</thisDocumentIdentifier>
             </Trailer>
          </TeamMessage>
       </ABC_RD_PRJ_Team>
    </Message>')  -- your table.column instead of XMLType('') hardcoding
                     COLUMNS
                     first_nd   XMLTYPE PATH '*');If in an XMLType in PL/SQL code it can also be done via
    declare
      -- Local variables here
      l_xmltype  XMLTYPE;
      l_xml1     XMLTYPE;
    begin
      -- Test statements here
      l_xmltype := XMLTYPE('<Message>
       <ABC_RD_PRJ_Team xmlns="http://www.ABC.com/RD/ProjectManagement" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ABC.com/RD/ProjectManagement http://rtpsalxv1117.corpnet2.com:8000/bdev/xsd/ABC_RD_PRJ_Team_v1.xsd">
          <TeamMessage Message_Id="PROJECT_TEAM">
             <Header>
                <SourceEAN>PDM</SourceEAN>
                <DestinationEAN>PDR</DestinationEAN>
             </Header>
             <Team>
                <TeamId>2739</TeamId>
                <TeamName>51548_Project_Team</TeamName>
                <TeamDescription>51548_Project_Team</TeamDescription>
                <TeamType>
                   <Id>URN:LSID:ABC.com/rd:item.DEX:59589</Id>
                   <ShortName>Project</ShortName>
                   <LongName>Project</LongName>
                   <PreferredName>Project</PreferredName>
                </TeamType>
                <CreateDate>2010-12-07T16:11:20</CreateDate>
                <CreateUser>MML83208</CreateUser>
                <ModifyDate>2010-12-07T16:11:20</ModifyDate>
                <ModifyUser>MML83208</ModifyUser>
                <TransactionType>I</TransactionType>
             </Team>
             <Trailer>
                <thisDocumentGenerationDateTime>2010-12-09T13:09:01-05:00</thisDocumentGenerationDateTime>
                <thisDocumentIdentifier>20101209130901</thisDocumentIdentifier>
             </Trailer>
          </TeamMessage>
       </ABC_RD_PRJ_Team>
    </Message>');
       l_xml1 := l_xmltype.extract('/Message/*');
       dbms_output.put_line(l_xml1.getClobVal());  -- to show you what it returned
    end;

Maybe you are looking for