String href = null; String type = null; String title = null; String media = null; String charset = null; boolean alternate = false;
String href = null; String type = null; String title = null; String media = null; String charset = null; boolean alternate = false; StringTokenizer tokenizer = new StringTokenizer(data, " \t=");
  public void processingInstruction (String target, String data)    throws SAXException  {    if(target.equals("xml-stylesheet"))    {      String href = null; // CDATA #REQUIRED      String type = null; // CDATA #REQUIRED      String title = null; // CDATA #IMPLIED      String media = null; // CDATA #IMPLIED      String charset = null; // CDATA #IMPLIED      boolean alternate = false; // (yes|no) "no"      StringTokenizer tokenizer = new StringTokenizer(data, " \t=");      while(tokenizer.hasMoreTokens())      {        String name = tokenizer.nextToken();        if(name.equals("type"))        {          String typeVal = tokenizer.nextToken();          type = typeVal.substring(1, typeVal.length()-1);        }        else if(name.equals("href"))        {          href = tokenizer.nextToken();          href = href.substring(1, href.length()-1);          href = SystemIDResolver.getAbsoluteURI(href, m_source.getSystemId());        }        else if(name.equals("title"))        {          title = tokenizer.nextToken();          title = title.substring(1, title.length()-1);        }        else if(name.equals("media"))        {          media = tokenizer.nextToken();          media = media.substring(1, media.length()-1);        }        else if(name.equals("charset"))        {          charset = tokenizer.nextToken();          charset = charset.substring(1, charset.length()-1);        }        else if(name.equals("alternate"))        {          String alternateStr = tokenizer.nextToken();          alternate = alternateStr.substring(1, alternateStr.length()-1).equals("yes");        }      }      if((null != type) && type.equals("text/xsl") && (null != href))      {        if(null != m_media)        {          if(null != media)          {            if(!media.equals(m_media))              return;          }          else            return;        }        if(null != m_charset)        {          if(null != charset)          {            if(!charset.equals(m_charset))              return;          }          else            return;        }        if(null != m_title)        {          if(null != title)          {            if(!title.equals(m_title))              return;          }          else            return;        }        m_stylesheets.addElement(new InputSource(href));      }    }  }