cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X

Programmatically Set Profiles AND Compose Using XSL

ptc-953422
1-Newbie

Programmatically Set Profiles AND Compose Using XSL

Has anybody done "Set Profiles" programmatically? I've been able to
"Compose using XSL"

programmatically with the ACL code below [thanks, Clay, for the
essential pieces here,

from Adepters, Oct 17, 2005, "Programmatically Compose to HTML"].



Now what I need to do is add to the code "Set Profiles" functionality.
But for my purposes,

I only need to handle one value at a time for the profile attribute, and
"Set Profiles"

should be active (not optional) for each call.



Any help and/or advice on relevant ACL functions or packages most
appreciated.



[The code prompts the user to select an XSL file, output file, and
parameter value---passing

in a parameter value can't be done via the "Compose Using XSL" dialog.]
2 REPLIES 2

Hi Jack-



I think you should be able to do this by setting the
'prof.logicalExpression' entry in $myparams. Use a markup-based structure to
indicate the conditions you want profiled-details can be found in the
Customizer's Guide, chapter 3. For example,
$myparams["prof.logicalExpression"] = "<profileref alias="platform" <br="/>value='UNIX'/>" to profile for the UNIX platform. You can use the
LogicalExpression structure described in the Customizer's Guide to specify a
complicated logical profile condition, e.g. platform=UNIX AND (userlevel =
novice OR userlevel = typical).



The usual caveats apply-code is untested, debugging left as an exercise,
etc. etc.



HTH.



--Clay



Clay Helberg

Senior Consultant

TerraXML


Clay,



Thanks as usual for the great advice. It worked just as you suggested.
I added a "NO-PROFILE"

value to the "Profile" choices to inhibit "invoking Set_Profiles."



There's more logic available, as you also suggested, with the use of
the element <logicalexpression> to

develop more complex Profile conditions. I'll have to spend some time
with the example in

...\Editor\packages\tools\_profile.acl to see if that might be useful
for us.



Here's my working ACL code for anyone else who might need to pass
parameters and set profiles

while composing using XSL.
Announcements