Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

xsl mapping using string after, string before and if , otherwise condition

1034574Nov 5 2014 — edited Feb 26 2020

Hi ,

  I am receiving input like InputA=12345-678 in xsd element , i want to insertdata into two elements called outputA,outputB. I used substring before and ,substring after .

  for inserting 12345 into outputA and 678 into OutputB

 

Please see below sample code

  <xsl:template match="/">

  <ns0:targetdata>

  <ns0:outputA>

  <xsl:value-of
select="substring-before(/ns0:exampleElement/ns0:InputA,'-')"/>

  </ns0:outputA>

  <ns0:outputB>

  <xsl:value-of
select="substring-after(/ns0:exampleElement/ns0:InputA,'-')"/>

  </ns0:outputB>

  </ns0:targetdata>

  </xsl:template>

  But some times input coming like only 12345 with out separation that time data not inserting into OutputA.

 

My requirement is if input comes like 12345-678 then 12345 moved to outputA and 678 moved to outputB and input comes only 12345 then data moved to outputA
only.

Please send me sample code for that above requirement its very urgent.

Thanks in advance

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2014
Added on Nov 5 2014
12 comments
3,322 views