Code example for DOMImplementation

Methods: hasFeature

0
 
  DocumentTraversal getDocumentTraversal(Document doc)
    throws XMLStreamException 
  { 
    DOMImplementation dom = doc.getImplementation();
    if (!dom.hasFeature("Traversal", "2.0"))
      throw new XMLStreamException("Traversal not supported"); 
    return (DocumentTraversal) doc;
  } 
 
  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)
  {