File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -389,9 +389,11 @@ XmlBuilder builder = XmlBuilder.create("Projects")
389389 .e(" JetS3t" ). a(" language" , " Java" ). a(" scm" , " CVS" )
390390 .e(" Location" ). a(" type" , " URL" )
391391 .t(" https://jets3t.s3.amazonaws.com/index.html" );
392+ System . out. println(builder. toXml(Xml . XmlStringBuilder . Step . TWO_SPACES ));
393+ System . out. println(builder. toJson(Json . JsonStringBuilder . Step . TWO_SPACES ));
392394```
393395
394- Generates the following XML document :
396+ Generates the following XML and JSON documents :
395397
396398``` xml
397399<?xml version =" 1.0" encoding =" UTF-8" ?>
@@ -404,6 +406,28 @@ Generates the following XML document:
404406 </JetS3t >
405407</Projects >
406408```
409+ ``` json
410+ {
411+ "Projects" : {
412+ "underscore-java" : {
413+ "-language" : " Java" ,
414+ "-scm" : " SVN" ,
415+ "Location" : {
416+ "-type" : " URL" ,
417+ "#text" : " https://github.com/javadev/underscore-java/"
418+ }
419+ },
420+ "JetS3t" : {
421+ "-language" : " Java" ,
422+ "-scm" : " CVS" ,
423+ "Location" : {
424+ "-type" : " URL" ,
425+ "#text" : " https://jets3t.s3.amazonaws.com/index.html"
426+ }
427+ }
428+ }
429+ }
430+ ```
407431
408432Underscore-java is a java port of [ Underscore.js] ( https://underscorejs.org/ ) .
409433
You can’t perform that action at this time.
0 commit comments