Thanks for the pointer, Brandon. 6.0 m010 does support #SETATTR. And, I
think I am close. Hopefully I just need some XPath help addressing
namespaced elements ... or, I fear, the namespaced attributes are "hidden"
from the #SETATTR code somehow.
Specifically, I am trying to capture the value of atidlm:targetLocator on
element atidlm:resourcepair. I can use standard FOSI fillvals to capture
and save other atidlm:xxxxx attributes on atidlm:resourcepair. But I can't
get #SETATTR to access it.
The following will produce a working link leveraging an existing
<my_link_element> e-i-c:
<savetext textid="my_link.txt" conrule="!<my_link_element type="http">!,#<br />SETATTR(target,"<a style="COLOR: blue; TEXT-DECORATION: underline" target="_BLANK" href="http://google.com")#ENDSETATTR,my_targetName.txt,!</my_link_element>!" "=">http://google.com")#ENDSETATTR,my_targetName.txt,!</my_link_element>!'
placemnt="before">
But this does not:
<savetext textid="my_link.txt" conrule="!<my_link_element type="http">!,#<br />SETATTR(target,@atidlm:targetLocator)#ENDSETATTR,my_targetName.txt,!</my_link_element>!" <br="/>placemnt="before">
Does XPath require something magical to "see" an attribute in the atidlm
namespace?
I notice that much of the code using this (maybe all) uses the string
function like this:
#SETATTR(myattr,string(@dtdattr))#ENDSETATTR
It didn't help in my case.
Any thoughts?
On Sat, Aug 18, 2012 at 1:03 AM, Brandon Ibach <
brandon.ibach@single-sourcing.com> wrote:
> Hey, Paul...
>
> There is a feature which, as far as I can tell, is undocumented, but is
> used by Styler to do something like this. It seems to be supported in
> later 5.3 versions (M210 has it, but M010 does not appear to), some 5.4
> (M050 has it) and all 6.0 versions. You can probably see if it's supported
> in your version by searching for "SETATTR" in
> packages\main\_styleexportfosi.acl, which is the code that transforms a
> Styler sheet into a FOSI.
>
> I haven't tested this, but based on how Styler uses it, something like
> this may work:
>
> <savetext textid="myvar1.txt"<br"/>> conrule='!<myelement>!,#SETATTR(myattr,@dtdattr)#ENDSETATTR,#CONTENT,!</myelement>!'
> placemnt="before">
>
> The part after the comma in the #SETATTR is an XPath, so you should be
> able to put just about anything into the attribute with that construct.
>
> -Brandon 🙂
>
>
>