Click here to Skip to main content
15,891,204 members
Home / Discussions / XML / XSL
   

XML / XSL

 
QuestionRe: Improving XML read/load performance Pin
led mike21-Apr-09 11:05
led mike21-Apr-09 11:05 
AnswerRe: Improving XML read/load performance Pin
Ekjon21-Apr-09 13:09
Ekjon21-Apr-09 13:09 
QuestionForce XML end tag to be on same line with start tag when InnerText is null [modified] Pin
grichard20-Apr-09 9:55
grichard20-Apr-09 9:55 
AnswerRe: Force XML end tag to be on same line with start tag when InnerText is null Pin
George L. Jackson20-Apr-09 11:07
George L. Jackson20-Apr-09 11:07 
GeneralRe: Force XML end tag to be on same line with start tag when InnerText is null Pin
grichard22-Apr-09 8:26
grichard22-Apr-09 8:26 
GeneralRe: Force XML end tag to be on same line with start tag when InnerText is null Pin
George L. Jackson22-Apr-09 12:56
George L. Jackson22-Apr-09 12:56 
QuestionSaving a tree structure from a treeview and restoring the structure Pin
jr2369317-Apr-09 3:45
jr2369317-Apr-09 3:45 
QuestionXSL Sum() [modified] Pin
LordLothar17-Apr-09 2:12
LordLothar17-Apr-09 2:12 
let say I have this:
<books>
	<book>
		<title genre="non-fiction">Objects First With Java- A Practical Introduction Using Bluej </title>
		<author>David J. Barnes</author>
		<author>Michael Kolling</author>
		<publisher>Pearson Prentice Hall</publisher>
		<year>2006</year>
		<price>49</price>
	</book>
	<book>
		<title genre="fiction">Harry Potter and the Half-Blood Prince</title>
		<author>J. K. Rowling</author>
		<publisher>Thorndike Press</publisher>
		<year>2005</year>
		<price>29</price>
	</book>
</books>


and I want to sum the price if the title genre is fiction and book price is less than 30 (I should have more books for this but will add later).

currently I read somewhere I came up with this:
<xsl:value-of select="sum(/books/book/title[@genre='fiction']/price[number(text())<30])" />

or this:
<xsl:value-of select="sum(/books/book[title[@genre='fiction']]/price[number(text())<30])" />

but it seems I still cant get it right. Anyone could help where I did wrong?
Edited:
I found the problem that I should use '& lt;30' instead of <30. I believe I did use lt before asking.
Anyway, why the< b r / > in my xsl file does not work in FireFox but it is fine with IE?


Many thanks.

modified on Friday, April 17, 2009 8:28 AM

AnswerRe: XSL Sum() Pin
George L. Jackson17-Apr-09 7:10
George L. Jackson17-Apr-09 7:10 
GeneralRe: XSL Sum() Pin
LordLothar17-Apr-09 17:08
LordLothar17-Apr-09 17:08 
QuestionC++, Java, DOM support Pin
gotchagotcha16-Apr-09 23:33
gotchagotcha16-Apr-09 23:33 
AnswerRe: C++, Java, DOM support Pin
led mike17-Apr-09 5:21
led mike17-Apr-09 5:21 
Questionspecial character problem in href tag using xslt [modified] Pin
alok_2k315-Apr-09 4:05
alok_2k315-Apr-09 4:05 
GeneralRe: special character problem in href tag using xslt Pin
George L. Jackson15-Apr-09 12:24
George L. Jackson15-Apr-09 12:24 
QuestionXML and DTD Doubt? Pin
crrajaguru15-Apr-09 2:23
crrajaguru15-Apr-09 2:23 
QuestionRe: XML and DTD Doubt? Pin
George L. Jackson15-Apr-09 11:58
George L. Jackson15-Apr-09 11:58 
Questiongmn? Pin
kamfatar8812-Apr-09 22:09
kamfatar8812-Apr-09 22:09 
Questionhow do i read the specific tag ? Pin
YiXiang_8912-Apr-09 21:45
YiXiang_8912-Apr-09 21:45 
AnswerRe: how do i read the specific tag ? Pin
George L. Jackson14-Apr-09 9:51
George L. Jackson14-Apr-09 9:51 
AnswerRe: how do i read the specific tag ? Pin
Perry Holman21-Apr-09 23:45
Perry Holman21-Apr-09 23:45 
GeneralRe: how do i read the specific tag ? Pin
George L. Jackson22-Apr-09 2:43
George L. Jackson22-Apr-09 2:43 
QuestionXML NODE Pin
kibromg8-Apr-09 0:15
kibromg8-Apr-09 0:15 
AnswerRe: XML NODE Pin
led mike8-Apr-09 5:17
led mike8-Apr-09 5:17 
QuestionLimit length (number of characters) returned in &lt;%#XPath("description")%&gt; ? Pin
cbvoss2-Apr-09 16:12
cbvoss2-Apr-09 16:12 
AnswerRe: Limit length (number of characters) returned in &lt;%#XPath("description")%&gt; ? Pin
cbvoss3-Apr-09 6:38
cbvoss3-Apr-09 6:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.