Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 5th, 2006, 10:14 PM
Registered User
 
Join Date: Apr 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to damocles82
Default Need XSLT help ASAP

Hello
I need to transform an xml file Inquiry.xml to another CustomerInquiry.xml using XSLT. Can someone please provide me with the xsl file to do so.

[u]Inquiry.xml</u>

<Inquiry xsi:schemaLocation="urn:Inquiry Inquiry.xsd">
<inquiryID>inquiry0123</inquiryID>
<customerID>169321</customerID>
<source>
<name>Eric Not </name>
<address>Avent ferry road, apt 5, raleigh, NC</address>
<phone>9145565678</phone>
<email>[email protected]</email>
</source>

<destination>
<name>John Doe </name>
<address>42nd Street, New York, NY, 10017</address>
<phone>2126758967</phone>
<email/>
</destination>

<accountFrom accountID="169321-001">
<bank bankID="WacUSA786">
<bankname>Wachovia</bankname>
<countryname>United States of America</countryname>
<countryCode>USA</countryCode>
<branchID>8989892</branchID>
<branchName>Raleigh-Hillsborough</branchName>
</bank>
<type>Card</type>

<balance>
<amount>1300.56</amount>
<currCode>USD</currCode>
</balance>

<transferTo>
<min>
<amount>10.00</amount>
<currCode>USD</currCode>
</min>
<max>
<amount>1300.56</amount>
<currCode>USD</currCode>
</max>
</transferTo>

<transferFrom>
<min>
<amount>1.00</amount>
<currCode>USD</currCode>
</min>
<max>
<amount>100000.00</amount>
<currCode>USD</currCode>
</max>
</transferFrom>
</accountFrom>

<accountTo accountID="874854-123">
<bank bankID="CitiUSA987">
<bankname>CitiBank</bankname>
<countryname>United States of America</countryname>
<countryCode>USA</countryCode>
<branchID>8789393</branchID>
<branchName>NewYork-Manhattan42</branchName>
</bank>
<type>Card</type>

<balance>
<amount>2500.00</amount>
<currCode>USD</currCode>
</balance>

<transferTo>
<min>
<amount>10.00</amount>
<currCode>USD</currCode>
</min>
<max>
<amount>1000000.00</amount>
<currCode>USD</currCode>
</max>
</transferTo>

<transferFrom>
<min>
<amount>0.00</amount>
<currCode>USD</currCode>
</min>
<max>
<amount>10000000</amount>
<currCode>USD</currCode>
</max>
</transferFrom>
</accountTo>

<dueDate>2006-04-06</dueDate>
<transferAmount>
<amount>500.00</amount>
<currCode>USD</currCode>
</transferAmount>
</Inquiry>


[u]CustomerInquiry.xml</u>

<Customer xsi:schemaLocation="urn:CustomerInquiry CustomerInquiry.xsd" customerID="169321">

<contactInfo>
<name>Eric Not</name>
<address>Avent ferry road, apt 5, raleigh, NC</address>
<phone>9145565678</phone>
<email>[email protected]</email>
</contactInfo>

<customerBankInfo>
<bankID>WacUSA786</bankID>
<bankname>Wachovia</bankname>
<countryCode>USA</countryCode>

<AccountInfo accountID="169321-001">
<type>Card</type>
<balance>
<amount>1300.56</amount>
<currCode>USD</currCode>
</balance>
<branchID>8989892</branchID>
<branchName>Raleigh-Hillsborough</branchName>
</AccountInfo>
</customerBankInfo>

<customerInquiryInfo>
<transferInfo>
<destination>
<bankID>CitiUSA987</bankID>
<bankname>CitiBank</bankname>
<countryCode>USA</countryCode>

<AccountInfo accountID="874854-123">
<type>Card</type>
<balance>
<amount>2500.00</amount>
<currCode>USD</currCode>
</balance>
<branchID>8789393</branchID>
<branchName>NewYork-Manhattan42</branchName>
</AccountInfo>
</destination>

<transferAmount>
<amount>500.00</amount>
<currCode>USD</currCode>
</transferAmount>
</transferInfo>

<dueDate>2006-04-06</dueDate>
</customerInquiryInfo>
</Customer>

Would really appreciate the help. Just a simple xsl file to transform Inquiry to CustomerInquiry.

 
Old April 6th, 2006, 02:18 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

What have you got so far, what aspect are you struggling with?

--

Joe (Microsoft MVP - XML)
 
Old April 6th, 2006, 02:42 AM
Registered User
 
Join Date: Apr 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to damocles82
Default

I haven got much, just starting out, trying to build elements in CustomerInquiry.xml manually (using xsl:element,xsl:attribute and value-of). But am trying this the first time and am very unsure if its going right.

Using a tutorial side by side, but am not getting to far. Need this done by the morning.

 
Old April 6th, 2006, 03:44 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

You may strike lucky and find someone prepared to write code for you. But it's not something I do. I'm here to help for readers of my books who have difficulty understanding some particular aspect of the technology. Before I can give you that help, I need to know where your difficulty lies: what have you read, what have you tried, what didn't work, which part of the book didn't you understand?

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old April 6th, 2006, 03:48 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

>Using a tutorial side by side, but am not getting to far. Need this done by the morning.

Can't help, I'm afraid. I've never learnt a new programming language in less than three weeks, and I wouldn't advise anyone else to try.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old April 6th, 2006, 03:52 AM
Registered User
 
Join Date: Apr 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to damocles82
Default

Ok, I think I got some of it down.
I wrote the Inquiry.xsl and then used this
<?xml-stylesheet type="xsl" href="Inquiry.xsl"?> in Inquiry.xml to add the reference.
Then I opened Inquiry.xml using a browser, but the output I get is not like CustomerInquiry.xml, instead its a long sequence of text characters.

How do I make this text appear in the xml format?
I have already included
<xsl:output method="xml" indent="yes"/> in Inquiry.xsl






Similar Threads
Thread Thread Starter Forum Replies Last Post
plz help me ASAP developer.ibm Java Basics 4 August 22nd, 2007 12:32 PM
Need Help ASAP coding C# 1 June 6th, 2007 12:41 AM
NEED HELP ASAP surethg JSP Basics 1 January 21st, 2006 07:07 PM
Help ASAP Sheikha ADO.NET 1 September 14th, 2004 07:33 AM
HELP! HELP! Please ASAP iamucha Access 2 March 25th, 2004 11:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.