Code example for DOMImplementation

Methods: hasFeature

0
 
  XPathEvaluator getXPathEvaluator(Document doc)
    throws XMLStreamException 
  { 
    DOMImplementation dom = doc.getImplementation();
    if (!dom.hasFeature("XPath", "3.0"))
      throw new XMLStreamException("XPath not supported"); 
    return (XPathEvaluator) doc;
  } 
 
  static String getParameter(String contentType, String name)
  { 
    StringTokenizer st = new StringTokenizer(contentType, " ;");
    if (st.hasMoreTokens())
      st.nextToken();
    while (st.hasMoreTokens())
      { 
        String token = st.nextToken();
        int ei = token.indexOf('=');
        if (ei != -1)
          {