Getting First Non-Zero Element Value

Posted on 2011-04-19
Last Modified: 2013-11-18
I was wondering that how can we  display first non zero bunHCID value along with count. Kindly look into related questions for XML and XSLT details.
Question by:Yassar
    LVL 60

    Accepted Solution

    <xsl:value-of select="//bunHCID[generate-id() = generate-id(key('od', .)[1])][1]"/>
    LVL 60

    Expert Comment

    by:Geert Bormans
    but basically this should work too
    <xsl:value-of select="(//bunHCID[normalize-space(.)])[1]"/>

    Author Closing Comment

    LVL 60

    Expert Comment

    by:Geert Bormans

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Training Course: Adobe Dreamweaver CC 2015

    Adobe Dreamweaver Creative Cloud is used by web designers and front-end developers and allows you to visualize your site in real-time as you code. This course covers exam objectives for the Adobe Certified Associate (ACA) certification.

    Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
    Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL ( several years ago, it seemed like now was a good time to updat…
    Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
    The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now