Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 19th, 2011, 09:14 AM
Authorized User
Points: 138, Level: 2
Points: 138, Level: 2 Points: 138, Level: 2 Points: 138, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2009
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default xslt comment not appearing

I am trying to get xsl comments on my XMLSpy XSLT output console, but the comment is not appearing. My xslt script is:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.opentravel.org/OTA/2003/05" xmlns:ota="http://www.opentravel.org/OTA/2003/05" exclude-result-prefixes="ota xsl">
	<xsl:output encoding="UTF-8" version="2.0" method="xml"/>
	<xsl:strip-space elements="*"/>
	<xsl:variable name="no_of_adult_persons" select="count(//ota:PassengerListItems/ota:PassengerListItem[@Code = '10'])"/>
	<xsl:variable name="adult_persons_prices">
		<xsl:call-template name="adult">
			<xsl:with-param name="nodelist_adult" select="//ota:PassengerListItems/ota:PassengerListItem[@Code = '10']"/>
			<xsl:with-param name="nodelist" select="//ota:CostingItem"/>
		</xsl:call-template>
	</xsl:variable>
	<xsl:template name="adult">
		<xsl:param name="nodelist_adult"/>
		<xsl:param name="nodelist"/>
		<xsl:param name="counter">1</xsl:param>
		<xsl:param name="sum">0.00</xsl:param>
		<xsl:variable name="rph" select="$nodelist_adult[$counter]/@RPH"/>

		<xsl:comment>
			<xsl:value-of select="count($nodelist_adult)"/>
		</xsl:comment>
		<xsl:comment>
			<xsl:value-of select="count($nodelist)"/>
		</xsl:comment>
		<xsl:comment>
			<xsl:value-of select="$counter"/>
		</xsl:comment>
		<xsl:comment>
			<xsl:value-of select="$sum"/>
		</xsl:comment>
		<xsl:comment>
			<xsl:value-of select="$nodelist_adult[$counter]/@RPH"/>
		</xsl:comment>
		<xsl:comment>=============================</xsl:comment>


		<xsl:variable name="sum_temp">
			<xsl:value-of select="$sum + $nodelist[$counter]/ota:UnitCost/@Amount"/>
		</xsl:variable>
		<xsl:choose>
			<xsl:when test="$counter &lt; count($nodelist_adult)">
				<xsl:call-template name="adult">
					<xsl:with-param name="nodelist_adult" select="$nodelist_adult"/>
					<xsl:with-param name="nodelist" select="$nodelist"/>
					<xsl:with-param name="counter" select="$counter + 1"/>
					<xsl:with-param name="sum" select="$sum_temp"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$sum_temp"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
</xsl:stylesheet>

and xml input

Code:
<?xml version="1.0" encoding="UTF-8"?>
<OTA_TT_PkgBookRS Version="1.0" xmlns="http://www.opentravel.org/OTA/2003/05">
	<Success/>
	<PackageReservation>
		<UniqueID ID="7305042" Type="14"/>
		<Package BrandCode="OHG" ProductCode="201842820" Status="Confirmed">
			<DateRange End="2011-05-10" Start="2011-04-26"/>
			<ItineraryItems>
				<ItineraryItem RPH="1" Status="Confirmed">
					<Accommodation>
						<Identity HotelCode="201842820" HotelName="Broncemar"/>
						<DateRange Duration="P14D" End="2011-05-10" Start="2011-04-26"/>
						<RoomProfiles>
							<RoomProfile BookingCode="201842820" RoomTypeCode="1011907">
								<GuestCounts IsPerRoom="true">
									<GuestCount AgeQualifyingCode="10" Count="2"/>
								</GuestCounts>
								<PassengerRPHs ListOfPassengerRPH="1 2"/>
							</RoomProfile>
						</RoomProfiles>
						<MealPlans>
							<MealPlan Code="BB" MealType="B &amp; B">
								<CustomerCounts>
									<CustomerCount Code="10" Quantity="2"/>
								</CustomerCounts>
								<PassengerRPHs ListOfPassengerRPH="1 2"/>
							</MealPlan>
						</MealPlans>
					</Accommodation>
				</ItineraryItem>
			</ItineraryItems>
		</Package>
		<ContactDetail>
			<PersonName>
				<NamePrefix>Mr</NamePrefix>
				<GivenName>Mark</GivenName>
				<Surname>Dost</Surname>
			</PersonName>
			<Telephone PhoneNumber="02349711464"/>
			<Address>
				<StreetNmbr>Unistr.90</StreetNmbr>
				<CityName>Bochum</CityName>
				<PostalCode>44789</PostalCode>
				<CountryName Code="DE">Deutschland</CountryName>
			</Address>
			<Email>mark.dost@iff.traveltainment.de</Email>
		</ContactDetail>
		<PassengerListItems>
			<PassengerListItem BirthDate="1986-01-12" Code="10" Gender="Male" RPH="1">
				<Name>
					<NamePrefix>Mr</NamePrefix>
					<GivenName>Mark</GivenName>
					<Surname>Dost</Surname>
				</Name>
			</PassengerListItem>
			<PassengerListItem BirthDate="1987-01-12" Code="10" Gender="Female" RPH="2">
				<Name>
					<NamePrefix>Mrs</NamePrefix>
					<GivenName>Claudia</GivenName>
					<Surname>Ollmann</Surname>
				</Name>
			</PassengerListItem>
		</PassengerListItems>
		<InvoiceDetail>
			<CostingItems>
				<CostingItem CostBasis="7" PassengerRPH="1">
					<UnitCost Amount="398.01" CurrencyCode="EUR"/>
				</CostingItem>
				<CostingItem CostBasis="7" PassengerRPH="2">
					<UnitCost Amount="57.5000" CurrencyCode="EUR"/>
				</CostingItem>
			</CostingItems>
			<GrossAmount Amount="455.51" CurrencyCode="EUR"/>
		</InvoiceDetail>
	</PackageReservation>
</OTA_TT_PkgBookRS>

Could someone please help me out?

I am using xslt 1.0 xalan processor in my xmlspy
Reply With Quote
  #2 (permalink)  
Old January 19th, 2011, 09:24 AM
Friend of Wrox
Points: 6,676, Level: 34
Points: 6,676, Level: 34 Points: 6,676, Level: 34 Points: 6,676, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2007
Location: Germany
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

Well you would need to add some template like
Code:
    <xsl:template match="/">
      <xsl:copy-of select="$adult_persons_prices"/>
    </xsl:template>
to output the variable you create. If that does not help then explain in more detail what you want to achieve by posting the result sample you want to create.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
Reply With Quote
  #3 (permalink)  
Old January 19th, 2011, 11:50 AM
Authorized User
Points: 138, Level: 2
Points: 138, Level: 2 Points: 138, Level: 2 Points: 138, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2009
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks, it helped!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A comment regarding Database yevi BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 March 23rd, 2009 03:59 PM
Display xml comment using xslt mllena XSLT 1 January 16th, 2009 07:32 AM
Check comment or not Tachyophan Excel VBA 1 January 9th, 2004 06:20 PM
Help me about write a comment. fujinova JSP Basics 0 October 1st, 2003 08:22 PM



All times are GMT -4. The time now is 04:50 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.