开发者

Freemarker: Reproduce XML

开发者 https://www.devze.com 2023-01-04 11:46 出处:网络
Folks, I am workin开发者_如何学Pythong on a freemarker template that needs to reproduce parts of the input XML tree.

Folks, I am workin开发者_如何学Pythong on a freemarker template that needs to reproduce parts of the input XML tree.

I would love to have a macro that I could invoke as follows:

<@renderTree node=node namespace="ns"/>

Anyone have something like this handy?

Thanks.

-Raj


Freemarker has a special hash key for this: @@markup. So, my example above:

<@renderTree node=node namespace="ns"/>

Where variable "node" contains an XML node, will be written as:

${ node[ "@@markup" ] }

More info here: Freemarker Manual XML processing

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号