I need to be able to add an element id to a tab which is being generated automatically by a sub header routine somewhere in these lines of code,
my $str = "<header>"; if ((!$Request->item("ResourceID")->item() && !$Request->item("n +oHeader")->item()) || !$Session->{'isAuthenticated'}) { $str .= "<logo url=\"http://".$Request->ServerVariables("SERVE +R_NAME")->item()."\" width=\"200\" height=\"62\" alt=\"http://".$Requ +est->ServerVariables("SERVER_NAME")->item()."\">Images/MLXhelp_logo.p +ng</logo> if($Session->{'isAuthenticated'}) { my $current = "Help"; if ($Request->item("Tab")->item()){$current = $Request->it +em("Tab")->item();} $str .= "<tabs>"; $str .= "<current>$current</current>"; $str .= "<tab id=\"Main\" tab=\"\" view=\"\" title=\"Main\ +" height=\"28\" width=\"86\" alt=\"Click here to return to the Main P +age\"/>"; $str .= xmlFileData("Base/optionalTabs", "help2.xml", "hea +der()") if ( $Request->ServerVariables("SERVER_NAME")->item() =~ /mlx +help/i ); $str .= xmlFileData("Base/optionalTabs", "help2.xml", "hea +der()") if ( $Request->ServerVariables("SERVER_NAME")->item() =~ /tem +pohelp/i ); $str .= xmlFileData("Base/optionalTabs", "support-new.xml" +, "header()"); if ($Request->item("Tab")->item() && $str =~ /(.*?<tab id= +\"$current\".*?>).*?(<\/tab>.*)/s) { $str = $1.$2; }
I think but am not sure that this is actually looping through my xml files and assigning the images to the tabs I need to add a name attribute to those image tags, It doesn't matter if its 1 2, 3 etc, I just need the name assigned so I can reference it directly.

In reply to finding element id? by grashoper

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.