in src/main/java/org/apache/sling/contentparser/xml/jcr/internal/JCRXMLContentParser.java [113:151]
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 && !properties.containsKey(JcrConstants.JCR_PRIMARYTYPE)) {
properties.put(JcrConstants.JCR_PRIMARYTYPE, defaultPrimaryType);
}
contentHandler.resource(path, properties);
}