Displaying a message when there is no result of a query of XSL

With the help of MM_XSLTransform.class.php

I queries an XML file to generate a list of the places the name of city or address corresponds to a letter of the alphabet. The letter is passed as a variable in a URL.

XSL:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:param name="letter"/>
<xsl:output method="html" encoding="UTF-8"/>
<xsl:template match="/">
<xsl:for-each select="dataroot/CPINFOWEB[Town=starts-with(Town, $letter) or Name=starts-with(Name, $letter)]">
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
        <td>
    <a href="detail.php?park={CostCode}"><xsl:value-of select="Name"/></a><br />
          <a href="detail.php?park={CostCode}"><xsl:value-of select="Town"/></a><br />
      <xsl:value-of select="Address"/><br />
      <br />     
      </td>
        </tr>
      </table>
      </xsl:for-each>
</xsl:template>
</xsl:stylesheet>

PHP file:

setXML("..) /regions/CPINFOWEB-mobile.xml"); $mm_xsl-> setXSL ("list.xsl"); $mm_xsl-> addParameter("letter",$_GET['letter']); echo $mm_xsl-> Transform()?; >

The result of name and town are displayed as a URL to post a link to a page of 'more details'.

Everything works fine, but when there is no result for a letter of the alphabet I obviously a blank page.

How to display a message 'no result' instead

You're right, that it counts the total number of records. It is ages since I did anything with XSLT, but I dug a book that collected dust on my bookshelf and came up with the answer. Inside the conditional statement should look like this:


    
        No records found
    

I caught the XML file from your site and tested. This should do the trick.

Tags: Dreamweaver

Similar Questions

  • Flag message for Smartphones blackBerry displays messages when there is none

    How to fix the indicator of the envelope at the top of the screen that shows the number of messages to 3 when the message Inbox & email is empty? I tried to stop the aircraft, but it always display 3 messages and there is none. Help, thank you.

    Hello, please open your message icon and press the menu button (on the left of the trackball), and then click saved messages. Are there messages in there?

  • Photos of the iPhone continues to display "video download" when there is no video to download

    iPhone with iOS 9.3.2 6s.  Photos app continues to display "Video 1" when there is not download videos.  Have restarted the iPhone, a hard reset on iPhone and shot Photos market app in settings.

    You say that there is no video at all on the phone? Or you think that the video has already loaded?

  • How to display a message when users open the form

    Hello

    l want to display a message when a user opens a form.

    The message will explain the shape and if the clik user NOT close the form

    Thank you

    Stone

    You can use this script in the docReady event.

    if (xfa.host.messageBox("A message goes here to explain the form","Title for the Message Box", 1, 2) != 4) event.target.closeDoc();
    

    Just be careful, that I was unable to "test" it in LC, I had to save the file and open it in the drive to verify that it worked.

  • Display a message to the user w / result of data

    Howdy,

    First off it is a mission of the College work and it's especially complete; seeking advice and the experience here.  The mission is to create a calculator with many functions for each method of arithmetic.  It was easy enough, but the next step is to display a message to the user after each calculation.  For example, if the problem was 4 + 2, the message must be "the result of the addition is: 6. the creation of the part of the message by using the Msg to display the user-defined function is simple, but it is not exactly struck home.  I want to create a message that contains the result of the problem (for example 6).  As it is now I can't do that with the function of Msg, or if it is possible I can not quite understand.  I want to have a separate message for each function, but I don't know if I can incorporate the response into the message.  It's the underlying objective; How to integrate the response in a message dialog box to the user? If it is possible what should I watch?

    The VI himself is quite simple; case of structure for each arithmetic function and a certain time for execution loop.  X and there are entries and a drop-down list to select a structure if necessary. I've attached a screen below.

    Thank you

    THA

    You can use the Message to display to the user to view any string to the user. If the key is to use the palette of the chain to manipulate strings to get the error message.

    A subpalette of the palette of the chain is the range of number/String Conversion. This can help you get your (6) value into a string format and then you can concatenate that string however wished with the message.

    With the pop-up windows, you must make sure that you're not trigger this popup with every single loop, so make sure you put a case around the pop-up structure and place the logic in there to make it work only the case of popup when the value changes.

  • Displays error message when software update 9.2

    Why, it appears an error message when I want to update software 9.2?

    Well, since you do not identify the error message, it is rather difficult to answer. How about you provide the exact text of the error message, including all the numbers they appear.

  • Print the message when there are no pages to display in the output

    Hello

    I need to give a personalized message as ' report produced no output due to... ". "in the BI publisher report instead of adobe gives the error"there are no pages"in the pdf output.

    All entries?

    Thank you and best regards,
    Mukthi

    You must add a section break, and then have if@section.
    I forgot to mention in my previous answer.

  • Possible to display custom message when the report of responses not return any records?

    As the title suggests, is it possible not to hide this ugly no message result that lists your report filters and what not and instead display a custom message?

    go to the view of the results not appears down to the bottom of frame composed...
    then customize it...

    See this link:
    http://bischool.WordPress.com/2009/08/26/avoid-running-report-for-all-values-on-dashboard-when-using-multi-select-prompt/no-results-view/

  • How to display certain messages when the report refers to "no data".

    Hello guys

    I have a report that related data when the user select filter conditions specifically, when they are not while the report returns no data. There are columns of the city, and B that users will still have to filter so that the report at least some data.

    I would like to change the "no data" message "Please select A and B" report when the results in "no data". Is it possible to do?

    Your thoughts?

    Thank you

    Go to another and pass the lay composed of the report on the view (s) and then go to "view results" and there, you can view what you ever need it in the text

    It may be useful
    Thank you
    Prash

  • Display error message when a condition in the process page returns false

    Hello

    I doubt by displaying the error message in a page. In my treatment of the page, I have a process that is assosiated with

    a press the button. In the process, I have an 'if' condition and insert in a table when the "If" condition returns true. If

    It returns false that I need to display an error message like "cannot insert a value. I tried to give him in the error of process

    message, but it is not displaying when the if condition fails. Help, please


    Thank you

    TJ

    Edited by: tj2010 Oct 6, 2009 21:25

    Hello

    Have you tried

    If condition = true
    then
    insert into the table;
    on the other
    apex_application.g_print_success_message: = "your Message here";
    end if;

    Make sure that the branch on the page that is triggered after your process has the "success of process message includes" checked.

    Concerning

    Paul

  • Thunderbird showing 63 unread messages, when there is none

    In the Inbox, it contains 63 unread messages. I checked manually and there is not. I also hit the button to mark all messages as read, and it shows that 63 messages are read. This has happened on my old computer and followed through a new.

    I suggest you also check reviews | Records is set to "All".

    And your quickfilter settings are all off or erase.

    Where is the button to mark all as read? If this happened through an add-on? I don't think that it is a standard feature of Thunderbird.

  • Iphone6S does not display a message when I have a missed call

    I don't see all the messages that I have missed calls. Is there a setting I missed that will fix this problem for me.

    Make sure you have notifications enabled for phone application.

    Go to settings-> Notifications-> phone. Enable all these settings here.

  • Phone smart BlackBerry Smartphones shows that I have messages when there is none...

    Hi all

    I changed a 8310 > 9000 > 9700 and all of them (I create a backup) show I have 33 messages but in mailboxes I have nothing. There is no hidden etc folders

    anyway to get rid of them?

    The only way I can see is if you disable new message notifications. Another way?

    I also tried to update the software but no difference.

    Thank you!

    Tips to clear the message unread... try them in the order.

    If you have a new icon rogue Message on your home screen, or a negative number (-1), one of these solutions could erase or reset:

    Try these options:
    * Hard Reset BlackBerry now ALT CAP (right Shift key) and DEL (or with the BlackBerry power, remove the battery and reinsert the battery)
    Messages > saved Messages
    Messages > view folders, check each folder (calls, SMS and MMS, and boxes, saved missed boxes, browser, phone logs etc.)
    * Scroll at the top of the folder, on the title menu, click or tap to MARK PRIOR OPEN date
    Change your theme and see if it persists and return to your desired theme. (Options > theme > select.)
    * Clean and reload your OS.

  • Why the start window does not decrease when there are several results, and I want to check each?

    Is there anyway of peacekeeping beginning box upward?   By doing a search, 8 elements came, I right click the first to 'open', the start box breaks down the jpg couldn't be displayed (God knows why or where it is!) so I have to click on start and type in the search had once AGAIN, do it with all 8 icons... come on Microsoft all new fandangled stuff you've added and you assume if 35 things go up the first I click is the one I am you are looking for?

    Faster we go, the behinder we get.   Seems the more glitzy junk that is added, 'user-friendly' things common sense falls through the cracks of geek.

    Windows 7 and Office 2010 have made me really want to do not use a computer... I have a business online (successfully) and uses a computer for 18 years.    This "not compatible" nonsense, "is no longer supported" is just this absurdity.   It's as if they're building a new road in your area, well you have to buy a new car!   If they come out with new TV shows, you will need to buy a new TV.   That Microsoft is not?  The upgrade is good but forcing me to give up what I love and know you is crazy, boring and very discouraging.

    Ruth Niles

    Hi Ruth Niles.

    I suggest you run search and convenience store Index and see if that helps.

    Open the troubleshooter for search and indexing
    http://Windows.Microsoft.com/en-us/Windows7/open-the-search-and-indexing-Troubleshooter

    Hope it will be useful. Incase if you still have any other queries please respond with more details and we will be happy to help you.

  • How to display a message when the validation of several required fileds fails

    Hello.

    I use ColdFusion 9 and I have a question.

    When we have a form with required fields coded like this:

    < cfinput... required = "Yes" message = "Enter a value of 1" / >

    < cfinput... required = "Yes" message = "Enter a value 2" / >

    < cfinput... required = "Yes" message = "Enter a value of 3" / >

    When the user sumbits the form Needless to say a warning window:

    Enter a value of 1

    Enter a value 2

    Enter a value of 3

    How do I do it so then only one message is issued as:

    "Enter values for all required fields.

    Not a single message for each required field.

    Sorry for my imperfect English. Thank you.

    I don't think that automatic, integrated to cfinput validation will allow you to do. You must create your own validation. Here's an example to help you get started:

    a:

    b:

    c:

    It's just a basic validation script to illustrate the principle. You can of course do as sophisticated as you want, or even import specialized libraries of Javascript to do the posting for you.

Maybe you are looking for

  • where is the awesome bar for every night?

    I need to see and to be able to copy the url - search is nice but not necessary, because I find on my homepage (protopage) and of course the startup page every night.

  • The weird keyboard on Satellite Pro L20

    I bought a new Satellite L20 here at the Kuwait, and I have the problem with the keys on the keyboard. Usually, it is SHIFT + 2 for ' @' character and it is how he has been informed on my keyboard, but the entry gives me the quotation marks ("") and

  • Re: Tecra M9 - launched, press tab and it beeps, fan runs lights flash.

    Hello My Tecra M9 was abandoned, worked for a few days and now does not work. I suspect a bad CPU. When I plug it in, the laptop tries to turn on without me having to press anything.There is no fan, no beeps, no activity of the screen, without backli

  • UIDPLUS information

    Hello I saw in a Microsoft article UIDPLUS should be available in Exchange 2010 SP1 or later. I've seen in various environments, including 2010 Sp1, Sp3 2010, etc., which must have UIDPLUS, but when the order of ABILITY - that UIDPLUS is not reported

  • I wanted to buy program

    Buon giorno I wanted to upgrade photoshop ho version cs4 a passare photoshop cc