Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7061681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:30:13+00:00 2026-05-28T04:30:13+00:00

I have a SP Dataview that I have converted to XSLT, so that I

  • 0

I have a SP Dataview that I have converted to XSLT, so that I could add a header displaying a percentage (Complete).
Before I converted the dvwp to xslt, I added two count headers- one on Complete, and another on LastName. They worked wonderfully- showing me the # of records and the # of records with a value in the complete field. However, when I converted the dv to xslt I realized that I lost my headers 🙁

So, I am adding them back in using xslt. Currently the XPath code for the equation that I have is <xsl:value-of select="count($Rows) div count($Rows)" />.
How do I get the total # of Yes values that are in my Complete field?

UPDATE1:
Found this http://www.endusersharepoint.com/STP/viewtopic.php?f=14&t=534 and tried it, however causes the following error- Failed setting processor stylesheet: 0x80004005: Argument 1 must return a node-set. –>count(/dsQueryResponse/Rows/Row=’Y’)<–

UPDATE2:
Complete is the name of a field w/i my XSLT dataset. The return type is either Y or blank. For grins I tried <xsl:value-of select="count(/xpath/to/parent/element[@Complete eq 'Y']) div count($Rows)" /> however I recieved the following error- Failed setting processor stylesheet: 0x80004005: Expected token ‘]’ found ‘NAME’.count((/xpath/to/parent/element[@Complete –>eq <–‘Y’]) div count($Rows) Am starting to think that there may be a problem w/ ‘eq’…. Referencing my XML operators…

UPDATE3:

<xsl:value-of select="count(/xpath/to/parent/element[@Complete = 'Y']) div count($Rows)" />

Okay so it still says 0, but I think the reason why it’s not showing the correct answer is b/c it is expecting to show an integer, and obviously the value being returned from the equation is going to be a decimal… Have been fiddling with the equation in XPath… here’s what I’ve tried-

count(/xpath/to/parent/element[@Complete = 'Y']) div count($Rows)*100
(count(/xpath/to/parent/element[@Complete = 'Y']) div count($Rows))*100
100(count(/xpath/to/parent/element[@Complete = 'Y']) div count($Rows))

UPDATE4:
So I know my previous thought that the correct number not showing b/c it was a float is not correct, as all numbers in XPath and XSLT 1.0 are floats. Reference

UPDATE5:
Upon further investigation, I have found that the problem lies with the count(/xpath/to/parent/element[@Complete = 'Y']) part of my equation, as this is returning 0 instead of a value. [i know i have at least 3 ‘Y’ vals in my Complete col]

UPDATE6:

<records*>
<record*>
  <last_name></last_name>
  <first_name></first_name>
  <mi></mi>
  <office_symbol></office_symbol>
  <geo_location></geo_location>
  <complete></complete>
  <date_complete></date_complete>
  <date_expires></date_expires>
  <email></email>
  <supervisor></supervior>
</record*>
</records*>

*i don’t know what these nodes are called as my data is coming from a database and not an xml file, i just made up record/records

UPDATE7
Going back to my original question. I am still trying to find out the XPath equation to display the number of parents (record in the XML i posted above) where the complete node = Y.

UPDATE8
Ok. So I have edited and tested using http://www.w3schools.com/xsl/tryxslt.asp?xmlfile=cdcatalog&xsltfile=tryxsl_value-of. Working XSLT to count the # of Complete = Y is <xsl:value-of select="count(catalog/cd [complete = 'Y'])" /> so theen I put EXACTLY what works on W3schools into my SP Dataview and I get nothing… just an empty space. Why doesn’t the code work in my SPDV?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:30:14+00:00Added an answer on May 28, 2026 at 4:30 am

    If your “Complete” field is an element:

     <xsl:value-of select="count(/xpath/to/complete/field/element[string(.) eq 'Yes])"/>
    

    If your complete field is an attribute of an element:

     <xsl:value-of select="count(/xpath/to/parent/element[@complete eq 'Yes'])"/>
    

    Without knowing the structure of your XML I can’t provide the specific XPATH required — the predicate “[]” is what selects only the “Yes” values

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to add two DataViews together to have one Dataview that can then
I have a DataView that is always displaying the scroller, I need the scroller
I have a dataview that contains a list of tables. I am reading in
I have a code that creates a dataview for a datagrid : DataTable dt
If you have a DataGridView that is bound to a DataView (someDataTable.DefaultView). ..and a
I have a list (Ext.dataview.List) and i want to add an textbox at the
I have a Store that need to load DataView, I used Dummy Data until
I have a function that returns a datatable, I added a code that will
In Sencha Touch, I often need to have an Ext.DataView panel that contains a
I have a DataView that was already populated with data (Verified this to be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.