This is an automated email from the ASF dual-hosted git repository.

radu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 2b1207a  SLING-8570 - Extract a generic Content Parser API from 
org.apache.sling.jcr.contentparser with pluggable implementations
2b1207a is described below

commit 2b1207a4485cfd0e7ac997a0e1391f799ee2dc69
Author: Radu Cotescu <[email protected]>
AuthorDate: Mon Jul 15 12:02:03 2019 +0200

    SLING-8570 - Extract a generic Content Parser API from 
org.apache.sling.jcr.contentparser with pluggable implementations
    
    * added parser for JCR-flavoured XML
    * made the ParserHelper compatible with both Java 8 and Java 11
    * reduced the number of dependencies for all modules
---
 .../sling/contentparser/api/ParserHelper.java      |  35 ++--
 .../sling/contentparser/api/ParserHelperTest.java  |   1 +
 .../org-apache-sling-contentparser-json/pom.xml    |  27 ---
 .../json/internal/JsonTicksConverter.java          |   3 +-
 .../json/internal/JsonContentParserTest.java       |  39 +++--
 .../pom.xml                                        |   2 +-
 .../testutils/mapsupport/ContentElement.java       |  70 ++++++--
 .../mapsupport/ContentElementHandler.java          |   6 +-
 .../testutils/mapsupport/ContentElementImpl.java   |  68 --------
 .../pom.xml                                        |  47 ++---
 .../xml/jcr/internal/JcrXmlContentParser.java      | 193 ++++++++++++++++++++
 .../xml/jcr/internal/JcrXmlValueConverter.java     | 149 ++++++++++++++++
 .../xml/jcr/internal/JcrXmlContentParserTest.java  | 146 ++++++++++++++++
 .../xml/jcr/internal/JcrXmlValueConverterTest.java | 123 +++++++++++++
 .../test/resources/content-test/content.jcr.xml    | 194 +++++++++++++++++++++
 .../test/resources/invalid-test/invalid.jcr.xml    |  20 +++
 .../org-apache-sling-contentparser-xml/pom.xml     |  27 ---
 .../xml/internal/XmlContentParserTest.java         |  62 ++++---
 contentparser/pom.xml                              |   1 +
 19 files changed, 976 insertions(+), 237 deletions(-)

diff --git 
a/contentparser/org-apache-sling-contentparser-api/src/main/java/org/apache/sling/contentparser/api/ParserHelper.java
 
b/contentparser/org-apache-sling-contentparser-api/src/main/java/org/apache/sling/contentparser/api/ParserHelper.java
index ca7f2ca..3d6a973 100644
--- 
a/contentparser/org-apache-sling-contentparser-api/src/main/java/org/apache/sling/contentparser/api/ParserHelper.java
+++ 
b/contentparser/org-apache-sling-contentparser-api/src/main/java/org/apache/sling/contentparser/api/ParserHelper.java
@@ -20,7 +20,7 @@ package org.apache.sling.contentparser.api;
 
 import java.lang.reflect.Array;
 import java.time.Instant;
-import java.time.OffsetDateTime;
+import java.time.ZonedDateTime;
 import java.time.format.DateTimeFormatter;
 import java.time.format.DateTimeParseException;
 import java.util.Calendar;
@@ -34,11 +34,11 @@ import org.osgi.annotation.versioning.ConsumerType;
 @ConsumerType
 public final class ParserHelper {
 
-    public static final String ECMA_DATE_FORMAT = "EEE MMM dd yyyy HH:mm:ss 
'GMT'Z";
-    public static final String ISO_8601_MILLISECONDS_DATE_FORMAT = 
"yyyy-MM-dd'T'HH:mm:ss.SSSVV";
-    public static final Locale DATE_FORMAT_LOCALE = Locale.US;
-    public static final DateTimeFormatter ECMA_DATE_FORMATTER = 
DateTimeFormatter.ofPattern(ECMA_DATE_FORMAT, DATE_FORMAT_LOCALE);
-    public static final DateTimeFormatter ISO_8601_MILLISECONDS_DATE_FORMATTER 
=
+    private static final String ECMA_DATE_FORMAT = "EEE MMM dd yyyy HH:mm:ss 
'GMT'Z";
+    private static final String ISO_8601_MILLISECONDS_DATE_FORMAT = 
"yyyy-MM-dd'T'HH:mm:ss.SSSVV";
+    private static final Locale DATE_FORMAT_LOCALE = Locale.US;
+    private static final DateTimeFormatter ECMA_DATE_FORMATTER = 
DateTimeFormatter.ofPattern(ECMA_DATE_FORMAT, DATE_FORMAT_LOCALE);
+    private static final DateTimeFormatter 
ISO_8601_MILLISECONDS_DATE_FORMATTER =
             DateTimeFormatter.ofPattern(ISO_8601_MILLISECONDS_DATE_FORMAT,
                     DATE_FORMAT_LOCALE);
 
@@ -50,23 +50,15 @@ public final class ParserHelper {
      * @return a {@link Calendar} containing the parsed date or {@code null}, 
if the parsing failed
      */
     public static Calendar parseDate(String string) {
-        Calendar calendar = Calendar.getInstance();
         try {
-            final OffsetDateTime offsetDateTime = OffsetDateTime.parse(string, 
ISO_8601_MILLISECONDS_DATE_FORMATTER);
-            final Instant instant = offsetDateTime.toInstant();
-            calendar.setTime(Date.from(instant));
-            
calendar.setTimeZone(TimeZone.getTimeZone(offsetDateTime.getOffset()));
+            return parseDate(string, ISO_8601_MILLISECONDS_DATE_FORMATTER);
         } catch (DateTimeParseException e) {
             try {
-                final OffsetDateTime offsetDateTime = 
OffsetDateTime.parse(string, ECMA_DATE_FORMATTER);
-                final Instant instant = offsetDateTime.toInstant();
-                calendar.setTime(Date.from(instant));
-                
calendar.setTimeZone(TimeZone.getTimeZone(offsetDateTime.getOffset()));
+                return parseDate(string, ECMA_DATE_FORMATTER);
             } catch (DateTimeParseException ee) {
-                calendar = null;
+                return null;
             }
         }
-        return calendar;
     }
 
     /**
@@ -103,4 +95,13 @@ public final class ParserHelper {
         return convertedArray;
     }
 
+    private static Calendar parseDate(String string, DateTimeFormatter 
formatter) throws DateTimeParseException {
+        final ZonedDateTime zonedDateTime = ZonedDateTime.parse(string, 
formatter);
+        final Instant instant = zonedDateTime.toInstant();
+        Calendar calendar = Calendar.getInstance();
+        calendar.setTime(Date.from(instant));
+        calendar.setTimeZone(TimeZone.getTimeZone(zonedDateTime.getOffset()));
+        return calendar;
+    }
+
 }
diff --git 
a/contentparser/org-apache-sling-contentparser-api/src/test/java/org/apache/sling/contentparser/api/ParserHelperTest.java
 
b/contentparser/org-apache-sling-contentparser-api/src/test/java/org/apache/sling/contentparser/api/ParserHelperTest.java
index 7f57ff3..9477414 100644
--- 
a/contentparser/org-apache-sling-contentparser-api/src/test/java/org/apache/sling/contentparser/api/ParserHelperTest.java
+++ 
b/contentparser/org-apache-sling-contentparser-api/src/test/java/org/apache/sling/contentparser/api/ParserHelperTest.java
@@ -46,6 +46,7 @@ public class ParserHelperTest {
             if (dateAsInts == null) {
                 assertNull("Expected a null return value for string " + 
entry.getKey(), calendar);
             } else {
+                assertNotNull("Unexpected parser failure for input " + 
entry.getKey(), calendar);
                 assertEquals(dateAsInts[0], 
calendar.get(Calendar.DAY_OF_MONTH));
                 assertEquals(dateAsInts[1], calendar.get(Calendar.MONTH) + 1);
                 assertEquals(dateAsInts[2], calendar.get(Calendar.YEAR));
diff --git a/contentparser/org-apache-sling-contentparser-json/pom.xml 
b/contentparser/org-apache-sling-contentparser-json/pom.xml
index 7e6dbd9..99d3bd0 100644
--- a/contentparser/org-apache-sling-contentparser-json/pom.xml
+++ b/contentparser/org-apache-sling-contentparser-json/pom.xml
@@ -62,32 +62,11 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-            <version>3.8</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.service.component.annotations</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.service.component</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.framework</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.contentparser.testutils</artifactId>
             <version>0.9.0-SNAPSHOT</version>
@@ -99,12 +78,6 @@
             <scope>test</scope>
         </dependency>
         <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-            <version>15.0</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
             <groupId>org.apache.johnzon</groupId>
             <artifactId>johnzon-core</artifactId>
             <version>1.0.0</version>
diff --git 
a/contentparser/org-apache-sling-contentparser-json/src/main/java/org/apache/sling/contentparser/json/internal/JsonTicksConverter.java
 
b/contentparser/org-apache-sling-contentparser-json/src/main/java/org/apache/sling/contentparser/json/internal/JsonTicksConverter.java
index df0be76..15b6553 100644
--- 
a/contentparser/org-apache-sling-contentparser-json/src/main/java/org/apache/sling/contentparser/json/internal/JsonTicksConverter.java
+++ 
b/contentparser/org-apache-sling-contentparser-json/src/main/java/org/apache/sling/contentparser/json/internal/JsonTicksConverter.java
@@ -59,8 +59,7 @@ final class JsonTicksConverter {
                     if (in == '"') {
                         if (quoted) {
                             quoted = false;
-                        }
-                        else if (tickQuoted) {
+                        } else {
                             output.append("\\");
                         }
                     }
diff --git 
a/contentparser/org-apache-sling-contentparser-json/src/test/java/org/apache/sling/contentparser/json/internal/JsonContentParserTest.java
 
b/contentparser/org-apache-sling-contentparser-json/src/test/java/org/apache/sling/contentparser/json/internal/JsonContentParserTest.java
index b52e934..f82c8a4 100644
--- 
a/contentparser/org-apache-sling-contentparser-json/src/test/java/org/apache/sling/contentparser/json/internal/JsonContentParserTest.java
+++ 
b/contentparser/org-apache-sling-contentparser-json/src/test/java/org/apache/sling/contentparser/json/internal/JsonContentParserTest.java
@@ -20,8 +20,11 @@ package org.apache.sling.contentparser.json.internal;
 
 import java.io.File;
 import java.math.BigDecimal;
+import java.util.Arrays;
 import java.util.Calendar;
+import java.util.Collections;
 import java.util.EnumSet;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.TimeZone;
 
@@ -34,8 +37,6 @@ import 
org.apache.sling.contentparser.testutils.mapsupport.ContentElement;
 import org.junit.Before;
 import org.junit.Test;
 
-import com.google.common.collect.ImmutableSet;
-
 import static junit.framework.TestCase.assertNull;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
@@ -62,8 +63,9 @@ public class JsonContentParserTest {
     @Test
     public void testDataTypes() throws Exception {
         ContentElement content = TestUtils.parse(contentParser, file);
-
-        Map<String, Object> props = 
content.getChild("toolbar/profiles/jcr:content").getProperties();
+        ContentElement child = 
content.getChild("toolbar/profiles/jcr:content");
+        assertNotNull("Expected child at toolbar/profiles/jcr:content", child);
+        Map<String, Object> props = child.getProperties();
         assertEquals(true, props.get("hideInNav"));
 
         assertEquals(1234567890123L, props.get("longProp"));
@@ -78,16 +80,18 @@ public class JsonContentParserTest {
     @Test
     public void testContentProperties() throws Exception {
         ContentElement content = TestUtils.parse(contentParser, file);
-
-        Map<String, Object> props = 
content.getChild("jcr:content/header").getProperties();
+        ContentElement child = content.getChild("jcr:content/header");
+        assertNotNull("Expected child at jcr:content/header", child);
+        Map<String, Object> props = child.getProperties();
         assertEquals("/content/dam/sample/header.png", 
props.get("imageReference"));
     }
 
     @Test
     public void testCalendar() throws Exception {
         ContentElement content = TestUtils.parse(contentParser, new 
ParserOptions().detectCalendarValues(true), file);
-
-        Map<String, Object> props = 
content.getChild("jcr:content").getProperties();
+        ContentElement child = content.getChild("jcr:content");
+        assertNotNull("Expected child at jcr:content", child);
+        Map<String, Object> props = child.getProperties();
 
         Calendar calendar = (Calendar) props.get("app:lastModified");
         assertNotNull(calendar);
@@ -106,8 +110,9 @@ public class JsonContentParserTest {
     @Test
     public void testIso8601Calendar() throws Exception {
         ContentElement content = TestUtils.parse(contentParser, new 
ParserOptions().detectCalendarValues(true), file);
-
-        Map<String, Object> props = 
content.getChild("jcr:content").getProperties();
+        ContentElement child = content.getChild("jcr:content");
+        assertNotNull("Expected child at jcr:content", child);
+        Map<String, Object> props = child.getProperties();
 
         Calendar calendar = (Calendar) props.get("dateISO8601String");
         assertNotNull(calendar);
@@ -124,8 +129,9 @@ public class JsonContentParserTest {
     @Test
     public void testUTF8Chars() throws Exception {
         ContentElement content = TestUtils.parse(contentParser, file);
-
-        Map<String, Object> props = 
content.getChild("jcr:content").getProperties();
+        ContentElement child = content.getChild("jcr:content");
+        assertNotNull("Expected child at jcr:content", child);
+        Map<String, Object> props = child.getProperties();
 
         assertEquals("äöü߀", props.get("utf8Property"));
     }
@@ -148,10 +154,11 @@ public class JsonContentParserTest {
     public void testIgnoreResourcesProperties() throws Exception {
         ContentElement content = TestUtils.parse(
                 contentParser,
-                new 
ParserOptions().ignoreResourceNames(ImmutableSet.of("header", "newslist", 
"security:acl", "security:principals"))
-                        .ignorePropertyNames(ImmutableSet.of("jcr:title")), 
file);
+                new ParserOptions().ignoreResourceNames(Collections
+                        .unmodifiableSet(new HashSet<>(Arrays.asList("header", 
"newslist", "security:acl", "security:principals"))))
+                        .ignorePropertyNames(Collections.unmodifiableSet(new 
HashSet<>(Arrays.asList("jcr:title")))), file);
         ContentElement child = content.getChild("jcr:content");
-
+        assertNotNull("Expected child at jcr:content", child);
         assertEquals("Sample Homepage", 
child.getProperties().get("pageTitle"));
         assertNull(child.getProperties().get("jcr:title"));
 
@@ -167,8 +174,8 @@ public class JsonContentParserTest {
     public void testGetChild() throws Exception {
         ContentElement content = TestUtils.parse(contentParser, file);
         assertNull(content.getName());
-
         ContentElement deepChild = 
content.getChild("jcr:content/par/image/file/jcr:content");
+        assertNotNull("Expected child at 
jcr:content/par/image/file/jcr:content", deepChild);
         assertEquals("jcr:content", deepChild.getName());
         assertEquals("nt:resource", 
deepChild.getProperties().get("jcr:primaryType"));
 
diff --git a/contentparser/org-apache-sling-contentparser-testutils/pom.xml 
b/contentparser/org-apache-sling-contentparser-testutils/pom.xml
index 2424af1..8ee015e 100644
--- a/contentparser/org-apache-sling-contentparser-testutils/pom.xml
+++ b/contentparser/org-apache-sling-contentparser-testutils/pom.xml
@@ -53,7 +53,7 @@
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
             <version>3.8</version>
-            <scope>provided</scope>
+            <scope>compile</scope>
         </dependency>
     </dependencies>
 </project>
diff --git 
a/contentparser/org-apache-sling-contentparser-testutils/src/main/java/org/apache/sling/contentparser/testutils/mapsupport/ContentElement.java
 
b/contentparser/org-apache-sling-contentparser-testutils/src/main/java/org/apache/sling/contentparser/testutils/mapsupport/ContentElement.java
index 37bb5ad..d5bb5ab 100644
--- 
a/contentparser/org-apache-sling-contentparser-testutils/src/main/java/org/apache/sling/contentparser/testutils/mapsupport/ContentElement.java
+++ 
b/contentparser/org-apache-sling-contentparser-testutils/src/main/java/org/apache/sling/contentparser/testutils/mapsupport/ContentElement.java
@@ -18,35 +18,71 @@
  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 package org.apache.sling.contentparser.testutils.mapsupport;
 
+import java.util.LinkedHashMap;
 import java.util.Map;
 
+import org.apache.commons.lang3.StringUtils;
+
 /**
- * Represents a resource or node in the content hierarchy.
+ * Implements support for a {@link 
org.apache.sling.contentparser.api.ContentHandler} parsed resource to use during
+ * {@link org.apache.sling.contentparser.api.ContentParser} tests.
  */
-public interface ContentElement {
+public final class ContentElement {
+
+    private final String name;
+    private final Map<String, Object> properties;
+    private final Map<String, ContentElement> children = new LinkedHashMap<>();
+
+    ContentElement(String name, Map<String, Object> properties) {
+        this.name = name;
+        this.properties = properties;
+    }
 
     /**
-     * @return Resource name. The root resource has no name (null).
+     * Returns the name of the resource.
+     *
+     * @return resource name; the root resource has no name (null).
      */
-    String getName();
-    
+    public String getName() {
+        return name;
+    }
+
     /**
      * Properties of this resource.
-     * @return Properties (keys, values)
+     *
+     * @return this resource's properties (keys, values)
      */
-    Map<String, Object> getProperties();
-    
+    public Map<String, Object> getProperties() {
+        return properties;
+    }
+
     /**
-     * Get children of current resource. The Map preserves the ordering of 
children.
-     * @return Children (child names, child objects)
+     * Returns the children of this resource. The Map preserves the children's 
ordering.
+     *
+     * @return the children of this resource (child names, child objects)
      */
-    Map<String, ContentElement> getChildren();
-    
+    public Map<String, ContentElement> getChildren() {
+        return children;
+    }
+
     /**
-     * Get child or descendant
-     * @param path Relative path to address child or one of it's descendants 
(use "/" as hierarchy separator).
-     * @return Child or null if no child found with this path
+     * Returns the child with the specified {@code path}.
+     *
+     * @param path relative path to address child or one of its descendants 
(use "/" as hierarchy separator)
+     * @return child or {@code null} if no child was found for the specified 
{@code path}
      */
-    ContentElement getChild(String path);
-    
+    public ContentElement getChild(String path) {
+        String name = StringUtils.substringBefore(path, "/");
+        ContentElement child = children.get(name);
+        if (child == null) {
+            return null;
+        }
+        String remainingPath = StringUtils.substringAfter(path, "/");
+        if (StringUtils.isEmpty(remainingPath)) {
+            return child;
+        } else {
+            return child.getChild(remainingPath);
+        }
+    }
+
 }
diff --git 
a/contentparser/org-apache-sling-contentparser-testutils/src/main/java/org/apache/sling/contentparser/testutils/mapsupport/ContentElementHandler.java
 
b/contentparser/org-apache-sling-contentparser-testutils/src/main/java/org/apache/sling/contentparser/testutils/mapsupport/ContentElementHandler.java
index c6e3f54..0714ae7 100644
--- 
a/contentparser/org-apache-sling-contentparser-testutils/src/main/java/org/apache/sling/contentparser/testutils/mapsupport/ContentElementHandler.java
+++ 
b/contentparser/org-apache-sling-contentparser-testutils/src/main/java/org/apache/sling/contentparser/testutils/mapsupport/ContentElementHandler.java
@@ -28,7 +28,7 @@ import org.apache.sling.contentparser.api.ContentHandler;
 /**
  * {@link ContentHandler} implementation that produces a tree of {@link 
ContentElement} items.
  */
-public class ContentElementHandler implements ContentHandler {
+public final class ContentElementHandler implements ContentHandler {
     
     private ContentElement root;
     private Pattern PATH_PATTERN = Pattern.compile("^((/[^/]+)*)(/([^/]+))$"); 
@@ -36,7 +36,7 @@ public class ContentElementHandler implements ContentHandler {
     @Override
     public void resource(String path, Map<String, Object> properties) {
         if (StringUtils.equals(path, "/")) {
-            root = new ContentElementImpl(null, properties);
+            root = new ContentElement(null, properties);
         }
         else {
             if (root == null) {
@@ -58,7 +58,7 @@ public class ContentElementHandler implements ContentHandler {
             if (parent == null) {
                 throw new RuntimeException("Parent '" + relativeParentPath + 
"' does not exist.");
             }
-            parent.getChildren().put(name, new ContentElementImpl(name, 
properties));
+            parent.getChildren().put(name, new ContentElement(name, 
properties));
         }
     }
     
diff --git 
a/contentparser/org-apache-sling-contentparser-testutils/src/main/java/org/apache/sling/contentparser/testutils/mapsupport/ContentElementImpl.java
 
b/contentparser/org-apache-sling-contentparser-testutils/src/main/java/org/apache/sling/contentparser/testutils/mapsupport/ContentElementImpl.java
deleted file mode 100644
index 93ec66e..0000000
--- 
a/contentparser/org-apache-sling-contentparser-testutils/src/main/java/org/apache/sling/contentparser/testutils/mapsupport/ContentElementImpl.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ Licensed to the Apache Software Foundation (ASF) under one
- ~ or more contributor license agreements.  See the NOTICE file
- ~ distributed with this work for additional information
- ~ regarding copyright ownership.  The ASF licenses this file
- ~ to you under the Apache License, Version 2.0 (the
- ~ "License"); you may not use this file except in compliance
- ~ with the License.  You may obtain a copy of the License at
- ~
- ~   http://www.apache.org/licenses/LICENSE-2.0
- ~
- ~ Unless required by applicable law or agreed to in writing,
- ~ software distributed under the License is distributed on an
- ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- ~ KIND, either express or implied.  See the License for the
- ~ specific language governing permissions and limitations
- ~ under the License.
- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-package org.apache.sling.contentparser.testutils.mapsupport;
-
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-import org.apache.commons.lang3.StringUtils;
-
-final class ContentElementImpl implements ContentElement {
-    
-    private final String name;
-    private final Map<String, Object> properties;
-    private final Map<String, ContentElement> children = new LinkedHashMap<>();
-    
-    public ContentElementImpl(String name, Map<String, Object> properties) {
-        this.name = name;
-        this.properties = properties;
-    }
-
-    @Override
-    public String getName() {
-        return name;
-    }
-
-    @Override
-    public Map<String, Object> getProperties() {
-        return properties;
-    }
-
-    @Override
-    public Map<String, ContentElement> getChildren() {
-        return children;
-    }
-
-    @Override
-    public ContentElement getChild(String path) {
-        String name = StringUtils.substringBefore(path, "/");
-        ContentElement child = children.get(name);
-        if (child == null) {
-          return null;
-        }
-        String remainingPath = StringUtils.substringAfter(path, "/");
-        if (StringUtils.isEmpty(remainingPath)) {
-          return child;
-        }
-        else {
-          return child.getChild(remainingPath);
-        }
-    }
-
-}
diff --git a/contentparser/org-apache-sling-contentparser-xml/pom.xml 
b/contentparser/org-apache-sling-contentparser-xml-jcr/pom.xml
similarity index 69%
copy from contentparser/org-apache-sling-contentparser-xml/pom.xml
copy to contentparser/org-apache-sling-contentparser-xml-jcr/pom.xml
index d2063ac..b671280 100644
--- a/contentparser/org-apache-sling-contentparser-xml/pom.xml
+++ b/contentparser/org-apache-sling-contentparser-xml-jcr/pom.xml
@@ -27,18 +27,18 @@
         <relativePath/>
     </parent>
 
-    <artifactId>org.apache.sling.contentparser.xml</artifactId>
+    <artifactId>org.apache.sling.contentparser.xml-jcr</artifactId>
     <version>0.9.0-SNAPSHOT</version>
 
-    <name>Apache Sling Content Parser for XML</name>
+    <name>Apache Sling Content Parser for JackRabbit FileVault XML</name>
     <description>
-        Apache Sling Content Parser for resource trees stored in XML files
+        Apache Sling Content Parser for resource trees stored in JackRabbit 
FileVault XML files
     </description>
 
     <scm>
-        
<connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-xml.git</connection>
-        
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-xml.git</developerConnection>
-        
<url>https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-contentparser-xml.git</url>
+        
<connection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-xml-jcr.git</connection>
+        
<developerConnection>scm:git:https://gitbox.apache.org/repos/asf/sling-org-apache-sling-contentparser-xml-jcr.git</developerConnection>
+        
<url>https://gitbox.apache.org/repos/asf?p=sling-org-apache-sling-contentparser-xml-jcr.git</url>
         <tag>HEAD</tag>
     </scm>
 
@@ -50,35 +50,26 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <version>2.6</version>
+            <groupId>javax.jcr</groupId>
+            <artifactId>jcr</artifactId>
+            <version>2.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.apache.commons</groupId>
-            <artifactId>commons-lang3</artifactId>
-            <version>3.8</version>
+            <groupId>org.apache.jackrabbit</groupId>
+            <artifactId>jackrabbit-jcr-commons</artifactId>
+            <version>2.8.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.service.component.annotations</artifactId>
+            <groupId>org.apache.jackrabbit.vault</groupId>
+            <artifactId>org.apache.jackrabbit.vault</artifactId>
+            <version>3.1.18</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
             <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.service.component</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.framework</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
+            <artifactId>org.osgi.service.component.annotations</artifactId>
             <scope>provided</scope>
         </dependency>
         <dependency>
@@ -92,11 +83,5 @@
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-            <version>15.0</version>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
diff --git 
a/contentparser/org-apache-sling-contentparser-xml-jcr/src/main/java/org/apache/sling/contentparser/xml/jcr/internal/JcrXmlContentParser.java
 
b/contentparser/org-apache-sling-contentparser-xml-jcr/src/main/java/org/apache/sling/contentparser/xml/jcr/internal/JcrXmlContentParser.java
new file mode 100644
index 0000000..1e01575
--- /dev/null
+++ 
b/contentparser/org-apache-sling-contentparser-xml-jcr/src/main/java/org/apache/sling/contentparser/xml/jcr/internal/JcrXmlContentParser.java
@@ -0,0 +1,193 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements.  See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership.  The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License.  You may obtain a copy of the License at
+ ~
+ ~   http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied.  See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+package org.apache.sling.contentparser.xml.jcr.internal;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayDeque;
+import java.util.Deque;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.apache.jackrabbit.JcrConstants;
+import org.apache.jackrabbit.util.ISO9075;
+import org.apache.sling.contentparser.api.ContentHandler;
+import org.apache.sling.contentparser.api.ContentParser;
+import org.apache.sling.contentparser.api.ParseException;
+import org.apache.sling.contentparser.api.ParserOptions;
+import org.osgi.service.component.annotations.Component;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+import org.xml.sax.helpers.DefaultHandler;
+
+@Component(
+        service = ContentParser.class,
+        property = {
+                ContentParser.SERVICE_PROPERTY_CONTENT_TYPE + "=" + 
ContentParser.JCR_XML_CONTENT_TYPE
+        }
+)
+public final class JcrXmlContentParser implements ContentParser {
+
+    private final SAXParserFactory saxParserFactory;
+
+    public JcrXmlContentParser() {
+        saxParserFactory = SAXParserFactory.newInstance();
+        saxParserFactory.setNamespaceAware(true);
+    }
+
+    @Override
+    public void parse(ContentHandler handler, InputStream is, ParserOptions 
parserOptions) throws IOException, ParseException {
+        try {
+            XmlHandler xmlHandler = new XmlHandler(handler, parserOptions);
+            SAXParser parser = saxParserFactory.newSAXParser();
+            parser.parse(is, xmlHandler);
+            if (xmlHandler.hasError()) {
+                throw xmlHandler.getError();
+            }
+        } catch (ParserConfigurationException | SAXException ex) {
+            throw new ParseException("Error parsing JCR XML content.", ex);
+        }
+    }
+
+    /**
+     * Decodes element or attribute names.
+     *
+     * @param qname qname
+     * @return Decoded name
+     */
+    static String decodeName(String qname) {
+        return ISO9075.decode(qname);
+    }
+
+    /**
+     * Parses XML stream to Map.
+     */
+    class XmlHandler extends DefaultHandler {
+        private final ContentHandler contentHandler;
+        private final ParserOptions parserOptions;
+        private final Deque<String> paths = new ArrayDeque<>();
+        private final Set<String> ignoredPaths = new HashSet<>();
+        private SAXParseException error;
+
+        XmlHandler(ContentHandler contentHandler, ParserOptions parserOptions) 
{
+            this.contentHandler = contentHandler;
+            this.parserOptions = parserOptions;
+        }
+
+        boolean hasError() {
+            return error != null;
+        }
+
+        SAXParseException getError() {
+            return error;
+        }
+
+        @Override
+        public void startElement(String uri, String localName, String qName, 
Attributes attributes) {
+            String resourceName = decodeName(qName);
+
+            // generate path for element
+            String path;
+            if (paths.isEmpty()) {
+                path = "/";
+            } else {
+                String parentPath = paths.peek();
+                path = parentPath.endsWith("/") ? parentPath + resourceName : 
parentPath + "/" + resourceName;
+                if 
(parserOptions.getIgnoreResourceNames().contains(resourceName)) {
+                    ignoredPaths.add(path);
+                }
+            }
+            paths.push(path);
+
+            // skip further processing if this path or a parent path is ignored
+            if (isIgnoredPath(path)) {
+                return;
+            }
+
+            // get properties
+            Map<String, Object> properties = new HashMap<>();
+            for (int i = 0; i < attributes.getLength(); i++) {
+                String propertyName = 
removePrefixFromPropertyName(parserOptions.getRemovePropertyNamePrefixes(),
+                        decodeName(attributes.getQName(i)));
+                if 
(!parserOptions.getIgnorePropertyNames().contains(propertyName)) {
+                    Object value = 
JcrXmlValueConverter.parseValue(propertyName, attributes.getValue(i));
+                    if (value != null) {
+                        properties.put(propertyName, value);
+                    }
+                }
+            }
+            String defaultPrimaryType = parserOptions.getDefaultPrimaryType();
+            if (defaultPrimaryType != null) {
+                if (!properties.containsKey(JcrConstants.JCR_PRIMARYTYPE)) {
+                    properties.put(JcrConstants.JCR_PRIMARYTYPE, 
defaultPrimaryType);
+                }
+            }
+            contentHandler.resource(path, properties);
+        }
+
+        @Override
+        public void endElement(String uri, String localName, String qName) {
+            paths.pop();
+        }
+
+        @Override
+        public void error(SAXParseException ex) {
+            this.error = ex;
+        }
+
+        @Override
+        public void fatalError(SAXParseException ex) {
+            this.error = ex;
+        }
+
+        private boolean isIgnoredPath(String path) {
+            if (path == null || path.isEmpty()) {
+                return false;
+            }
+            if (ignoredPaths.contains(path)) {
+                return true;
+            }
+            if (path.contains("/")) {
+                String parentPath = path.substring(0, path.lastIndexOf("/"));
+                return isIgnoredPath(parentPath);
+            } else {
+                return isIgnoredPath(path);
+            }
+
+        }
+
+        private String removePrefixFromPropertyName(Set<String> prefixes, 
String propertyName) {
+            for (String prefix : prefixes) {
+                if (propertyName.startsWith(prefix)) {
+                    return propertyName.substring(prefix.length());
+                }
+            }
+            return propertyName;
+        }
+
+    }
+
+}
diff --git 
a/contentparser/org-apache-sling-contentparser-xml-jcr/src/main/java/org/apache/sling/contentparser/xml/jcr/internal/JcrXmlValueConverter.java
 
b/contentparser/org-apache-sling-contentparser-xml-jcr/src/main/java/org/apache/sling/contentparser/xml/jcr/internal/JcrXmlValueConverter.java
new file mode 100644
index 0000000..8d1695c
--- /dev/null
+++ 
b/contentparser/org-apache-sling-contentparser-xml-jcr/src/main/java/org/apache/sling/contentparser/xml/jcr/internal/JcrXmlValueConverter.java
@@ -0,0 +1,149 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements.  See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership.  The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License.  You may obtain a copy of the License at
+ ~
+ ~   http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied.  See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+package org.apache.sling.contentparser.xml.jcr.internal;
+
+import java.lang.reflect.Array;
+import java.math.BigDecimal;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Calendar;
+import java.util.UUID;
+
+import javax.jcr.PropertyType;
+
+import org.apache.jackrabbit.util.ISO8601;
+import org.apache.jackrabbit.vault.util.DocViewProperty;
+
+/**
+ * Parses JCR XML files that contains content fragments.
+ */
+class JcrXmlValueConverter {
+
+    private JcrXmlValueConverter() {
+        // static methods only
+    }
+
+    /**
+     * Parse value from XML Attribute.
+     *
+     * @param value XML attribute value
+     * @return value object
+     */
+    static Object parseValue(final String name, final String value) {
+        if (value == null) {
+            return null;
+        }
+        DocViewProperty prop = DocViewProperty.parse(name, value);
+
+        // convert values
+        if (prop.isMulti) {
+            Class<?> arrayType = getType(prop.type);
+            if (arrayType == null) {
+                return null;
+            }
+            Object result = Array.newInstance(arrayType, prop.values.length);
+            for (int i = 0; i < prop.values.length; i++) {
+                Array.set(result, i, convertValue(prop.values[i], prop.type));
+            }
+            return result;
+        } else {
+            return convertValue(prop.values[0], prop.type);
+        }
+    }
+
+    /**
+     * Parse value depending on type prefix.
+     *
+     * @param value   Value
+     * @param type    Type
+     * @return Value object
+     */
+    private static Object convertValue(final String value, final int type) {
+        switch (type) {
+            case PropertyType.UNDEFINED:
+            case PropertyType.STRING:
+            case PropertyType.NAME:
+            case PropertyType.PATH:
+                return value;
+            case PropertyType.BOOLEAN:
+                return Boolean.valueOf(value);
+            case PropertyType.LONG:
+                return Long.valueOf(value);
+            case PropertyType.DOUBLE:
+                return Double.valueOf(value);
+            case PropertyType.DECIMAL:
+                return new BigDecimal(value);
+            case PropertyType.DATE:
+                return ISO8601.parse(value);
+            case PropertyType.REFERENCE:
+            case PropertyType.WEAKREFERENCE:
+                return UUID.fromString(value);
+            case PropertyType.URI:
+                try {
+                    return new URI(value);
+                } catch (URISyntaxException ex) {
+                    throw new IllegalArgumentException("Unexpected URI syntax: 
" + value);
+                }
+            case PropertyType.BINARY:
+                // not supported - ignore value
+                return null;
+            default:
+                throw new IllegalArgumentException("Unexpected type: " + 
PropertyType.nameFromValue(type));
+
+        }
+    }
+
+    /**
+     * Get java type for given JCR type.
+     *
+     * @param type Type
+     * @return Type
+     */
+    private static Class<?> getType(final int type) {
+        switch (type) {
+            case PropertyType.UNDEFINED:
+            case PropertyType.STRING:
+            case PropertyType.NAME:
+            case PropertyType.PATH:
+                return String.class;
+            case PropertyType.BOOLEAN:
+                return Boolean.class;
+            case PropertyType.LONG:
+                return Long.class;
+            case PropertyType.DOUBLE:
+                return Double.class;
+            case PropertyType.DECIMAL:
+                return BigDecimal.class;
+            case PropertyType.DATE:
+                return Calendar.class;
+            case PropertyType.REFERENCE:
+            case PropertyType.WEAKREFERENCE:
+                return UUID.class;
+            case PropertyType.URI:
+                return URI.class;
+            case PropertyType.BINARY:
+                // not supported - ignore value
+                return null;
+            default:
+                throw new IllegalArgumentException("Unexpected type: " + 
PropertyType.nameFromValue(type));
+
+        }
+    }
+
+}
diff --git 
a/contentparser/org-apache-sling-contentparser-xml-jcr/src/test/java/org/apache/sling/contentparser/xml/jcr/internal/JcrXmlContentParserTest.java
 
b/contentparser/org-apache-sling-contentparser-xml-jcr/src/test/java/org/apache/sling/contentparser/xml/jcr/internal/JcrXmlContentParserTest.java
new file mode 100644
index 0000000..0c2a826
--- /dev/null
+++ 
b/contentparser/org-apache-sling-contentparser-xml-jcr/src/test/java/org/apache/sling/contentparser/xml/jcr/internal/JcrXmlContentParserTest.java
@@ -0,0 +1,146 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements.  See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership.  The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License.  You may obtain a copy of the License at
+ ~
+ ~   http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied.  See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+package org.apache.sling.contentparser.xml.jcr.internal;
+
+import java.io.File;
+import java.math.BigDecimal;
+import java.util.Arrays;
+import java.util.Calendar;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.TimeZone;
+
+import org.apache.jackrabbit.util.ISO9075;
+import org.apache.sling.contentparser.api.ContentParser;
+import org.apache.sling.contentparser.api.ParseException;
+import org.apache.sling.contentparser.api.ParserOptions;
+import org.apache.sling.contentparser.testutils.mapsupport.ContentElement;
+import org.junit.Before;
+import org.junit.Test;
+
+import static org.apache.sling.contentparser.testutils.TestUtils.parse;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+
+public class JcrXmlContentParserTest {
+
+    private File file;
+    private ContentParser underTest;
+
+    @Before
+    public void setUp() {
+        file = new File("src/test/resources/content-test/content.jcr.xml");
+        underTest = new JcrXmlContentParser();
+    }
+
+    @Test
+    public void testParseJcrXml() throws Exception {
+        ContentElement content = parse(underTest, file);
+        assertNotNull(content);
+        assertEquals("app:Page", 
content.getProperties().get("jcr:primaryType"));
+        ContentElement child = content.getChild("jcr:content");
+        assertNotNull("Expected child at jcr:content", child);
+        assertEquals("app:PageContent", 
child.getProperties().get("jcr:primaryType"));
+    }
+
+    @Test(expected= ParseException.class)
+    public void testParseInvalidJcrXml() throws Exception {
+        file = new File("src/test/resources/invalid-test/invalid.jcr.xml");
+        parse(underTest, file);
+    }
+
+    @Test
+    public void testDataTypes() throws Exception {
+        ContentElement content = parse(underTest, file);
+        ContentElement child = content.getChild("jcr:content");
+        assertNotNull("Expected child at jcr:content", child);
+        Map<String,Object> props = child.getProperties();
+        
+        assertEquals("en", props.get("jcr:title"));
+        assertEquals(true, props.get("includeAside"));
+        assertEquals(1234567890123L, props.get("longProp"));
+        assertEquals(new BigDecimal("1.2345"), props.get("decimalProp"));
+        
+        assertArrayEquals(new String[] { "aa", "bb", "cc" }, 
(String[])props.get("stringPropMulti"));
+        assertArrayEquals(new Long[] { 1234567890123L, 55L }, 
(Long[])props.get("longPropMulti"));
+        
+        Calendar calendar = (Calendar)props.get("dateProp");
+        calendar.setTimeZone(TimeZone.getTimeZone("GMT+2"));
+        assertEquals(2014, calendar.get(Calendar.YEAR));
+        assertEquals(9, calendar.get(Calendar.MONTH) + 1);
+        assertEquals(19, calendar.get(Calendar.DAY_OF_MONTH));
+        assertEquals(21, calendar.get(Calendar.HOUR_OF_DAY));
+        assertEquals(20, calendar.get(Calendar.MINUTE));
+        assertEquals(26, calendar.get(Calendar.SECOND));
+        assertEquals(812, calendar.get(Calendar.MILLISECOND));
+    }
+
+    @Test
+    public void testDecodeName() {
+        assertEquals("jcr:title", JcrXmlContentParser.decodeName("jcr:" + 
ISO9075.encode("title")));
+        assertEquals("sling:123", JcrXmlContentParser.decodeName("sling:" + 
ISO9075.encode("123")));
+    }
+
+    @Test
+    public void testIgnoreResourcesProperties() throws Exception {
+        ContentElement content = parse(underTest,
+                new 
ParserOptions().ignoreResourceNames(Collections.unmodifiableSet(new 
HashSet<>(Arrays.asList("teaserbar", "aside"))))
+                        .ignorePropertyNames(Collections.unmodifiableSet(new 
HashSet<>(Arrays.asList("longProp", "jcr:title")))), file);
+        ContentElement child = content.getChild("jcr:content");
+        assertNotNull("Expected child at jcr:content", child);
+        assertEquals("HOME", child.getProperties().get("navTitle"));
+        assertNull(child.getProperties().get("jcr:title"));
+        assertNull(child.getProperties().get("longProp"));
+        
+        assertNull(child.getChildren().get("teaserbar"));
+        assertNull(child.getChildren().get("aside"));
+        assertNotNull(child.getChildren().get("content"));
+    }
+
+    @Test
+    public void testGetChild() throws Exception {
+        ContentElement content = parse(underTest, file);
+        assertNull(content.getName());
+        
+        ContentElement deepChild = 
content.getChild("jcr:content/teaserbar/teaserbaritem");
+        assertNotNull("Expected child at jcr:content/teaserbar/teaserbaritem", 
deepChild);
+        assertEquals("teaserbaritem", deepChild.getName());
+        
assertEquals("samples/sample-app/components/content/teaserbar/teaserbarItem", 
deepChild.getProperties().get("sling:resourceType"));
+
+        ContentElement invalidChild = content.getChild("non/existing/path");
+        assertNull(invalidChild);
+
+        invalidChild = content.getChild("/jcr:content");
+        assertNull(invalidChild);
+    }
+
+    @Test
+    public void testSameNamePropertyAndSubResource() throws Exception {
+        ContentElement content = parse(underTest, file);
+        ContentElement child = content.getChild("jcr:content/teaserbar");
+        assertNotNull("Expected child at jcr:content/teaserbar", child);
+        // teaserbaritem is a direct property as well as a sub resource
+        assertEquals("test", child.getProperties().get("teaserbaritem"));
+        assertNotNull(child.getChildren().get("teaserbaritem"));
+    }
+
+}
diff --git 
a/contentparser/org-apache-sling-contentparser-xml-jcr/src/test/java/org/apache/sling/contentparser/xml/jcr/internal/JcrXmlValueConverterTest.java
 
b/contentparser/org-apache-sling-contentparser-xml-jcr/src/test/java/org/apache/sling/contentparser/xml/jcr/internal/JcrXmlValueConverterTest.java
new file mode 100644
index 0000000..f33b13c
--- /dev/null
+++ 
b/contentparser/org-apache-sling-contentparser-xml-jcr/src/test/java/org/apache/sling/contentparser/xml/jcr/internal/JcrXmlValueConverterTest.java
@@ -0,0 +1,123 @@
+/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ Licensed to the Apache Software Foundation (ASF) under one
+ ~ or more contributor license agreements.  See the NOTICE file
+ ~ distributed with this work for additional information
+ ~ regarding copyright ownership.  The ASF licenses this file
+ ~ to you under the Apache License, Version 2.0 (the
+ ~ "License"); you may not use this file except in compliance
+ ~ with the License.  You may obtain a copy of the License at
+ ~
+ ~   http://www.apache.org/licenses/LICENSE-2.0
+ ~
+ ~ Unless required by applicable law or agreed to in writing,
+ ~ software distributed under the License is distributed on an
+ ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ ~ KIND, either express or implied.  See the License for the
+ ~ specific language governing permissions and limitations
+ ~ under the License.
+ 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
+package org.apache.sling.contentparser.xml.jcr.internal;
+
+import java.math.BigDecimal;
+import java.net.URI;
+import java.util.Calendar;
+import java.util.UUID;
+
+import org.junit.Test;
+
+import static 
org.apache.sling.contentparser.xml.jcr.internal.JcrXmlValueConverter.parseValue;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+public class JcrXmlValueConverterTest {
+    
+    private static final String NAME = "prop1";
+
+    @Test
+    public void testNull() {
+        assertNull(parseValue(NAME, null));
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    public void testInvalid() {
+        parseValue(NAME, "{InvalidType}xyz");
+    }
+
+    @Test
+    public void testString() {
+        assertEquals("myString", parseValue(NAME, "myString"));
+        assertEquals("prop", "myString [ ] { } \\ ,", parseValue(NAME, 
"myString [ ] { } \\\\ ,"));
+        assertEquals("{myString}", parseValue(NAME, "\\{myString}"));
+        assertEquals("aaa{myString}", parseValue(NAME, "aaa{myString}"));
+        assertEquals("[myString]", parseValue(NAME, "\\[myString]"));
+        assertEquals("aaa[myString]", parseValue(NAME, "aaa[myString]"));
+    }
+
+    @Test
+    public void testStringArray() {
+        assertArrayEquals(new Object[] { "myString1", "myString2" }, 
(Object[]) parseValue(NAME, "[myString1,myString2]"));
+        assertArrayEquals(new Object[] { "myString1,[]\\äöü߀", "myString2", 
"myString3 [ ] { } \\ ,", "", "[myString5]", "{myString6}" },
+                (Object[]) parseValue(NAME, 
"[myString1\\,[]\\\\äöü߀,myString2,myString3 [ ] { } \\\\ 
\\,,,[myString5],{myString6}]"));
+    }
+
+    @Test
+    public void testBoolean() {
+        assertEquals(true, parseValue(NAME, "{Boolean}true"));
+        assertEquals(false, parseValue(NAME, "{Boolean}false"));
+    }
+
+    @Test
+    public void testBooleanArray() {
+        assertArrayEquals(new Object[] { true, false }, (Object[]) 
parseValue(NAME, "{Boolean}[true,false]"));
+    }
+
+    @Test
+    public void testLong() {
+        assertEquals(1L, parseValue(NAME, "{Long}1"));
+        assertEquals(10000000000L, parseValue(NAME, "{Long}10000000000"));
+    }
+
+    @Test
+    public void testLongArray() {
+        assertArrayEquals(new Object[] { 1L, 2L }, (Object[]) parseValue(NAME, 
"{Long}[1,2]"));
+        assertArrayEquals(new Object[] { 10000000000L, 20000000000L }, 
(Object[]) parseValue(NAME, "{Long}[10000000000,20000000000]"));
+    }
+
+    @Test
+    public void testDouble() {
+        assertEquals(new BigDecimal("1.234"), parseValue(NAME, 
"{Decimal}1.234"));
+    }
+
+    @Test
+    public void testDoubleArray() {
+        assertArrayEquals(new Object[] { new BigDecimal("1.234"), new 
BigDecimal("2.345") }, (Object[]) parseValue(NAME, "{Decimal}[1.234,2.345]"));
+    }
+
+    @Test
+    public void testCalendar() {
+        Calendar value = (Calendar)parseValue(NAME, 
"{Date}2010-09-05T15:10:20.000Z");
+        assertEquals(2010, value.get(Calendar.YEAR));
+        assertEquals(8, value.get(Calendar.MONTH));
+        assertEquals(5, value.get(Calendar.DAY_OF_MONTH));
+    }
+
+    @Test
+    public void testStringArrayRepPrivileges() {
+        assertArrayEquals(new Object[] { "rep:write", "crx:replicate", 
"jcr:read" }, (Object[]) parseValue(NAME, 
"{Name}[rep:write,crx:replicate,jcr:read]"));
+    }
+
+    @Test
+    public void testReference() {
+        UUID uuid = UUID.randomUUID();
+        UUID value = (UUID)parseValue(NAME, "{Reference}" + uuid.toString());
+        assertEquals(uuid, value);
+    }
+
+    @Test
+    public void testURI() {
+        URI value = (URI)parseValue(NAME, "{URI}http://www.jodelkaiser.de/";);
+        assertEquals("http://www.jodelkaiser.de/";, value.toString());
+    }
+
+}
diff --git 
a/contentparser/org-apache-sling-contentparser-xml-jcr/src/test/resources/content-test/content.jcr.xml
 
b/contentparser/org-apache-sling-contentparser-xml-jcr/src/test/resources/content-test/content.jcr.xml
new file mode 100644
index 0000000..7d97cc0
--- /dev/null
+++ 
b/contentparser/org-apache-sling-contentparser-xml-jcr/src/test/resources/content-test/content.jcr.xml
@@ -0,0 +1,194 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+    http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+-->
+<jcr:root xmlns:jcr="http://www.jcp.org/jcr/1.0"; 
xmlns:app="http://sample.com/jcr/app/1.0"; 
xmlns:mix="http://www.jcp.org/jcr/mix/1.0"; 
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"; 
xmlns:sling="http://sling.apache.org/jcr/sling/1.0";
+    jcr:primaryType="app:Page">
+  <jcr:content
+      jcr:primaryType="app:PageContent"
+      jcr:title="en"
+      sling:resourceType="samples/sample-app/components/content/page/homepage"
+      includeAside="{Boolean}true"
+      includeAsideBar="{Boolean}true"
+      includeTeaserBar="{Boolean}true"
+      includeTeaserbar="{Boolean}true"
+      inheritAside="{Boolean}false"
+      inheritTeaserbar="{Boolean}false"
+      longProp="{Long}1234567890123"
+      decimalProp="{Decimal}1.2345"
+      longPropMulti="{Long}[1234567890123,55]"
+      stringPropMulti="[aa,bb,cc]"
+      dateProp="{Date}2014-09-19T21:20:26.812+02:00"
+      navTitle="HOME"
+      pageTitle="Sample Site">
+    <teaserbar
+        jcr:primaryType="nt:unstructured"
+        
sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarParsys"
+        teaserbaritem="test">
+      <teaserbaritem
+          jcr:primaryType="nt:unstructured"
+          
sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarItem"
+          linkContentRef="/content/samples/en/conference"
+          linkMediaDownload="{Boolean}false"
+          linkTitle="This should help you with your decision"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/user.png"
+          teaserContent="Still not convinced to attend? Need persuasion? Facts 
for your boss?"
+          title="Why to attend" />
+      <teaserbaritem_0
+          jcr:primaryType="nt:unstructured"
+          
sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarItem"
+          linkContentRef="/content/samples/en/venue"
+          linkMediaDownload="{Boolean}false"
+          linkTitle="More information"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/location.png"
+          teaserContent="Take a look at the new venue for 2013. The 
Kulturbrauerei in the Prenzlauer Berg district."
+          title="Location" />
+      <teaserbaritem_1
+          jcr:primaryType="nt:unstructured"
+          
sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarItem"
+          linkContentRef="/content/samples/en/conference/call-for-papers"
+          linkMediaDownload="{Boolean}false"
+          linkTitle="Submit your proposal here"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/talk.png"
+          teaserContent="If you have insight and experiences with Apache Sling 
and want to share them? We are actually asking for your participation!"
+          title="Want to share?" />
+      <teaserbaritem_2
+          jcr:primaryType="nt:unstructured"
+          
sling:resourceType="samples/sample-app/components/content/teaserbar/teaserbarItem"
+          linkContentRef="/content/samples/en/archive"
+          linkMediaDownload="{Boolean}false"
+          linkTitle="Dive into the archive"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/archive.png"
+          teaserContent="adaptTo() is not a new event. Take a look at what was 
said and done previously."
+          title="Take a look back" />
+    </teaserbar>
+    <aside
+        jcr:primaryType="nt:unstructured"
+        
sling:resourceType="samples/sample-app/components/content/aside/asideParsys">
+      <asidesponsorteaser
+          jcr:primaryType="nt:unstructured"
+          
sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaser"
+          title="Sponsors">
+        <images
+            jcr:primaryType="nt:unstructured"
+            
sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaserParsys">
+          <asidesponsorteaserit_0
+              jcr:primaryType="nt:unstructured"
+              
sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaserItem"
+              imageHeight="41"
+              imageWidth="200"
+              linkExternalRef="http://www.pro-vision.de";
+              linkType="external"
+              linkWindowFeatures="default"
+              linkWindowTarget="_blank"
+              mediaRef="/content/dam/samples/content/provision-logo.png" />
+        </images>
+      </asidesponsorteaser>
+      <asidesocialteaser
+          jcr:primaryType="nt:unstructured"
+          
sling:resourceType="samples/sample-app/components/content/aside/asideSocialTeaser"
+          title="Follow us">
+        <images
+            jcr:primaryType="nt:unstructured"
+            
sling:resourceType="samples/sample-app/components/content/aside/asideSponsorTeaserParsys">
+          <asidesocialteaserite
+              jcr:primaryType="nt:unstructured"
+              
sling:resourceType="samples/sample-app/components/content/aside/asideSocialTeaserItem"
+              linkExternalRef="http://twitter.com/adaptto";
+              linkMediaDownload="{Boolean}false"
+              linkTitle="@adaptTo"
+              linkType="external"
+              linkWindowFeatures="default"
+              linkWindowTarget="_blank"
+              mediaRef="/content/dam/samples/content/twitter-icon.png"
+              title="on twitter" />
+        </images>
+      </asidesocialteaser>
+    </aside>
+    <content
+        jcr:primaryType="nt:unstructured"
+        sling:resourceType="sample/wcm/parsys/components/parsys">
+      <contentrichtext
+          jcr:primaryType="nt:unstructured"
+          
sling:resourceType="samples/sample-app/components/content/common/contentRichText"
+          text="&lt;p&gt;adaptTo() is a meetup in Berlin focused on Apache 
Sling including Apache Jackrabbit and Apache Felix and is addressed to all 
using this stack or parts of it.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a 
data=&quot;{&amp;quot;linkType&amp;quot;:&amp;quot;internal&amp;quot;,&amp;quot;linkContentRef&amp;quot;:&amp;quot;/content/samples/handler/en/conference&amp;quot;,&amp;quot;linkWindowTarget&amp;quot;:&amp;quot;_self&amp;quot;,&amp;quot;linkWindowFeatures&amp;quot;:&amp;quot;defa
 [...]
+      <contentheadline
+          jcr:primaryType="nt:unstructured"
+          
sling:resourceType="samples/sample-app/components/content/common/contentHeadline"
+          headline="Extended Call for Papers"
+          smaller="{Boolean}true" />
+      <contentrichtext_0
+          jcr:primaryType="nt:unstructured"
+          
sling:resourceType="samples/sample-app/components/content/common/contentRichText"
+          text="&lt;p&gt;Although we got some great submissions for adaptTo() 
2013, we still have some slots for further sessions. Therefore we extend the 
timeslot for submissions to the call for papers and for feedback by two weeks. 
This means you still can submit you submissions till 06.05.2013. We're looking 
forward to get more of your great talks.&lt;/p&gt;&#xA;&lt;p&gt;&lt;a 
data=&quot;{&amp;quot;linkType&amp;quot;:&amp;quot;internal&amp;quot;,&amp;quot;linkContentRef&amp;quot;:&amp
 [...]
+    </content>
+    <stage
+        jcr:primaryType="nt:unstructured"
+        sling:resourceType="sample/wcm/parsys/components/parsys">
+      <stageheader
+          jcr:primaryType="nt:unstructured"
+          
sling:resourceType="samples/sample-app/components/content/stage/stageheader"
+          linkMediaDownload="{Boolean}false"
+          linkType="internal"
+          linkWindowFeatures="default"
+          linkWindowTarget="_self"
+          mediaRef="/content/dam/samples/content/stageheader-outside2.jpg"
+          subtitle="23.–25. September 2013&#xA;Kulturbrauerei Berlin"
+          title="adaptTo() 2013">
+        <links
+            jcr:primaryType="nt:unstructured"
+            
sling:resourceType="samples/sample-app/components/content/stage/stageheaderParsys">
+          <stageheaderlinkitem
+              jcr:primaryType="nt:unstructured"
+              
sling:resourceType="samples/sample-app/components/content/stage/stageheaderLinkItem"
+              linkContentRef="/content/samples/en/tickets"
+              linkMediaDownload="{Boolean}false"
+              linkTitle="Get tickets now"
+              linkType="internal"
+              linkWindowFeatures="default"
+              linkWindowTarget="_self" />
+          <stageheaderlinkitem_0
+              jcr:primaryType="nt:unstructured"
+              
sling:resourceType="samples/sample-app/components/content/stage/stageheaderLinkItem"
+              linkContentRef="/content/samples/en/conference/call-for-papers"
+              linkMediaDownload="{Boolean}false"
+              linkTitle="Submit paper"
+              linkType="internal"
+              linkWindowFeatures="default"
+              linkWindowTarget="_self" />
+        </links>
+      </stageheader>
+    </stage>
+    <image
+        jcr:primaryType="nt:unstructured" />
+  </jcr:content>
+  <tools />
+  <conference />
+</jcr:root>
diff --git 
a/contentparser/org-apache-sling-contentparser-xml-jcr/src/test/resources/invalid-test/invalid.jcr.xml
 
b/contentparser/org-apache-sling-contentparser-xml-jcr/src/test/resources/invalid-test/invalid.jcr.xml
new file mode 100644
index 0000000..0149495
--- /dev/null
+++ 
b/contentparser/org-apache-sling-contentparser-xml-jcr/src/test/resources/invalid-test/invalid.jcr.xml
@@ -0,0 +1,20 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ to you under the Apache License, Version 2.0 (the
+  ~ "License"); you may not use this file except in compliance
+  ~ with the License.  You may obtain a copy of the License at
+  ~
+  ~   http://www.apache.org/licenses/LICENSE-2.0
+  ~
+  ~ Unless required by applicable law or agreed to in writing,
+  ~ software distributed under the License is distributed on an
+  ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  ~ KIND, either express or implied.  See the License for the
+  ~ specific language governing permissions and limitations
+  ~ under the License.
+  
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+This is invalid xml.
+
diff --git a/contentparser/org-apache-sling-contentparser-xml/pom.xml 
b/contentparser/org-apache-sling-contentparser-xml/pom.xml
index d2063ac..b9a0237 100644
--- a/contentparser/org-apache-sling-contentparser-xml/pom.xml
+++ b/contentparser/org-apache-sling-contentparser-xml/pom.xml
@@ -50,12 +50,6 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>commons-io</groupId>
-            <artifactId>commons-io</artifactId>
-            <version>2.6</version>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
             <groupId>org.apache.commons</groupId>
             <artifactId>commons-lang3</artifactId>
             <version>3.8</version>
@@ -67,21 +61,6 @@
             <scope>provided</scope>
         </dependency>
         <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.service.component</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.framework</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-api</artifactId>
-            <scope>provided</scope>
-        </dependency>
-        <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.contentparser.testutils</artifactId>
             <version>0.9.0-SNAPSHOT</version>
@@ -92,11 +71,5 @@
             <artifactId>junit</artifactId>
             <scope>test</scope>
         </dependency>
-        <dependency>
-            <groupId>com.google.guava</groupId>
-            <artifactId>guava</artifactId>
-            <version>15.0</version>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 </project>
diff --git 
a/contentparser/org-apache-sling-contentparser-xml/src/test/java/org/apache/sling/contentparser/xml/internal/XmlContentParserTest.java
 
b/contentparser/org-apache-sling-contentparser-xml/src/test/java/org/apache/sling/contentparser/xml/internal/XmlContentParserTest.java
index 111ac73..5da18c3 100644
--- 
a/contentparser/org-apache-sling-contentparser-xml/src/test/java/org/apache/sling/contentparser/xml/internal/XmlContentParserTest.java
+++ 
b/contentparser/org-apache-sling-contentparser-xml/src/test/java/org/apache/sling/contentparser/xml/internal/XmlContentParserTest.java
@@ -20,20 +20,21 @@ package org.apache.sling.contentparser.xml.internal;
 
 import java.io.File;
 import java.math.BigDecimal;
+import java.util.Arrays;
 import java.util.Calendar;
+import java.util.Collections;
+import java.util.HashSet;
 import java.util.Map;
 import java.util.TimeZone;
 
 import org.apache.sling.contentparser.api.ContentParser;
 import org.apache.sling.contentparser.api.ParseException;
 import org.apache.sling.contentparser.api.ParserOptions;
+import org.apache.sling.contentparser.testutils.TestUtils;
 import org.apache.sling.contentparser.testutils.mapsupport.ContentElement;
 import org.junit.Before;
 import org.junit.Test;
 
-import com.google.common.collect.ImmutableSet;
-
-import static org.apache.sling.contentparser.testutils.TestUtils.parse;
 import static org.junit.Assert.assertArrayEquals;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
@@ -52,16 +53,17 @@ public class XmlContentParserTest {
 
     @Test
     public void testPageJcrPrimaryType() throws Exception {
-        ContentElement content = parse(underTest, file);
+        ContentElement content = TestUtils.parse(underTest, file);
 
         assertEquals("app:Page", 
content.getProperties().get("jcr:primaryType"));
     }
 
     @Test
     public void testDataTypes() throws Exception {
-        ContentElement content = parse(underTest, file);
-
-        Map<String, Object> props = 
content.getChild("toolbar/profiles/jcr:content").getProperties();
+        ContentElement content = TestUtils.parse(underTest, file);
+        ContentElement child = 
content.getChild("toolbar/profiles/jcr:content");
+        assertNotNull("Expected child at path toolbar/profiles/jcr:content", 
child);
+        Map<String, Object> props = child.getProperties();
         assertEquals(true, props.get("hideInNav"));
 
         assertEquals(1234567890123L, props.get("longProp"));
@@ -75,17 +77,19 @@ public class XmlContentParserTest {
 
     @Test
     public void testContentProperties() throws Exception {
-        ContentElement content = parse(underTest, file);
-
-        Map<String, Object> props = 
content.getChild("jcr:content/header").getProperties();
+        ContentElement content = TestUtils.parse(underTest, file);
+        ContentElement child = content.getChild("jcr:content/header");
+        assertNotNull("Expected child at jcr:content/header", child);
+        Map<String, Object> props = child.getProperties();
         assertEquals("/content/dam/sample/header.png", 
props.get("imageReference"));
     }
 
     @Test
     public void testCalendar() throws Exception {
-        ContentElement content = parse(underTest, new 
ParserOptions().detectCalendarValues(true), file);
-
-        Map<String, Object> props = 
content.getChild("jcr:content").getProperties();
+        ContentElement content = TestUtils.parse(underTest, new 
ParserOptions().detectCalendarValues(true), file);
+        ContentElement child = content.getChild("jcr:content");
+        assertNotNull("Expected child at jcr:content", child);
+        Map<String, Object> props = child.getProperties();
 
         Calendar calendar = (Calendar) props.get("app:lastModified");
         assertNotNull(calendar);
@@ -103,11 +107,10 @@ public class XmlContentParserTest {
 
     @Test
     public void testUTF8Chars() throws Exception {
-
-        ContentElement content = parse(underTest, file);
-
-        Map<String, Object> props = 
content.getChild("jcr:content").getProperties();
-
+        ContentElement content = TestUtils.parse(underTest, file);
+        ContentElement child = content.getChild("jcr:content");
+        assertNotNull("Expected child at jcr:content", child);
+        Map<String, Object> props = child.getProperties();
         assertEquals("äöü߀", props.get("utf8Property"));
     }
 
@@ -115,7 +118,7 @@ public class XmlContentParserTest {
     public void testParseInvalidJson() throws Exception {
         file = new File("src/test/resources/invalid-test/invalid.json");
 
-        ContentElement content = parse(underTest, file);
+        ContentElement content = TestUtils.parse(underTest, file);
         assertNull(content);
     }
 
@@ -123,34 +126,37 @@ public class XmlContentParserTest {
     public void testParseInvalidJsonWithObjectList() throws Exception {
         file = new 
File("src/test/resources/invalid-test/contentWithObjectList.json");
 
-        ContentElement content = parse(underTest, file);
+        ContentElement content = TestUtils.parse(underTest, file);
         assertNull(content);
     }
 
     @Test
     public void testIgnoreResourcesProperties() throws Exception {
-        ContentElement content = parse(underTest,  new 
ParserOptions().ignoreResourceNames(ImmutableSet.of("header", "newslist"))
-                .ignorePropertyNames(ImmutableSet.of("jcr:title")), file);
+        ContentElement content = TestUtils.parse(underTest,
+                new 
ParserOptions().ignoreResourceNames(Collections.unmodifiableSet(new 
HashSet<>(Arrays.asList("header", "newslist"))))
+                        .ignorePropertyNames(Collections.unmodifiableSet(new 
HashSet<>(Arrays.asList("jcr:title")))), file);
         ContentElement child = content.getChild("jcr:content");
+        assertNotNull("Expected child at jcr:content", child);
+        Map<String, Object> props = child.getProperties();
 
-        assertEquals("Sample Homepage", 
child.getProperties().get("pageTitle"));
-        assertNull(child.getProperties().get("jcr:title"));
+        assertEquals("Sample Homepage", props.get("pageTitle"));
+        assertEquals("abc", props.get("refpro1"));
+        assertEquals("def", props.get("pathprop1"));
+        assertNull(props.get("jcr:title"));
 
         assertNull(child.getChildren().get("header"));
         assertNull(child.getChildren().get("newslist"));
         assertNotNull(child.getChildren().get("lead"));
-
-        assertEquals("abc", child.getProperties().get("refpro1"));
-        assertEquals("def", child.getProperties().get("pathprop1"));
     }
 
     @Test
     public void testGetChild() throws Exception {
 
-        ContentElement content = parse(underTest, file);
+        ContentElement content = TestUtils.parse(underTest, file);
         assertNull(content.getName());
 
         ContentElement deepChild = 
content.getChild("jcr:content/par/image/file/jcr:content");
+        assertNotNull("Expected a child at path 
jcr:content/par/image/file/jcr:content", deepChild);
         assertEquals("jcr:content", deepChild.getName());
         assertEquals("nt:resource", 
deepChild.getProperties().get("jcr:primaryType"));
 
diff --git a/contentparser/pom.xml b/contentparser/pom.xml
index 9b5dd03..88c6114 100644
--- a/contentparser/pom.xml
+++ b/contentparser/pom.xml
@@ -37,6 +37,7 @@
         <module>org-apache-sling-contentparser-api</module>
         <module>org-apache-sling-contentparser-json</module>
         <module>org-apache-sling-contentparser-xml</module>
+        <module>org-apache-sling-contentparser-xml-jcr</module>
         <module>org-apache-sling-contentparser-testutils</module>
     </modules>
 </project>

Reply via email to