Thanks for the reply mirod, Is it possible from my method to do like that. i need to get and update the same where i have commented. i need to do like this process a lot with "content" elements. so it would be better i should twig the content and from there i should get whatever i want instead seperate process. it will help me in understand the process also. Please help me.
It would be very similar: 1 pass to build the %self2pnam map, same as in the code above, except maybe adding a $_->purge at the end of the handler. The second pass would have a handler on content that would do exactly what's in the foreach loop.
At this point, I believe you have all the elements to write the code yourself.
i tried but the hash value not passed to the content_handler. how can i do that? I have one more clarification regarding keep_atts_order. i am using keep_att_order=>1 in the twig_handler but it's not kept my all attributes in the same order which i have added like below