Saturday, February 27, 2010

XSLT 1 - Using ora:node-set() function

The ora:node-set() function can be used to convert a XML fragment into a node set.  Once a XML fragment is converted into a node-set you can loop through it, or use XPath to access elements within it.

Example usage:

<xsl:template match="/">
     <xsl:variable name="SessionContext">
         <xsl:value-of select="app:getSessionContext()">
         <!-- returns session context as a XML fragment with elements - ctx/UserName, ctx/LoginToken -->
     </xsl:variable>
     <xsl:apply-templates select="Record"/>
</xsl:template>

<xsl:template match="Record">
     <RecordDetails>
           <ColumnA><xsl:value-of select="./Record/ColA"></ColumnA>
           <ColumnB><xsl:value-of select="./Record/ColB"></ColumnB>
           <ColumnC><xsl:value-of select="./Record/ColC"></ColumnC>
           <!-- access ctx values using xpath on variable -->
           <ColumnC><xsl:value-of select="ora:node-set($SessionContext)/ctx/UserName"></UserName>
           <ColumnC><xsl:value-of select="ora:node-set($SessionContext)/ctx/LoginToken"></UserName>
     </RecordDetails>
</xs:template>





Tuesday, February 23, 2010

Introduction

Hi, I am Sarat, I am a Principal Product Manager in the Fusion Middleware group at Oracle Corp. The co-author of this blog is  Naiem Shaik is Systems Engineer who works in emerging technologies. He is currently working on platform development for mobile devices.

Each of us always wanted to start a blog - but after years of sitting on it, here we finally begin a group blog.  This blog is going to be mostly about technology. Since we both work of such different technology areas, you might find seemingly unrelated posts on this blog.  But what is a life (er blog!) without some variety?

PS : All opinions and views expressed in this blog are my own and do not represent by employer Oracle Corp / Oracle India Pvt. Ltd.

Apart from general technology posts, my entries will focus on usage of Oracle's integration technology - Fusion Middleware, as well as integration features in Oracle Applications.

My first tech post is on its way -