Need to exclude the empty elements after mapping in xslt.

Hi Team,
I have a requirement. I need to invoke a wsdl which will have some po details. I'm using transformation to map the value from my local bpel variable to invoke variable. It is mostly a one-one mapping. no functions no looping and no complex transformation. Now the requirement is that I need to only send the elements which has the value also to add, there is no particular element which can be empty. There can be three elements empty or four or any. I need to map all and then I need to send only the elements those has values. Below is my mapping.
<?xml version="1.0" encoding="UTF-8" ?>
<?oracle-xsl-mapper <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
  <mapSources>
    <source type="XSD">
      <schema location="POTest.xsd"/>
      <rootElement name="POTestProcessResponse" namespace="http://xmlns.oracle.com/POTest"/>
    </source>
  </mapSources>
  <mapTargets>
    <target type="XSD">
      <schema location="POTest.xsd"/>
      <rootElement name="POTestProcessResponse" namespace="http://xmlns.oracle.com/POTest"/>
    </target>
  </mapTargets>
  <!-- GENERATED BY ORACLE XSL MAPPER 10.1.3.3.0(build 070615.0525) AT [THU OCT 17 10:53:26 GMT 2013]. -->
?>
<xsl:stylesheet version="1.0"
                xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
                xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
                xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
                xmlns:ns1="http://xmlns.oracle.com/POTest"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:ora="http://schemas.oracle.com/xpath/extension"
                xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
                xmlns:ns0="http://www.w3.org/2001/XMLSchema"
                xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
                xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
                xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
                exclude-result-prefixes="xsl ns1 ns0 xref xp20 bpws ora ehdr orcl ids hwf">
  <xsl:template match="/">
    <ns1:POTestProcessResponse>
      <xsl:attribute name="OrderDate">
        <xsl:value-of select="/ns1:POTestProcessResponse/@OrderDate"/>
      </xsl:attribute>
      <ns1:name>
        <xsl:value-of select="/ns1:POTestProcessResponse/ns1:name"/>
      </ns1:name>
      <ns1:street>
        <xsl:value-of select="/ns1:POTestProcessResponse/ns1:street"/>
      </ns1:street>
      <ns1:city>
        <xsl:value-of select="/ns1:POTestProcessResponse/ns1:city"/>
      </ns1:city>
      <ns1:state>
        <xsl:value-of select="/ns1:POTestProcessResponse/ns1:state"/>
      </ns1:state>
      <ns1:zip>
        <xsl:value-of select="/ns1:POTestProcessResponse/ns1:zip"/>
      </ns1:zip>
    </ns1:POTestProcessResponse>
  </xsl:template>
  </xsl:stylesheet>
Here I just mentioned only some elements but there are lot of other elements which can also be empty. If I keep on putting an if condition for each and every element it will messup the code. which I don't want to do due to lot of elements that needs to be checked. I tried with following templates.
1)
<xsl:template match="*[not(child::node())]"/>
  <xsl:template match="@*|node()">
<xsl:if test=". != '' or ./@* != ''">
   <xsl:copy>
     <xsl:apply-templates select="@*|node()" />
   </xsl:copy>
</xsl:if>
</xsl:template>
2)
<xsl:output omit-xml-declaration="yes" indent="yes"/>
  <xsl:strip-space elements="*"/>
  <xsl:template match="node()|@*">
    <xsl:copy>
      <xsl:apply-templates select="node()|@*"/>
    </xsl:copy>
  </xsl:template>
  <xsl:template match="*[not(node())]
  |
   *[not(node()[2])
   and
     node()/self::text()
   and
     not(normalize-space())
  "/>
3)
<xsl:template match="/">
    <xsl:apply-templates select="*"/>
  </xsl:template>
  <xsl:template match="*">
    <xsl:if test=". != ''">
      <xsl:copy>
        <xsl:element name="name()">
          <xsl:copy-of select="@*"/>
          <xsl:apply-templates/>
        </xsl:element>
      </xsl:copy>
    </xsl:if>
  </xsl:template>
But none of them is working. Kindly help. It is the only issue which is blocking.
Help is greatly appreciated.
Regards,
Venkatesh.

I received the following errors:
  Line Number:(55) : Error: "xsl:strip-space" XSL Element Currently not Supported
  Line Number:(31) : Error: <xsl:template match="/"> and <xsl:template name="..."> are the only permitted <template> elements in the XSL
  Line Number:(53) : Error: <xsl:template match="/"> and <xsl:template name="..."> are the only permitted <template> elements in the XSL
  Line Number:(56) : Error: <xsl:template match="/"> and <xsl:template name="..."> are the only permitted <template> elements in the XSL
Below is the complete transformation code.:
<?xml version="1.0" encoding="UTF-8" ?>
<?oracle-xsl-mapper
  <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
  <mapSources>
    <source type="XSD">
      <schema location="POTest.xsd"/>
      <rootElement name="POTestProcessRequest" namespace="http://xmlns.oracle.com/POTest"/>
    </source>
  </mapSources>
  <mapTargets>
    <target type="XSD">
      <schema location="POTest.xsd"/>
      <rootElement name="POTestProcessResponse" namespace="http://xmlns.oracle.com/POTest"/>
    </target>
  </mapTargets>
  <!-- GENERATED BY ORACLE XSL MAPPER 10.1.3.3.0(build 070615.0525) AT [THU OCT 17 10:20:35 GMT 2013]. -->
?>
<xsl:stylesheet version="1.0"
                xmlns:xref="http://www.oracle.com/XSL/Transform/java/oracle.tip.xref.xpath.XRefXPathFunctions"
                xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
                xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
                xmlns:ns1="http://xmlns.oracle.com/POTest"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:ora="http://schemas.oracle.com/xpath/extension"
                xmlns:ehdr="http://www.oracle.com/XSL/Transform/java/oracle.tip.esb.server.headers.ESBHeaderFunctions"
                xmlns:ns0="http://www.w3.org/2001/XMLSchema"
                xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
                xmlns:ids="http://xmlns.oracle.com/bpel/services/IdentityService/xpath"
                xmlns:hwf="http://xmlns.oracle.com/bpel/workflow/xpath"
                exclude-result-prefixes="xsl ns1 ns0 xref xp20 bpws ora ehdr orcl ids hwf">
  <xsl:template match="/">
      <ns1:POTestProcessResponse>
      <xsl:attribute name="OrderDate">
        <xsl:value-of select="/ns1:POTestProcessRequest/@OrderDate"/>
      </xsl:attribute>
      <ns1:name>
        <xsl:value-of select="/ns1:POTestProcessRequest/ns1:name"/>
      </ns1:name>
      <ns1:street>
        <xsl:value-of select="/ns1:POTestProcessRequest/ns1:street"/>
      </ns1:street>
      <ns1:city>
        <xsl:value-of select="/ns1:POTestProcessRequest/ns1:city"/>
      </ns1:city>
      <ns1:state>
        <xsl:value-of select="/ns1:POTestProcessRequest/ns1:state"/>
      </ns1:state>
      <ns1:zip>
        <xsl:value-of select="/ns1:POTestProcessRequest/ns1:zip"/>
      </ns1:zip>
    </ns1:POTestProcessResponse>
  </xsl:template>
    <xsl:strip-space elements="*" />
<xsl:template match="*">
<xsl:if test=".!='' or count(@*)!=0">
  <xsl:copy>
   <xsl:apply-templates select="*|@*|text()" />
  </xsl:copy>
</xsl:if>
</xsl:template>
<xsl:template match="@*">
<xsl:copy-of select="." />
</xsl:template>
<xsl:template match="text()">
<xsl:value-of select="." />
</xsl:template>
</xsl:stylesheet>

Similar Messages

  • I need to Delete the empty space page of report

    I need to Delete the empty space page of report 
    http://imageshack.com/a/img540/191/nrOwz6.jpg
    I Need Help!!
    Thanks

    Hi yha10,
    Per my understanding that you want to add one textbox at the bottom of the tablix and make it display as the last on each page after the tablix, you have try to add the page footer but if there is little record in the report you will got some space between
    the report footer and the last row of the tablix, right?
    If you don't want to display the space and I suggest you don't use the report footer and you can take reference to the details information below to display the information as the last row of the tablix on each page:
    Right click the Details in the Row Group and select to Add Group-->Parent Group:
    and add this expression in the Group By:
    =Ceiling(RowNumber(Nothing)/10)
    (10 is the number of rows you want to display on each page)
    Right click the row group to select the "Group Properties" and add page break by check the "Between each instance of a group":
    Right click the first column which the Group located and select the Insert Row-Inside Group-Below:
    Select the Entire Column1(Group) and delete columns:
    Merge the entire last Row and type the information "I need to show on all the page" in it:
    If you still have nay problem, please feel free to ask.
    Regards,
    Vicky Liu
    Vicky Liu
    TechNet Community Support

  • My Logitech bluetooth laser travel mouse does not connect at startup to my recently upgraded iMac. Even when this is configured. I need to configure the mouse everytime after startup!!

    My Logitech bluetooth laser travel mouse does not connect at startup to my recently upgraded iMac. Even when this is configured. I need to configure the mouse everytime after startup!!... It worked fine with previous OS X .... How can I fix this??

    My Logitech bluetooth laser travel mouse does not connect at startup to my recently upgraded iMac. Even when this is configured. I need to configure the mouse everytime after startup!!... It worked fine with previous OS X .... How can I fix this??

  • I would like to be able to start typing a URL directly (with no need to clear the field first) after opening a new tab with my homepage...

    I've just installed the newest desktop version of the Firefox browser because my Opera doesn't feel very well these days. I'm trying to become friends with Firefox, and that's why I've changed the new tab settings in order to have my offline homepage loaded every time I open a new tab. There is an inconvenience — when I press Ctrl+T, the cursor appears at the end of the URL. It means that when I start typing, the letters show in the address bar after the URL of my homepage, so what I need is to clear the field first.
    Is there a way to get rid of this? (If it helpes, I'm currently using Windows 7.)
    I would appreciate if I could just press Ctrl+T, type a URL, and press Enter when I want to go to a website different from my homepage. Thank you for your replies!

    Then you can use (Ctrl+L and) Ctrl+A to select all the text in the location bar or Shift+Home/End.

  • Need info on the request elements of OSM CreateOrderBySpecification websvc

    We are planning to develop integration from siebel to osm using AIA . We are creating the mapping for OSM webservice called CreateOrderBySpecification which will create order in osm.The request of CreateOrderBySpecification webservice have an element called Data(of type xsd:add) which will included another xml in it and is dependent on the details of order specification which is also a part of request itself.Could anyone help us in what will be the content(i.e, the content of xml) of the data element of the request for CreateOrderBySpecification and how it will be decided, and what will be the corresponding fields in siebel from where we can get these values.

    Hi,
    The answers you seek are all in Siebel bookshelf:
    Question 1: http://download.oracle.com/docs/cd/E14004_01/books/SystAdm/SystAdm_SrvrCompParam7.html#wp1008245
    Question 2: http://download.oracle.com/docs/cd/E14004_01/books/SystAdm/SystAdm_SrvrInfAdm.html#wp1003500
    Regards,
    mroshaw

  • Why does imovie need to keep the original file after I have edited?

    I record basketball games with my ipad and I keep the footage but cut the video so I can make highlights for the season. Thing is, these original videos are usually close to 10GB each and over an hour long.
    I might have 5 minutes of highlights when Im done.
    So to save space in my Imovie projects, I kept the clips i want and deleted the videos. When I came back to add more video to my season project, it said missing file.
    Does it need to save the entire original media after I cut the video? I dont want to keep every game on my computer, I just want to keep what I cut and throw the rest out. But Imovie is asking for the original file.
    Any solutions for this, or do I need to upgrade to a more professional editor?

    Hi
    You are using a - Non Destructing Video Editing program.
    Meaning that Your movie in making ==> Project - DO NOT contain any movie or material at all - BUT only a text document pointing to where material is stored e.g. folder iMovie Event's, other hard disks, DVDs, CDs or USB-memories.
    And if any of these storage's are moved or disconnected - iMovie get's lost and can not View Your Project.
    iMovie - do not have any "Media Managing Function" as FinalCut Pro (as it can reconnect moved material and create a complete contaning folder)
    Even when You Shared Your movie - there still will be links back to material - to make it possibly to further editing's, and Sharing in other resolutions.
    This is the cost of working this way. So I use an external hard disk for storage
    - MUST BE - Mac OS Extended (hfs) formatted - UNIX/DOS/FAT32/Mac OS Exchange will not work for VIDEO
    - Moving Video Event's - MUST BE DONE WITHIN iMovie Application - ELSE connections will be broken - meaning HARD to IMPOSSIBLY to mend later. Be aware !
    All other material I store in Folders named as movie project + date - all from start on the external Drive.
    Yours Bengt W

  • Can I reinstall the ps element after uninstallation?

    I bought the ps element 13 recently and installed it on my computer. Today I uninstalled it and want to reinstall it again but failed to activate the installation after inputting the serial no. How can i solve it?

    Hi liangliang11,
    Did you get any error message while installing the software.
    Some links:
    http://helpx.adobe.com/x-productkb/policy-pricing/activation-deactivation-products.html
    http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    Regards,
    Nikhil Gupta.

  • I need to get the complete element including tag. How to parse this xml?

    I am sure there should be some solution to this. I have XML file like this
    <test>
    <data value="123" color="RED">
    <type>single</type>
    </data>
    <data value="13323" color="BLUE">
    <type>double</type>
    </data>
    </test>
    I need to parse this XML and get the data element(s). The problem is that I need to get the complete data element include tags like
    "<data value="123" color="RED"><type>single</type></data>". I need to parse the complete XML file and get every data element including tag and send it to another upstream process.
    Any solution to this will be appreciated. I am little familiar with SAX. Is there any solution around using xerces SAX parser.
    Other solution is also appreciated.
    Thanks

        DocumentBuilder builder = factory.newDocumentBuilder();
        document = builder.parse(srcFile);
        NodeList list = document.getElementsByTagName("data");
        Node node = list.item(0); // Loop this
        TransformerFactory tFactory = TransformerFactory.newInstance();
        Transformer transformer = tFactory.newTransformer();
        DOMSource source = new DOMSource(node);
        StreamResult result = new StreamResult(outputstream);
        transformer.transform(source, result);
    Using XSLT will be lot easier.No it won't. Extending DefaultHandler is easy.Do you really think so?
    Hardly 10-15 lines.

  • Do I need to resize the sparsebundle file after migrating to new larger AirPort Time Capsule?

    Just upgraded my Airport Time Capsule from an old 1TB to a new 2TB version.
    I have migrated the sparse.bundle file by using the ethernet method but now I want to know if I need to resize the file using Disk Utility or does it happen automatically? If it doesn't resize automatically then Apple should at least have some option to automate this process as it seems a natural request.
    Over time people would want to continue using their same old back up and just allow the file to get bigger as it is moved onto a newer larger device and still have access to all the previous old backups all on one device/system.

    It should continue to resize automatically or would if Yosemite worked properly.. since TM in Yosemite is lousy it might well need you to fix it.. It isn't hard.
    See Pondini A8 here.
    http://pondini.org/TM/Troubleshooting.html

  • What steps are needed to configure the apps tier after a db-only clone?

    Hello Gurus.
    My client wants to save time on cloning, and has asked for database only refresh - meaning that we dont clone to the application tier, but only to the database.
    What steps must be taken once the db clone has completed? Need I run autoconfig? What about all the profiles that will be pointing to LIVE in the database?
    Thanks.
    DA

    hi Dan
    this is covered in the Rapid Clone documents -- Refreshing a Target System
    Note: 230672.1 - Cloning Oracle Applications Release 11i with Rapid Clone
    Note: 406982.1 - Cloning Oracle Applications Release 12 with Rapid Clone
    you should run adautocfg.sh on the application tier as well. Otherwise the essential information regarding your application tier will not be registered within the database and you will not be able to connect to your database through the application.
    adcfgclone will not be necessary on the application tier.
    Yes, you need to run AutoConfig to populate FND_NODES with the application nodes information. You may also need to clear the FND_NODES table as described in the following note:
    Note: 260887.1 - Steps to Clean Nonexistent Nodes or IP Addresses from FND_NODES
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=260887.1
    source;- https://forums.oracle.com/thread/652681
    AppsMasti
    Sharing is Caring

  • Can we change the cost element after posted some expenditures.

    Hi friends,
    My client ran the depreciation upto jan 2009, afterthat we found the depreciation GL's are not set the cost element.
    so the Depreciation values were not posted cost center wise, now we want to change the GL's cost element , is it possible, if it is possible what is the steps.
    with regds
    muthuraj.g

    Yes,
    You can create cost element and interface depreciation posting to CO. For missed Depreciation, manual posting in CO can help to reconcile with FI.

  • NS0 namespace in every element after mapping

    Hi All,
    We have a scenario IDOC --> XML file on a file share. I created a free style data type for the XML message and the mapping objects. When I test the message mapping, every XML element gets the ns0 namespace before the tagname. The namespace prefix is ok to be mentioned on a root level, but not with every element. Can we configure something that this behavior is not occuring anymore?
    Example current result:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:OrderCreateNotification xmlns:ns0="urn:mc-nl:procurement:boras:boras">
    <ns0:OrderNumber>4550000037</ns0:OrderNumber>
    <ns0:DocumentDate>20140722</ns0:DocumentDate>
    <ns0:OrderItem>
         <ns0:ItemNumber>00001</ns0:ItemNumber>
         <ns0:Unit>ST</ns0:Unit>
         <ns0:Quantity>100.000</ns0:Quantity>
         <ns0:NettPrice>10000</ns0:NettPrice>
         <ns0:PurchaseRequisitionItemNumber>00000</ns0:PurchaseRequisitionItemNumber>
         <ns0:TaxRate>21.00</ns0:TaxRate>
    </ns0:OrderItem>
    </ns0:OrderCreateNotification>
    I expected to have it like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:OrderCreateNotification xmlns:ns0="urn:mc-nl:procurement:boras:boras">
    <OrderNumber>4550000037</OrderNumber>
    <DocumentDate>20140722</DocumentDate>
    <OrderItem>
         <ItemNumber>00001</ItemNumber>
         <Unit>ST</Unit>
         <Quantity>100.000</Quantity>
         <NettPrice>10000</NettPrice>
         <PurchaseRequisitionItemNumber>00000</PurchaseRequisitionItemNumber>
         <TaxRate>21.00</TaxRate>
    </OrderItem>
    </ns0:OrderCreateNotification>
    With the data type it is possible to define the property "qualify schema", but it doesn't seem to do anything.
    I know of the possibility to use the XML Anonimizer module, but I was hoping that we can configure this in a standard way.
    kind regards,
    Mark

    Hi All,
    Issue was solved by defining the value "None" in the Qualify Schema option + reimporting the message types into the message mapping after making the Qualify Schema change. The XML structures didn't got refreshed automatically.
    Everything is working normally now with the ns prefix only on root level.
    Regards,
    Mark

  • I am building a new PC and need to swap the PS Elements 10 Licence from the old machine to the new - the old machine will be scrapped

    I am building a replacement PC, and want to install PS Elements 10 on the new machine. It is currently on the old machine and that machine will be scrapped once the new one is running - how do i go about this ?

    You are allowed to have the software installed and activated on two machines, but since you are scrapping the current one, you should deactivate the software on it if you are able to.... open the program and choose Help -> Deactivate.   If you are not able to access the machine to do this, then you should contact Adobe Support by chat or phone and have them do it.... Contact Customer Care
    All you need to do is install the software on the new machine (assuming it is compatible).  If you need to download PSE10 you can find it thru the following page...
    Download Photoshop Elements products | 11, 10
    You will need the serial number to activate the software.  If you do not have it at hand, you might be able to find it in your Adobe account online.
    To locate the serial number:
    http://helpx.adobe.com/x-productkb/global/find-serial-number.html

  • Need to retain the screen input after user clicks BACK

    Hi,
    I have a report program in HR, using LDB "PNP" and Report category : PSSPCDOC.
    After the program is executed and the report is displayed on screen, if the user clicks the BACK button (F3), the selection screen is displayed with initial values. The input values provided by the user previously get lost.
    I debugged and it seems that the memory gets cleared everytime the BACK button is clicked.
    But i want to retain the user inputs on the selection screen if the user clicks the BACK button because the user wants to change some selection inputs not all.
    I am new to HR module, please let me know how to solve this issue.

    Hi,
    In your screen in the application bar,the right most button  is a coloured monitor kind of icon, next to the Help icon (which is a white question mark in a yellow circle) ,click on this monitor icon ,then under the  Local Data tab there is a History Block, select radio button History ON.
    I hope it helps.
    Regards,
    Shraddha

  • HT201186 Fails to note the need to click the magic mouse after replacing batteries.

    It might be necessary to click the magic mouse to get it to reconnect after changing batteries.
    That has always been the case with my 2014 iMac and magic mouse that came with the iMac.

    Send your feedback directly to Apple » http://www.apple.com/feedback/magicmouse.html

Maybe you are looking for

  • PLD's are not showing the Indian Rupee Sign

    Hi All ! I have an issue with Indian Rupee sign . Using SAP 8.8 PL: 15 I have configured the Rupee Forbidden Font in the Currency setting / Fonts / Local Currency . The System forms are returning the correct logo of Rupee , but the Layouts with PLD's

  • How to create an dialog "SAPoffice express info" in ABAP?

    Hi all, We would like to create a dialog "SAPoffice express info" to remind the relevant user that he must immediately check his new SAP mail in inbox. We see SAP system sometimes send a dialog "SAPoffice express inof" for this same purpose. For exam

  • I have an error ora-04031 on XE 11g

    hello, I have an error ora-04031 on XE 11g When I restart DB, this error is fixed. Can I set any parameter(SHARED_POOL_SIZE) to fixed this error? OS:win 2003 server ora-00604: error occurred at recursive SQL level 1 ora-04031: unable to allocate 4064

  • Oracle Killed Sessions

    Hello everybody i have installed oracle database 10g on Unix and Oracle application server on Windows. I have configured Oracle to use 90% of the total Ram on the unix server. When an unexpected shutdown of the Oracle Application server happens , the

  • Event triggering problem

    Hi Coders, I am building a gui application which drags and drops custom objects. Initially i am dragging an object and dropping to a canvas. Then i am dragging the object and moving it to a different position. The problem is, when i drag the object w