Click here to Skip to main content
15,899,124 members
Home / Discussions / XML / XSL
   

XML / XSL

 
AnswerRe: extract data from "dynamic" XML-files Pin
BoneSoft6-Jul-07 4:05
BoneSoft6-Jul-07 4:05 
QuestionAny one tell me how to convert excel file to xml dynamically Pin
Praveenchandkr2-Jul-07 17:36
Praveenchandkr2-Jul-07 17:36 
QuestionBiztalk server, I say Validate Schem Pin
indian14329-Jun-07 2:12
indian14329-Jun-07 2:12 
QuestionHow to add xml code to web parts dynamically Pin
mukkanti00726-Jun-07 21:03
mukkanti00726-Jun-07 21:03 
AnswerRe: How to add xml code to web parts dynamically Pin
Ilya Verbitskiy8-Jul-07 0:51
Ilya Verbitskiy8-Jul-07 0:51 
Questionweb.config c#.net -2005 Pin
dhatchu24-Jun-07 20:56
dhatchu24-Jun-07 20:56 
AnswerRe: web.config c#.net -2005 [modified] Pin
Sylvester george6-Jul-07 0:05
Sylvester george6-Jul-07 0:05 
Questionxsl:variable [modified] Pin
vidoc24-Jun-07 20:43
vidoc24-Jun-07 20:43 
Hi There,

Found an xml article written in 2000 with following example:

XML:

<lineItems>
<lineItem>
<code>42AC5</code>
<title>Loopy Fruit Cereal</title>
<amount>12</amount>
<cost>4.25</cost>
</lineItem>
<lineItem>
<code>H343A</code>
<title>MicroSecond Rice</title>
<amount>14</amount>
<cost>2.35</cost>
</lineItem>
<lineItem>
<code>EA198</code>
<title>Crescent Toothpaste</title>
<amount>18</amount>
<cost>1.95</cost>
</lineItem>
</lineItems>

XSL:

You could then assign the total cost of the entire set of line items to a variable by using some of the built-in functions intrinsic to XPath:
<xsl:variable name="lineItemSubTotals">
<xsl:for-each select="//lineItem">
<subTotal><xsl:value-of select="number(amount)*number(cost)"/></subTotal>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="lineItemsTotal">
<xsl:value-of select="sum($lineItemSubTotals/subTotal)"/>
</xsl:variable>


Implementing the above creates following error:

Reference to variable or parameter 'lineItemSubTotals' must evaluate to a node list.
Any suggestions?




-- modified at 3:02 Monday 25th June, 2007
AnswerRe: xsl:variable Pin
Geo Pa25-Jun-07 8:00
Geo Pa25-Jun-07 8:00 
GeneralRe: xsl:variable Pin
vidoc25-Jun-07 9:48
vidoc25-Jun-07 9:48 
QuestionProject with source code Pin
hiral_shah24-Jun-07 4:23
hiral_shah24-Jun-07 4:23 
NewsRe: Project with source code Pin
BoneSoft25-Jun-07 11:27
BoneSoft25-Jun-07 11:27 
AnswerRe: Project with source code Pin
Sathesh Sakthivel17-Jul-07 1:55
Sathesh Sakthivel17-Jul-07 1:55 
Questionavoid the pdf refresh between server events Pin
haj_md24-Jun-07 0:39
haj_md24-Jun-07 0:39 
AnswerRe: avoid the pdf refresh between server events Pin
George L. Jackson24-Jun-07 3:01
George L. Jackson24-Jun-07 3:01 
Questionproblem while displaying xml with dtd Pin
koolprasad200321-Jun-07 21:23
professionalkoolprasad200321-Jun-07 21:23 
AnswerRe: problem while displaying xml with dtd Pin
Ilya Verbitskiy7-Jul-07 2:18
Ilya Verbitskiy7-Jul-07 2:18 
Questionsyncfusion datagrid and xml Pin
Keshav V. Kamat21-Jun-07 19:24
Keshav V. Kamat21-Jun-07 19:24 
QuestionChecking if a particular tags exists Pin
Brendan Vogt21-Jun-07 17:52
Brendan Vogt21-Jun-07 17:52 
AnswerRe: Checking if a particular tags exists Pin
George L. Jackson22-Jun-07 0:10
George L. Jackson22-Jun-07 0:10 
QuestionSelecting a particular element Pin
kumarjammula21-Jun-07 0:37
kumarjammula21-Jun-07 0:37 
AnswerRe: Selecting a particular element Pin
George L. Jackson21-Jun-07 11:51
George L. Jackson21-Jun-07 11:51 
GeneralRe: Selecting a particular element Pin
kumarjammula21-Jun-07 18:35
kumarjammula21-Jun-07 18:35 
QuestionMs Soap Toolkit 3.0 and complex data types. Pin
karanba21-Jun-07 0:19
karanba21-Jun-07 0:19 
Questionlooping in Xml nodes in C# Pin
saymajum20-Jun-07 13:40
saymajum20-Jun-07 13:40 

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.