473,287 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

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

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
0 4545

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

Similar topics

14
by: Kevin Knorpp | last post by:
Hello. I need to be able to extract the data from the attached file (or any file in the same format) so that I can work with the data in PHP. I'm fairly comfortable with using PHP with...
1
by: matt | last post by:
I'm reading lines from a file to display an image. Each image and caption is on a new line. I read the string from each line, up until the line break (\r\n) and then assume my fields are starting...
3
by: Pernell Williams | last post by:
Hi all: I am new to Python, and this is my first post (and it won't be my last!), so HELLO EVERYONE!! I am attempting to use "xreadlines", an outer loop and an inner loop in conjunction with...
2
by: Brian Ward | last post by:
First: sorry as a relative newbie for previously not including code. My question: Reading C++ books I almost always find programs such as the one below give the following type of code for reading...
2
by: trying_to_learn | last post by:
im in the primary stages of learning C++. The book im learning from says Dont use using namespace.. directive in header file However im trying to make the following header file.I need to include...
4
by: Jeff Rodriguez | last post by:
How would one go about reading a file line by line in reverse? For Example: -- FILE -- 1 2 3 4 5 -- FILE --
3
by: Ron | last post by:
I need a way to read the hex values of an old DBase3 data file. Can anyone give me some info regarding how to grab hex values out of a file? Not sure exactly how to do this. Thanks for your...
9
by: Macca | last post by:
Hi, I have a synchronous socket server which my app uses to read data from clients. To test this I have a simulated client that sends 100 byte packets. I have set up the socket server so...
3
by: Ivan Liu | last post by:
I would like know how I can skip a line while reading a set of input data (from a text file) if the first character of the line is "#". My original code reads: ifstream Infile("data.dat"); ...
9
by: Eric Lilja | last post by:
Hi! I have a program with a class that needs to be able to write itself to a file in clear text format. The file has two integers and vector of struct objects. The struct has a string that can...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.