@@ -28,7 +28,7 @@ Include the following in your `pom.xml` for Maven:
2828 <dependency>
2929 <groupId>com.github.javadev</groupId>
3030 <artifactId>underscore17</artifactId>
31- <version>1.45 </version>
31+ <version>1.46 </version>
3232 </dependency>
3333 ...
3434</dependencies>
@@ -37,7 +37,7 @@ Include the following in your `pom.xml` for Maven:
3737Gradle:
3838
3939``` groovy
40- implementation 'com.github.javadev:underscore17:1.45 '
40+ implementation 'com.github.javadev:underscore17:1.46 '
4141```
4242
4343### Usage
@@ -282,6 +282,35 @@ String json =
282282List<String > names = U . selectTokens(U . fromJsonMap(json), " //Products[Price>=50]/Name/text()" );
283283// [Anvil, Elbow Grease]
284284```
285+ Easily build XML documents using code structured like the final document.
286+
287+ This code:
288+
289+ ``` java
290+ XmlBuilder builder = XmlBuilder . create(" Projects" )
291+ .e(" underscore-java" ). a(" language" , " Java" ). a(" scm" , " SVN" )
292+ .e(" Location" ). a(" type" , " URL" )
293+ .t(" https://github.com/javadev/underscore-java/" )
294+ .up()
295+ .up()
296+ .e(" JetS3t" ). a(" language" , " Java" ). a(" scm" , " CVS" )
297+ .e(" Location" ). a(" type" , " URL" )
298+ .t(" https://jets3t.s3.amazonaws.com/index.html" );
299+ ```
300+
301+ Produces this XML document:
302+
303+ ``` xml
304+ <?xml version =" 1.0" encoding =" UTF-8" ?>
305+ <Projects >
306+ <underscore-java language =" Java" scm =" SVN" >
307+ <Location type =" URL" >https://github.com/javadev/underscore-java/</Location >
308+ </underscore-java >
309+ <JetS3t language =" Java" scm =" CVS" >
310+ <Location type =" URL" >https://jets3t.s3.amazonaws.com/index.html</Location >
311+ </JetS3t >
312+ </Projects >
313+ ```
285314
286315Underscore-java is a java port of [ Underscore.js] ( https://underscorejs.org/ ) .
287316
0 commit comments