473,375 Members | 1,331 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,375 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 4590

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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.