cancel
Showing results for 
Search instead for 
Did you mean: 

node checking in xslt mapping

Former Member
0 Kudos

Hi All,

I have a requirement in xslt mapping (java)where i need to find the existence of a node , if it is existed the node should be created with the value on target side , if it is not existed the empty node should be created in the target.

Thanks in Advance

Prasad

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi

I think it is Possible with using Exists (node Function) and if then else (Boolean Function ) in sender Side and give Values.

I think it is possible.

Thanks

cdumont69
Contributor
0 Kudos

I think put this could work:

<xsl:choose>

<xsl:when test="/Invoice/InvoiceType/InvoiceTypeCoded">

<InvoiceType stdValue="380"/>

</xsl:when>

...

</xsl:choose>

former_member181955
Contributor
0 Kudos

Hi

can you please tell me the node functions in xsl.

Thanks

Prasad Nemalikanti

former_member181955
Contributor
0 Kudos

Hi Chirstophe,

Thanks i am able to solve the problem, thank you very much for your help

Thanks

Prasad Nemalikanti

cdumont69
Contributor
0 Kudos

Hello,

You can use the "<b>choose</b>" test:

<u>Here an example:</u>

<xsl:choose>

<xsl:when test="InvoiceType/InvoiceTypeCoded = 'DebitMemo'">

<InvoiceType stdValue="380"/>

</xsl:when>

<xsl:when test="InvoiceType/InvoiceTypeCoded = 'CreditMemo'">

<InvoiceType stdValue="381"/>

</xsl:when>

</xsl:choose>

If you have only one test without an else you can use the "<b>if</b>" test:

<u>Here an example:</u>

<xsl:if test="InvoiceIssueDate != 'N/A'">

<InvoiceDate/>

</xsl:if>

You can find more detailed on this site:

http://www.zvon.org/xxl/XSLTreference/Output/index.html

Regards,

Chris

former_member181955
Contributor
0 Kudos

Hi

I want to check the existence of a node not a value.

Thanks

Prasad