September 28, 200619 yr 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) [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
September 28, 200619 yr 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
September 28, 200619 yr If the header has only one "from", "to", and "sender", then technically there's no difference. Only your personal style does matter 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 :
September 28, 200619 yr Author 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 September 28, 200619 yr by Guest
Create an account or sign in to comment