[ 
https://issues.apache.org/jira/browse/NIFI-4062?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16126955#comment-16126955
 ] 

ASF GitHub Bot commented on NIFI-4062:
--------------------------------------

Github user ijokarumawak commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2080#discussion_r133133523
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EvaluateXPath.java
 ---
    @@ -75,10 +45,47 @@
     import org.apache.nifi.processor.io.OutputStreamCallback;
     import org.apache.nifi.stream.io.BufferedInputStream;
     import org.apache.nifi.stream.io.BufferedOutputStream;
    +import org.w3c.dom.Document;
    +import org.xml.sax.EntityResolver;
     import org.xml.sax.InputSource;
    +import org.xml.sax.SAXException;
     
    -import net.sf.saxon.lib.NamespaceConstant;
    -import net.sf.saxon.xpath.XPathEvaluator;
    +import javax.xml.namespace.QName;
    +import javax.xml.parsers.DocumentBuilder;
    +import javax.xml.parsers.DocumentBuilderFactory;
    +import javax.xml.parsers.ParserConfigurationException;
    +import javax.xml.transform.ErrorListener;
    +import javax.xml.transform.OutputKeys;
    +import javax.xml.transform.Source;
    +import javax.xml.transform.Transformer;
    +import javax.xml.transform.TransformerException;
    +import javax.xml.transform.TransformerFactory;
    +import javax.xml.transform.TransformerFactoryConfigurationError;
    +import javax.xml.transform.dom.DOMSource;
    +import javax.xml.transform.stream.StreamResult;
    +import javax.xml.xpath.XPathExpression;
    +import javax.xml.xpath.XPathExpressionException;
    +import javax.xml.xpath.XPathFactory;
    +import javax.xml.xpath.XPathFactoryConfigurationException;
    +import java.io.ByteArrayOutputStream;
    +import java.io.IOException;
    +import java.io.InputStream;
    +import java.io.OutputStream;
    +import java.io.StringReader;
    +import java.io.UnsupportedEncodingException;
    +import java.util.ArrayList;
    +import java.util.Collection;
    +import java.util.Collections;
    +import java.util.HashMap;
    +import java.util.HashSet;
    +import java.util.List;
    +import java.util.Map;
    +import java.util.Properties;
    +import java.util.Set;
    +import java.util.concurrent.atomic.AtomicReference;
    +
    +import static javax.xml.xpath.XPathConstants.NODESET;
    +import static javax.xml.xpath.XPathConstants.STRING;
    --- End diff --
    
    I assume these import statement changes are automatically generated by IDE. 
Is it possible to change only necessary lines of code?


> Provide an option to disable DTD validation for EvaluateXPath and 
> EvaluateXQuery
> --------------------------------------------------------------------------------
>
>                 Key: NIFI-4062
>                 URL: https://issues.apache.org/jira/browse/NIFI-4062
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Extensions
>    Affects Versions: 1.0.0
>            Reporter: Koji Kawamura
>            Assignee: Arun Manivannan
>              Labels: beginner
>
> Currently EvaluateXPath and EvaluateXQuery can fail if the source document 
> has DOCTYPE definition in it, especially using external DTD. It would be 
> useful if these processor provides a property to disable DTD validation when 
> evaluate XPath or XQuery.
> References:
> https://community.hortonworks.com/questions/107121/does-evaluatexpath-support-doctype.html
> https://stackoverflow.com/questions/243728/how-to-disable-dtd-at-runtime-in-javas-xpath



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to