Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

urgent: need help with field reference in xsl:choose

Featured Replies

I posted 3 problems the day before yesterday. Yesterday, I posted an update with one problem solved and another larger in scope. Now, I'm posting another update and an urgent plea for help:

1) I found a way to resolve this issue.

2) Since my original post, problem #2 seemed to grow in scope. However, I've resolved the additional, seemingly related, issues. Now I'm back to my original unresolved issue below:

I have an often-used xsl:choose command that compares a field with a text string that doesn't work and I can't see why. A similar comparison between a token and a text string works just fine as did the comparison between the field and the text string in CDML.

...

Kit

Kit

Part

Number

3) Do you know of a good documentation source that could help me answer questions such as this? I've gleaned what I can from the Custom Web Publishing Guide and online XSL and XPath tutorials.

Please help!

Just a comment: forums are not always urgent.

2) You don't need to nest your xsl:choose clause, you can write analogous to a case statement the xsl:when in a series, if there is only one alternative if the tests fail:




   Kit

   Kit

   Part

 Number





or even:







   Kit

   Part

 Number

3) Consider buying the book by Michael Kay, XSLT : Programmer's Reference, 2nd ed., Wiley Publishing,2003.

The XSLT bible.

Read also http://www.filemaker.com/developers/resources/xml_xslt.html

  • Author

Thanks so much for getting back to me, Martin. Sorry for the "urgent" request. I'm under the gun to get this upgrade finished.

I tried both of the modifications you suggested and I'm still getting the same result: there is no error message; it just always goes to the default choice, whether the test is met or not. Any other ideas? I'll check out the website you mentioned. Also, I appreciate seeing how the boolean "or" can used to simplify the statement.

Thanks in advance for your help.

Hmm. What's the value of the field combo_no ?

  • Author

The field combo_no contains part numbers for kits as well as for parts. Examples include AM151KIT, BM1766KT, and M55. Oh, my gosh! I just realized what it is. The test is case sensitive (CDML wasn't) and I tend to prefer doing most of my coding in lower case...

I just tried changing the test string from 'kit'/'kt' to 'KIT'/'KT' and it worked! Your question provoked me to think it through. Thank you!

You can also use translate(), e.g. for upper- to lowercase conversion.


Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.