aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r1715390 - /aries/trunk/blueprint/blueprint-parser/src/main/java/org/apache/aries/blueprint/parser/Parser.java
Date Fri, 20 Nov 2015 16:44:49 GMT
Author: gnodet
Date: Fri Nov 20 16:44:48 2015
New Revision: 1715390

URL: http://svn.apache.org/viewvc?rev=1715390&view=rev
Log:
[ARIES-1456] Provide a systemId for the parsed xml document

Modified:
    aries/trunk/blueprint/blueprint-parser/src/main/java/org/apache/aries/blueprint/parser/Parser.java

Modified: aries/trunk/blueprint/blueprint-parser/src/main/java/org/apache/aries/blueprint/parser/Parser.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/blueprint-parser/src/main/java/org/apache/aries/blueprint/parser/Parser.java?rev=1715390&r1=1715389&r2=1715390&view=diff
==============================================================================
--- aries/trunk/blueprint/blueprint-parser/src/main/java/org/apache/aries/blueprint/parser/Parser.java
(original)
+++ aries/trunk/blueprint/blueprint-parser/src/main/java/org/apache/aries/blueprint/parser/Parser.java
Fri Nov 20 16:44:48 2015
@@ -233,12 +233,17 @@ public class Parser {
      * @throws Exception on parse error
      */
     public void parse(InputStream inputStream) throws Exception { 
-      InputSource inputSource = new InputSource(inputStream);
-      DocumentBuilder builder = getDocumentBuilderFactory().newDocumentBuilder();
-      Document doc = builder.parse(inputSource);
-      documents.add(doc);
+      parse(null, inputStream);
     }
-    
+
+    public void parse(String location, InputStream inputStream) throws Exception {
+        InputSource inputSource = new InputSource(inputStream);
+        inputSource.setSystemId(location);
+        DocumentBuilder builder = getDocumentBuilderFactory().newDocumentBuilder();
+        Document doc = builder.parse(inputSource);
+        documents.add(doc);
+    }
+
     /**
      * Parse blueprint xml referred to by a list of URLs
      * @param urls URLs to blueprint xml to parse
@@ -250,7 +255,7 @@ public class Parser {
         for (URL url : urls) {
             InputStream inputStream = url.openStream();
             try {
-                parse (inputStream);
+                parse (url.toString(), inputStream);
             } finally {
                 inputStream.close();
             }



Mime
View raw message