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

XSL formation for FMPXML to cXML


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

Recommended Posts

Posted

Going from FMP to cXML.

cXML output should look like the following for the Header section (file has many sections with similar element:attribute pairs):D

[color:blue]

[color:#FFFFFF]--[color:blue]

[color:#FFFFFF]---- [color:blue]

[color:#FFFFFF]------[color:blue]007[color:blue]

[color:#FFFFFF]----[color:blue]

[color:#FFFFFF]--[color:blue]

[color:#FFFFFF]--[color:blue]

[color:#FFFFFF]----[color:blue]

[color:#FFFFFF]------[color:blue]1463[color:blue]

[color:#FFFFFF]----[color:blue]

[color:#FFFFFF]--[color:blue]

[color:#FFFFFF]--[color:blue]

[color:#FFFFFF]----[color:blue]

[color:#FFFFFF]------[color:blue]9647[color:blue]

[color:#FFFFFF]------[color:blue]banana[color:blue]

[color:#FFFFFF]----[color:blue]

[color:#FFFFFF]----[color:blue] Supplier[color:blue]

[color:#FFFFFF]--[color:blue]

[color:blue]

My question is wether I should treat the [color:blue] element as the template; use [color:blue] as templates; or nest them all into one big one using templates and parameters? Does templating support nested templates so that the Sender Credential Identity is accessed seperately from the To Credential Identity?

tia,

d

Posted

I don't think it much matters. But if it as simple as above I'd just do . It doesn't much matter that you have same-named elements, because they're within the nodes of different elements.

From/Identity

is not

To/Identity

You can nest templates, with xsl:apply-templates, or call-template. But unless there's a real reason to I wouldn't, as too much "modularization" can be as bad as not enough, IMHO.

I'm not an expert on templates. Take a look at Mikhail Edoshin's XSLT pages:

http://edoshin.skeletonkey.com/xmlxslt/index.html

Posted

If the header has only one "from", "to", and "sender", then technically there's no difference. Only your personal style does matter :D I typically make such elements separate templates because to me it seems clearer, less ambiguous when I read the code later. I.e.:

is probably longer, but very simple: there's no confusion about what's what.

(Saw you question in my blog but got time to answer only now :

Posted (edited)

Ahh the cloud cover has lifted.

Thank you for your time and assistance.

d

One remaining question:

You mention "If the header has only one", I guess logically there could be many. How would one handle that?

For instance:

Jimmy

Partner>

Jimmy

Partner>

Jimmy

Partner>

thank you,

d

Edited by Guest

This topic is 6629 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.