0

I've been assigned a project by my team to create an XSLT for this XML input, the input contains multiple notifications, so I'm assuming I would have to do a Select for each enrollment-notification . I want to only show the below values of the XML and omit the rest.

notification-type

consumer-name

billing-account-number

I made a test XSLT that would just omit the consumer-email-address that I was hoping to build off of however when I run it, it outputs the entire XML including the consumer email-address.

Anyway I can accomplish this?

Sample XML

<biller-enrollment-notification xmlns="http://sometest.com">
<business-id>0123456</business-id> 
<file-create-date>2016-08-03</file-create-date> 
<enrollment-notification>
<notification-type>ENROLLMENT ADDED</notification-type> 
<consumer-profile-id>5078109</consumer-profile-id> 
<last-update-date>2016-08-02T18:34:37</last-update-date> 
<notification-user-profile>
<primary-email-address>test@test.cm</primary-email-address> 
</notification-user-profile>
</enrollment-notification>
<enrollment-notification>
<notification-type>ENROLLMENT ADDED</notification-type> 
<consumer-profile-id>5078180</consumer-profile-id> 
<last-update-date>2016-08-02T18:50:17</last-update-date> 
<notification-user-profile>
<primary-email-address>test@test.com</primary-email-address> 
</notification-user-profile>
</enrollment-notification>
<enrollment-notification>
<notification-type>ENROLLMENT ADDED</notification-type> 
<consumer-profile-id>5078464</consumer-profile-id> 
<last-update-date>2016-08-02T19:58:47</last-update-date> 
<notification-user-profile>
<primary-email-address>test@test.com</primary-email-address> 
</notification-user-profile>
</enrollment-notification>
<enrollment-notification>
<notification-type>BILLING ADDED</notification-type> 
<consumer-profile-id>5078180</consumer-profile-id> 
<last-update-date>2016-08-02T18:50:17</last-update-date> 
<notification-billing-account>
<billing-account-number>0123456789</billing-account-number> 
</notification-billing-account>
</enrollment-notification> 

Test XSLT

<?xml version="1.0" encoding="UTF-8" ?>

     <xsl:stylesheetversion="1.0"xmlns:xsl=
 "http://www.w3.org/1999/XSL/Transform">

<xsl:output method="text" indent="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="primary-email-address"/>

</xsl:stylesheet>
sortinousn
  • 637
  • 2
  • 9
  • 27

0 Answers0