June 1, 2009

Invalid Usage of Element

Just ran into something annoying the past 10 minutes when working on a BPEL process (related to XSLT).

My transformation included the following (which I had manually entered in JDeveloper):
    <ns0:QualificationDate>
    <xsl:if test="number(ns1:Highest/ns1:QualificationDate) > 0">
    <xsl:value-of select="number(ns1:Highest/ns1:QualificationDate) + 190000"/>
    </xsl:if>
    </ns0:QualificationDate>
However, when I clicked on the "Design" tab of the mapper tool to switch from Source to Design mode, I received the following error:
    Transformation_2.xsl
    Error: Invalid Usage of <if> Element
Turns out, the correct usage of the <if> element is the following:
    <xsl:if test="number(ns1:Highest/ns1:QualificationDate) > 0">
    <ns0:QualificationDate>
    <xsl:value-of select="number(ns1:Highest/ns1:QualificationDate) + 190000"/>
    </ns0:QualificationDate>
    </xsl:if>

It's the little things that get you sometimes.

6 comments:

  1. AnonymousMay 17, 2011

    Hi Ahmed, I would like to thank you for writing this blog. Your blogs saved me lot of time and effort.

    ReplyDelete
  2. Thank you for the kind words Anonymous. Glad I could be of help.

    I now have been exclusively blogging at http://blog.ipnweb.com, and slowly migrating my posts over to there. So check it out!

    ReplyDelete
  3. y7n86t6i35 a6j17z2x63 e8t66f5h72 d0x76u4p02 u3y11i1m98 z5p88e9j34

    ReplyDelete