Menu

tag.getAttributesEx() problem =.=

Help
2005-02-09
2013-04-27
  • mikeliu1976

    mikeliu1976 - 2005-02-09

    regards:

    ----------------------------------------------------------------------------------------------------
                                                                    
    code 1:

    ----------------------------------------------------------------------------------------------------
                                                                    
              Vector attributes; 
              attributes = tag.getAttributesEx();

    ----------------------------------------------------------------------------------------------------
                                                                    
    code 2:

    ----------------------------------------------------------------------------------------------------
                                                                    
           for(attributesCount=0;attributesCount<attributes.size();attributesCount++){
               if(attributesCount==0){
              attribute = (Attribute)attributes.elementAt(0);
              attribute.setName(attribute.getName().toLowerCase()); 
              }          
              else{
            
              char TobecheckQuote=((Attribute)attributes.elementAt(attributesCount)).getQuote();
       (TobecheckQuote=="""){
              }
              else{
                     
        ((Attribute)attributes.elementAt(attributesCount)).setQuote(""");
            }
             }
          }

    ----------------------------------------------------------------------------------------------------
                                                                    
      tag"s name is 0th Attribute of attributes;
             I lowercase tag"s name and want to check every attribute"s quote is """;
             by code 2:
             but in no use.
             Any suggestion is welcome.Did I miss something important?.....@@.
            
             thank you 
      May goodness be with you all

     
    • mikeliu1976

      mikeliu1976 - 2005-02-10

      regards:
      ----------------------------------------------------------------------------------------------------
      code
      ----------------------------------------------------------------------------------------------------
           Vector attributes; 
            Attribute attribute; 
               attributes = tag.getAttributesEx();
               int attributesCount;
              
               for(attributesCount=0;attributesCount<attributes.size();attributesCount++){
                if(attributesCount==0){
               attribute = (Attribute)attributes.elementAt(0);
               attribute.setName(attribute.getName().toLowerCase());    
                     }          
                  else{
                   char TobecheckQuote=((Attribute)attributes.elementAt(attributesCount)).getQuote();
                  if(TobecheckQuote=='"'){
              }
                   else{
                      ((Attribute)attributes.elementAt(attributesCount)).setQuote('"');
                     }
       
                     }
          }
      ---------------------------------------------------------------------------------------------------
      unexpected output:
      ----------------------------------------------------------------------------------------------------
      omited------------------------------------------------------------------
      <body" "leftmargin="0"" "topmargin="0"" "bgcolor="#8C9163"" "text="#000000"><table" "height="100%"border="0"" "align="center"" "cellpadding="0"" "cellspacing="0"><tr><td"  "colspan="3"><table" "border="0"" "cellspacing="0"" "cellpadding="0"><tr>
      <td" "align="right"" "class="eng_line"><img" "src="http://www.yzu.edu.tw/images/main/eng-title.gif"" "width="260"" "height="18" alt="*"></td>
      </tr><tr>
      <td" "class="top_img"><img" "src="http://www.yzu.edu.tw/images/main/top-main-01.jpg"" "width="800"" "height="90"" "border="0"" "usemap="#Map" alt="*"><map" "name="Map"><area" "shape="circle"" "coords="66,45,44"" "href="/?PHPSESSID=c849a291f40ea22447a392d4b419b468"" "alt="&#20803;&#26234;&#22823;&#23416;&#39318;&#38913;"></map></td>
      </tr></table></td></tr><tr><td" "align="center"" "valign="top"" "class="left_bar"><table" "border="0"" "cellpadding="0"" "cellspacing="0">
      <tr>
      <td" "width="132"></td>
      </tr>
      <tr><td" "align="center">&nbsp;</td></tr>
      omited------------------------------------------------------------------
      seems that "" added before Attribute name =.=

          tag"s name is 0th Attribute of attributes;
              I lowercase tag"s name and want to check every attribute"s quote is """;
              but in no use.
              Any suggestion is welcome.Did I miss something important?.....@@.
              
          thank you 
            May goodness be with you all
             

         
         

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.