Putting the XML into the data-model

Note:

This section is for programmers.

It's easy to create a simple program to try the examples. Just replace the "Create a data-model" part of the example of Programmer's Guide Quickstart with this:

/* Create a data-model */
Map root = new HashMap();
root.put(
        "doc",
        freemarker.ext.dom.NodeModel.parse(new File("the/path/of/the.xml")));

and then you have a program that outputs the result of the XML transformation to the standard output (usually the terminal screen).

Notes:

Note that there are tools available that you can use to generate files from XML documents, so you don't have to write your own for this common task. See here...

上一章 首页 下一章