[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

07/05/2009 at 07:02AM PDT, ID: 24544830
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.8

XSLT - HTML Transform problems

Asked by QuinnDester in Extensible Stylesheet Language Transformation (XSLT), XPath, Hypertext Markup Language (HTML)

Tags: XML, XSL, XSLT, HTML TRANSFORM

I am having problems with this xslt transformation

The XSLT should make it obivous what i am trying to achieve

I have included a cut down version of the XML, and my XSLT attempt, i keep getting the error invalid pattern in XMLSpy

Thank you for looking at this
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="file:///C:/Documents%20and%20Settings/Chris/My%20Documents/Altova/XMLSpy2009/Examples/ClosestSoFar.xslt"?>
<ProductSearch xmlns="urn:yahoo:prods">
	<Categories total_subcategories="18">
		<SubCategory>
			<Title>Projector Accessories</Title>
			<Value>100375223</Value>
			<NumberOfProducts>1</NumberOfProducts>
		</SubCategory>
	</Categories>
	<Products firstResultPosition="1" totalResultsAvailable="435" totalResultsReturned="20">
		<Product type="Offer">
			<Offer id="960e67b21e0ddfafdbb0b77716e98bbc">
				<Url>http://uk.shopping.yahooapis.com/ctl/go/sitesearchGo?.ts=1246725457647&amp;.sig=h4eRVQJiZWr.Ld1JJdxhNvz_ECc-&amp;offerId=960e67b21e0ddfafdbb0b77716e98bbc&amp;searchId=87248117220_1246725457645_1206933&amp;affiliationId=96929528&amp;country=uk&amp;wait=true&amp;comId=7546223&amp;catId=127101</Url>
				<CompareUrl>http://audiovisual.kelkoo.co.uk/p-plasma-tvs-127101/samsung-ps50b430-19601770?partnerId=96929528</CompareUrl>
				<ProductName>Samsung PS50B430 ** Special Deal ** Available if...</ProductName>
				<Price currency="gbp">699.00</Price>
				<DeliveryCost>0.0</DeliveryCost>
				<DeliveryTime>1 To 3 Working Days</DeliveryTime>
				<Availability>Availability: In stock</Availability>
				<Used>false</Used>
				<ListImage>
					<Url>http://img.kelkoo.com/uk/medium/624/631/87817543067979507255394251041155631624.jpg</Url>
					<Height>90</Height>
					<Width>90</Width>
				</ListImage>
				<GridImage>
					<Url>http://img.kelkoo.com/uk/medium/624/631/87817543067979507255394251041155631624.jpg</Url>
					<Height>90</Height>
					<Width>90</Width>
				</GridImage>
				<Summary>Free Mainland UK Delivery Only - Samsung PS50B430 50&amp;quot; HD Ready PLASMA Picture Playback Screen Size 50 &amp;quot;&amp;quot; Resolution max. 1365 x 768 1365 x 768 Image ...</Summary>
				<Merchant id="7546223">
					<Name>Electro Centre</Name>
				</Merchant>
				<CatalogID>127101-19601770</CatalogID>
				<Category id="127101">
					<Name>Plasma TVs</Name>
				</Category>
			</Offer>
		</Product>
	</Products>
	<Warnings>
		<Warning>The "merchantId" parameter is not given. The default value "-1" is used.</Warning>
		<Warning>The "logicalType" parameter is not given. The default value "and" is used.</Warning>
	</Warnings>
</ProductSearch>
 
 
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:comparionsplus-com:xslt">
	<xsl:output method="html"/>
	<xsl:template match="ProductSearch/Products">
		<xsl:variable name="resultsPosition">
			<xsl:value-of select="@firstResultPosition"/>
		</xsl:variable>
		<xsl:variable name="totalResults">
			<xsl:value-of select="@totalResultsAvailable"/>
		</xsl:variable>
		<xsl:variable name="returnedResults">
			<xsl:value-of select="@totalResultsReturned"/>
		</xsl:variable>
	</xsl:template>
	<xsl:template match="Products/Product/Offer/">
		<xsl:variable name="prodName">
			<xsl:value-of select="ProductName"/>
		</xsl:variable>
		<xsl:variable name="prodDesc">
			<xsl:value-of select="Summary"/>
		</xsl:variable>
		<xsl:variable name="catID">
			<xsl:value-of select="Category"/>
		</xsl:variable>
		<xsl:variable name="catName">
			<xsl:value-of select="Category/Name"/>
		</xsl:variable>
		<xsl:variable name="merchantID">
			<xsl:value-of select="Merchant/@id"/>
		</xsl:variable>
		<xsl:variable name="merchantName">
			<xsl:value-of select="Merchant/Name"/>
		</xsl:variable>
		<xsl:variable name="clickLink">
			<xsl:value-of select="Url"/>
		</xsl:variable>
		<xsl:variable name="imageLink">
			<xsl:value-of select="ListImage/Url"/>
		</xsl:variable>
		<xsl:variable name="compareLink">
			<xsl:value-of select="CompareUrl"/>
		</xsl:variable>
		<xsl:variable name="prodPrice">
			<xsl:value-of select="Price"/>
		</xsl:variable>
		<xsl:variable name="delCost">
			<xsl:value-of select="DeliveryCost"/>
		</xsl:variable>
		<xsl:variable name="compareLink">
			<xsl:value-of select="CompareUrl"/>
		</xsl:variable>
		<xsl:variable name="prodAvail">
			<xsl:value-of select="Availability"/>
		</xsl:variable>
		<xsl:variable name="prodState">
			<xsl:value-of select="Used"/>
		</xsl:variable>
	</xsl:template>
	<xsl:apply-templates/>
					
					First Result Position: <xsl:value-of select="$resultsPosition"/>
	<br/>
					Total Results: <xsl:value-of select="$totalResults"/>
	<br/>
					Results on Page: <xsl:value-of select="$returnedResults"/>
	<br/>
					
					Category id: <xsl:value-of select="$catID"/>
	<br/>
					Product Name: <xsl:value-of select="$prodName"/>
	<br/>
					Long Desc: <xsl:value-of select="$prodDesc"/>
	<br/>
					Category Name: <xsl:value-of select="$catName"/>
	<br/>
					Merchant ID: <xsl:value-of select="$merchantID"/>
	<br/>
					Merchant Name: <xsl:value-of select="$merchantName"/>
	<br/>
					Product Link: <xsl:value-of select="$clickLink"/>
	<br/>
					Image Link: <xsl:value-of select="$imageLink"/>
	<br/>
					Comparison Link: <xsl:value-of select="$compareLink"/>
	<br/>
					Product Price: <xsl:value-of select="$prodPrice"/>
	<br/>
					Delivery Price: <xsl:value-of select="$delCost"/>
	<br/>
					New/Used: <xsl:value-of select="$prodState"/>
	<br/>
					Availabile: <xsl:value-of select="$prodAvail"/>
	<br/>
					Short Desc: <xsl:value-of select="substring(substring-before($prodDesc,'.'),1,1000)"/>
	<br/>
	<xsl:template match="Warnings"/>
	<xsl:template match="Categories/*"/>
	<xsl:template match="Products/Product/Offer/GridImage"/>
</xsl:stylesheet>
[+][-]07/05/09 07:40 AM, ID: 24780121

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/05/09 07:42 AM, ID: 24780126

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/05/09 07:43 AM, ID: 24780132

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/05/09 07:57 AM, ID: 24780190

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/05/09 08:30 AM, ID: 24780277

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07/05/09 09:14 AM, ID: 24780388

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Extensible Stylesheet Language Transformation (XSLT), XPath, Hypertext Markup Language (HTML)
Tags: XML, XSL, XSLT, HTML TRANSFORM
Sign Up Now!
Solution Provided By: Gertone
Participating Experts: 1
Solution Grade: A
 
 
[+][-]07/05/09 09:34 AM, ID: 24780458

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/05/09 10:45 AM, ID: 24780699

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07/05/09 12:09 PM, ID: 24780974

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-91 - Hierarchy / EE_QW_3_20080625