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

Community Tip - Did you get called away in the middle of writing a post? Don't worry you can find your unfinished post later in the Drafts section of your profile page. X

ACL-How to grab all tags by attribute and and insert content in seperate tag?

lfuellenbach
3-Newcomer

ACL-How to grab all tags by attribute and and insert content in seperate tag?

Hello, I am a newbie when it comes to ACL. Im looking to create a script that will grab all tags in a document with an certain attribute set to a certain value and then grab its contents witch will be a string of text, and then copy the text and place it in a tag I create like a list. Also if possible, I need to grab the context of where these tags are. For example: Say I have a document with chapters and sections. And within these chapters and sections i have a "highlight" tags. I would like to grab every "highlight" tag in the doc and put it in a list at the bottom of the document where the text in the tag and the chapter and section of where it is located and place it in the list at the end of the document. Any help would be very useful. Thanks!

1 REPLY 1

Typed code. Not tested. You'll have to verify it. You will have to have some understanding of what an "oid" is to use it. An "oid" is the name or location or ID of a given element in a given document.

# This sets the variable, root_o, to the oid of the root of the document.

root_o = oid_root()

# This fills an ACL array, array_of_oids_with_attr, of all the elements

# that have the attribute "hightlight" set equal to "yes".

highlight_count = oid_find_child_attrs($root_o, array_of_oids_with_attr, "highlight", "yes")

# This will loop through the array (if it contains anything)

for (i = 1 ; i <= $highlight_count ; i++) {

# your "work" code will have to go here

# oid_content(array_of_oids_with_attr[$i]) is the "handle" for each

# element found by oid_find_child_attrs() above

} # for

For lots more help (have I seen you there already, Lisa? I kind of think so ... oh well, just in case...), your best bet, if you haven't solved this or moved on already, is to join the Adepters mailing list where lots and lots of Arbortext users, admins, and developers hang out 24/7/365. Information on joining that list (as well as pointers to lots of other Arbortext resources) can be found here:

http://blog.single-sourcing.com/top-arbortext-resources

See also:

http://www.single-sourcing.com/company/social.html

Good luck!

Announcements

Top Tags