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

The PTC Community email address has changed to community-mailer@ptc.com. Learn more.

goto_oid and current_tag_attr_value()

ptc-1123085
1-Newbie

goto_oid and current_tag_attr_value()

Hello. I am trying to get attribute values within a certain block of tags.

<relationship-block>

<form10k><form10kcomponent val="10k-business"/"></form10k>

<proxystmt><proxystmtcomponent val="prx-MERGERS"/"></proxystmt>

<forms1><forms1component val="s1-part1"/"></forms1>

<forms4><forms4component val="s4-part1"/"></forms4>

<form10><form10component val="10-other"/"></form10>

</relationship-block>

When the cursor is to the right of one of the empty tags with the ‘val’ attribute and I type this on the command line

response(current_tag_attr_value(val))

the Response dialog displays what I’m looking for. But if I put the same code in an ACL function, the Response dialog is empty.

function process_elements() {

$oid_marker = oid_root()

while (oid_valid($oid_marker)) {

$next_oid_marker = oid_forward($oid_marker)

# response(oid_name($oid_marker))

$oid_marker = $next_oid_marker

goto_oid($oid_marker)

response(current_tag_attr_value(val));

}

}

Is there something I am missing here? I want to transform all of the contents of val attributes within <relationship-block> tags to lowercase.

Thank you for any help in this matter.

- karen dL.

Karen Garrett de Luna
senior software engineer
Thomson Reuters
212.807.2936

2 REPLIES 2

Hi Karen-



Yes, you are missing something-quotation marks. J



While you can often get away with specifying unquoted strings on the command
line, it doesn't work in scripts. Try changing



response(current_tag_attr_value(val))



to:



response(current_tag_attr_value("val"))



in your script and see if that works. Of course, you should also be able to
use a variable there, e.g.



$target_attr = "val";

response(current_tag_attr_value($target_arr));



should also work.



(BTW, if you copy and paste code from this message, replace the
Outlook-munged curly quotes with standard straight quotes before you run
it.)



HTH



--Clay


Thank you! I was going crazy trying to get this to work.

- karen dL.