File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
modules/ingest-common/src
main/java/org/elasticsearch/ingest/common
test/java/org/elasticsearch/ingest/common Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -52,10 +52,10 @@ public final class XmlProcessor extends AbstractProcessor {
5252 public static final String TYPE = "xml" ;
5353
5454 private static final XPathFactory XPATH_FACTORY = XPathFactory .newInstance ();
55-
55+
5656 // Pre-compiled pattern to detect namespace prefixes
5757 private static final Pattern NAMESPACE_PATTERN = Pattern .compile (".*\\ b[a-zA-Z][a-zA-Z0-9_-]*:[a-zA-Z][a-zA-Z0-9_-]*.*" );
58-
58+
5959 // Pre-configured SAX parser factories for secure XML parsing
6060 private static final javax .xml .parsers .SAXParserFactory SAX_PARSER_FACTORY = createSecureSaxParserFactory ();
6161 private static final javax .xml .parsers .SAXParserFactory SAX_PARSER_FACTORY_NS = createSecureSaxParserFactoryNamespaceAware ();
@@ -390,9 +390,9 @@ public Iterator<String> getPrefixes(String namespaceURI) {
390390 }
391391 });
392392 }
393-
393+
394394 // Use pre-compiled pattern to detect namespace prefixes
395-
395+
396396 for (Map .Entry <String , String > entry : xpathExpressions .entrySet ()) {
397397 String xpathExpression = entry .getKey ();
398398 String targetFieldName = entry .getValue ();
@@ -557,9 +557,9 @@ public void fatalError(org.xml.sax.SAXParseException exception) throws org.xml.s
557557
558558 // Use enhanced handler that can build DOM during streaming when needed
559559 XmlStreamingWithDomHandler handler = new XmlStreamingWithDomHandler (needsDom );
560-
560+
561561 parser .parse (new java .io .ByteArrayInputStream (xmlString .getBytes (StandardCharsets .UTF_8 )), handler );
562-
562+
563563 // Store structured result if needed
564564 if (storeXml ) {
565565 Object streamingResult = handler .getStructuredResult ();
Original file line number Diff line number Diff line change @@ -581,10 +581,10 @@ public void testRemoveNamespaces() {
581581
582582 Map <String , Object > data = ingestDocument .getFieldValue (TARGET_FIELD , Map .class );
583583 Map <String , Object > foo = (Map <String , Object >) data .get ("foo" );
584-
584+
585585 assertTrue ("Element without namespace should be present" , foo .containsKey ("bar" ));
586586 assertThat (foo .get ("bar" ), equalTo ("value" ));
587-
587+
588588 // Now test with removeNamespaces=false
589589 IngestDocument ingestDocument2 = createTestIngestDocument (xml );
590590
You can’t perform that action at this time.
0 commit comments