Skip to content

Commit 9e716e5

Browse files
committed
Update README.md.
1 parent c48f350 commit 9e716e5

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

README.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -902,15 +902,10 @@ The `ElementAdapter` class provides access to the contents of an XML DOM `Elemen
902902
This code could be used to load the document and adapt the root element:
903903

904904
```java
905-
var documentBuilderFactory = DocumentBuilderFactory.newInstance();
906-
907-
documentBuilderFactory.setExpandEntityReferences(false);
908-
documentBuilderFactory.setIgnoringComments(true);
909-
910-
var documentBuilder = documentBuilderFactory.newDocumentBuilder();
905+
var documentBuilder = ElementAdapter.newDocumentBuilder();
911906

912907
Document document;
913-
try (var inputStream = getClass().getResourceAsStream("account.xml")) {
908+
try (var inputStream = Examples.class.getResourceAsStream("account.xml")) {
914909
document = documentBuilder.parse(inputStream);
915910
}
916911

@@ -1031,7 +1026,7 @@ public static <K, V> Map<K, V> mapOf(Map.Entry<K, V>... entries) { ... }
10311026
public static <E> Set<E> setOf(E... elements) { ... }
10321027
```
10331028

1034-
They offer an alternative to similar methods defined by the `List`, `Map`, and `Set` interfaces, which produce immutable instances and do not permit `null` values. The following immutable and sorted variants are provided as well:
1029+
They offer an alternative to similar methods defined by the `List`, `Map`, and `Set` interfaces, which produce immutable instances and do not permit `null` values. Immutable and sorted variants are provided as well:
10351030

10361031
```java
10371032
public static <E> List<E> immutableListOf(E... elements) { ... }

0 commit comments

Comments
 (0)