Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Help with field result


This topic is 6904 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi Guys,

I've been trying to get to grips with XML, by downloading the various examples from XML Central and reading the guide FMP 6 Developer Guide to XML/XSL by Beverly Voth. Im stuck on a very small thing, which any one with real xml experience will find very easy to answer.

Ive got my code listed below:

Im exporting fields A through to Z, where the Z field (position() 26) contains a colour value. The data might say Yellow, Red, White etc.

My question is, how do I alter my line 3 to check the value of the field and call the necessary coloured variable.

I have created variables underneath my stylesheet which I would like to call from the above code, ill just give yellow as an example:

#FFFF99

Any help will be much appreciated

Many Thanks

Posted

Instead of using long lists of variable definitions and or statements, it's better to use an external translation table where the individual translation color --> hex RGB value can be looked up with an XPath. You gain a lot of flexibility, and the code is very short and efficient.

See the attached example how this works.

colors.zip

Posted

Thankyou very much Martin,

Your example helped me in more ways than you think. Its further enhanced the my limited knowledge of stylesheets and how they are constructed...

One thing I dont quite understand - (and Im only a beginner - only spent around 28 hours, reading and doing examples), when I define a variable I use a . In your example you dont....the code works, but why do .

Can you recommend any further "basic" books I can increase my knowledge on this subject with the use of FileMaker - especially with MSOFFICE.

Many thanks once again

Jalz

Posted

Hi Martin,

I've been developing the example you gave me and I've finally achieved the result I wanted (in html format). I need to export data from another TO, and Im fairly confident that I can create a stylesheet to get that to present in the format I'd like. Is it possible, when I do the second export, to "merge" the results of the first xlst result?

Posted

Yes, export the first TO as XML (or transform it to another XML format, also possible).

When exporting the second TO, use a stylesheet that loads the first XML TO with the document() function. Then you can transform both XML trees and merge them.

This topic is 6904 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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