Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. xsl:variable [modified]

xsl:variable [modified]

Scheduled Pinned Locked Moved XML / XSL
xmlhelptutorialquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vidoc
    wrote on last edited by
    #1

    Hi There, Found an xml article written in 2000 with following example: XML: 42AC5 Loopy Fruit Cereal 12 4.25 H343A MicroSecond Rice 14 2.35 EA198 Crescent Toothpaste 18 1.95 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: 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

    G 1 Reply Last reply
    0
    • V vidoc

      Hi There, Found an xml article written in 2000 with following example: XML: 42AC5 Loopy Fruit Cereal 12 4.25 H343A MicroSecond Rice 14 2.35 EA198 Crescent Toothpaste 18 1.95 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: 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

      G Offline
      G Offline
      Geo Pa
      wrote on last edited by
      #2

      The variable, $lineItemSubTotals, is a tree and not a node set (node list). Thus, you need to use "msxsl:node-set(string)":

      <xsl:value-of select="sum(msxsl:node-set($lineItemSubTotals/subTotal))"
      
      V 1 Reply Last reply
      0
      • G Geo Pa

        The variable, $lineItemSubTotals, is a tree and not a node set (node list). Thus, you need to use "msxsl:node-set(string)":

        <xsl:value-of select="sum(msxsl:node-set($lineItemSubTotals/subTotal))"
        
        V Offline
        V Offline
        vidoc
        wrote on last edited by
        #3

        Thanks

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups