By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,483 Members | 1,001 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,483 IT Pros & Developers. It's quick & easy.

how to ignore namespace in xsl file while reading data from xml file

P: 1
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <biller-enrollment-notification xmlns="http://www.piit.com/cpbatch/billerenrollmentnotificaion1" "> 
  3.     <business-id>504477</business-id>
  4.     <file-create-date>05/14/2016</file-create-date>
  5.     <enrollment-notification> 
  6.          <notification-type>ENROLLMENT ADDED</notification-type>
  7.          <consumer-name>Customer Name1</consumer-name>
  8.          <consumer-profile-id>675</consumer-profile-id>
  9.          <last-update-date>2016-01-10T11:32:59</last-update-date>
  10.          <notification-user-profile> 
  11.              <primary-email-address>customer@email.com</primary-email-address>
  12.              <contact-phone-number >7777777777</contact-phone-number>
  13.              <profile-address-1>Customer Address 1</profile-address-1>
  14.              <profile-address-2>Customer Address 2</profile-address-2>
  15.              <profile-city>City</profile-city>
  16.              <profile-state>NJ</profile-state>
  17.              <profile-postal-code>08540</profile-postal-code>
  18.              <profile-country-code>US</profile-country-code>
  19.          </notification-user-profile> 
  20.      </enrollment-notification>
  21.        <totals>1</totals>
  22.   </biller-enrollment-notification>
my xsl file is like this
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="iso-8859-1" ?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
  3.   <xsl:output method="text" omit-xml-declaration="yes" />
  4.   <xsl:template match="/">
  5.   <xsl:strip-space elements="*" />
  6.  
  7.     <!-- Header Line -->
  8.     <xsl:text>BusinessId~FileCreateDate~NotificationType~ConsumerName~ProfileId~LastUpdateDate~PrimaryEmailAddress~ContactNumber~BillingAccountNumber~AccountNickName</xsl:text>
  9.     <xsl:text>~FundingAccountId~AccountAddress1~AccountAddress2~AccountCity~AccountState~AccountZip~AccountCountryCode~RoutingNumber~BankAccountNumber~FundingAccountHolderName~CardNumber~CardExpirationMonth~CardExpirationYear</xsl:text>
  10.     <xsl:text>~FundingAccountAdress1~FundingAccountAdress2~FundingAccountCity~FundingAccountState~FundingAccountZip~FundingAccountCountryCode~FundingAccountType~FundingAccountSubType</xsl:text>
  11.     <xsl:text>~AmountType~Amount~ScheduleDate~DayNumber~DurationType~SuspendDate~FrequencyType~TransactionDate~ConfirmationCode~Status~RejectReason~Totals</xsl:text>
  12.     <xsl:text>
  13. </xsl:text>
  14.  
  15.     <!-- Detail Lines -->
  16.     <xsl:for-each select="/biller-enrollment-notification  /enrollment-notification">
  17.         <xsl:value-of select="../business-id"/>
  18.         <xsl:text>~</xsl:text>
  19.         <xsl:value-of select="../file-create-date" />
  20.         <xsl:text>~</xsl:text>
  21.         <xsl:value-of select="notification-type"/>
  22.         <xsl:text>~</xsl:text>
  23.         <xsl:value-of select="consumer-name" />
  24.         <xsl:text>~</xsl:text>  
  25.         <xsl:value-of select="consumer-profile-id" />
  26.         <xsl:text>~</xsl:text>
  27.         <xsl:value-of select="last-update-date" />
  28.         <xsl:text>~</xsl:text>
  29.         <xsl:value-of select="notification-user-profile/primary-email-address" />
  30.         <xsl:text>~</xsl:text>
  31.         <xsl:value-of select="notification-user-profile/contact-phone-number" />
  32.         <xsl:text>~</xsl:text>
  33.         <xsl:value-of select="notification-billing-account/billing-account-number" />
  34.         <xsl:text>~</xsl:text>
  35.         <xsl:value-of select="notification-funding-account/notification-funding-account-nickname" />
  36.         <xsl:text>~</xsl:text>
  37.         <xsl:value-of select="notification-billing-account/notification-payment-schedule/funding-account-id" />
  38.         <xsl:text>~</xsl:text>
  39.         <xsl:value-of select="notification-user-profile/profile-address-1" />
  40.         <xsl:text>~</xsl:text>
  41.         <xsl:value-of select="notification-user-profile/profile-address-2" />
  42.         <xsl:text>~</xsl:text>
  43.         <xsl:value-of select="notification-user-profile/profile-city" />
  44.         <xsl:text>~</xsl:text>
  45.         <xsl:value-of select="notification-user-profile/profile-state" />
  46.         <xsl:text>~</xsl:text>
  47.         <xsl:value-of select="notification-user-profile/profile-postal-code" />
  48.         <xsl:text>~</xsl:text>
  49.         <xsl:value-of select="notification-user-profile/profile-country-code" />
  50.         <xsl:text>~</xsl:text>
  51.         <xsl:value-of select="notification-funding-account/routing-number" />
  52.         <xsl:text>~</xsl:text>
  53.         <xsl:value-of select="notification-funding-account/bank-account-number" />
  54.         <xsl:text>~</xsl:text>
  55.         <xsl:value-of select="notification-funding-account/funding-account-holder-name" />
  56.         <xsl:text>~</xsl:text>
  57.         <xsl:value-of select="notification-funding-account/notification-credit-card-account/credit-card-number" />
  58.         <xsl:text>~</xsl:text>
  59.         <xsl:value-of select="notification-funding-account/notification-credit-card-account/expiration-month" />
  60.         <xsl:text>~</xsl:text>
  61.         <xsl:value-of select="notification-funding-account/notification-credit-card-account/expiration-year" />
  62.         <xsl:text>~</xsl:text>
  63.         <xsl:value-of select="notification-funding-account/account-address-1" />
  64.         <xsl:text>~</xsl:text>
  65.         <xsl:value-of select="notification-funding-account/account-address-2" />
  66.         <xsl:text>~</xsl:text>
  67.         <xsl:value-of select="notification-funding-account/account-city" />   <!--enrollment-notification/notification-funding-account/notification-credit-card-account/-->
  68.         <xsl:text>~</xsl:text>
  69.         <xsl:value-of select="notification-funding-account/account-state" />
  70.         <xsl:text>~</xsl:text>
  71.         <xsl:value-of select="notification-funding-account/account-postal-code" />
  72.         <xsl:text>~</xsl:text>
  73.         <xsl:value-of select="notification-funding-account/account-country-code" />
  74.         <xsl:text>~</xsl:text>
  75.         <xsl:value-of select="notification-funding-account/notification-funding-account-type" />
  76.         <xsl:text>~</xsl:text>
  77.         <xsl:value-of select="notification-funding-account/notification-funding-account-subtype" />
  78.         <xsl:text>~</xsl:text>
  79.         <xsl:value-of select="notification-billing-account/notification-payment-schedule/payment-amount-type" />
  80.         <xsl:text>~</xsl:text>
  81.         <xsl:value-of select="notification-billing-account/notification-payment-schedule/payment-amount" />
  82.         <xsl:text>~</xsl:text>
  83.         <xsl:value-of select="notification-billing-account/notification-payment-schedule/payment-date-type" />
  84.         <xsl:text>~</xsl:text>
  85.         <xsl:value-of select="notification-billing-account/notification-payment-schedule/day-number" />
  86.         <xsl:text>~</xsl:text>
  87.         <xsl:value-of select="notification-billing-account/notification-payment-schedule/payment-duration-type" />
  88.         <xsl:text>~</xsl:text>
  89.         <xsl:value-of select="notification-billing-account/notification-payment-schedule/payment-schedule-suspend-date" />
  90.         <xsl:text>~</xsl:text>
  91.         <xsl:value-of select="notification-billing-account/notification-payment-schedule/payment-frequency" />
  92.         <xsl:text>~</xsl:text>
  93.         <xsl:value-of select="notification-billing-account/notification-payment-schedule/transaction-date" />
  94.         <xsl:text>~</xsl:text>
  95.         <xsl:value-of select="notification-billing-account/notification-payment-schedule/confirmation-code" />
  96.         <xsl:text>~</xsl:text>
  97.         <xsl:value-of select="../status" />
  98.         <xsl:text>~</xsl:text>
  99.         <xsl:value-of select="../reject-reason" />
  100.         <xsl:text>~</xsl:text>
  101.         <xsl:value-of select="../totals" />
  102.         <xsl:text>
  103. </xsl:text>
  104.     </xsl:for-each>
  105.   </xsl:template>
  106. </xsl:stylesheet>
i want output to be like this
504477~05/14/2016~ENROLLMENT ADDED
May 18 '16 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.