kettle对xml的追加写入
最近研究xsl解析xml生产html功能;实现过程中发现生成 特定格式的xml 文件比较麻烦。kettle本身提供xml生产组件;但是太弱了,捣腾了好久终于实现了;今天有空把它贴出来。
xml写入方式一) 作业设计如图:
生产xml数据如下: <?xml version="1.0" encoding="UTF-8"?>
xml写入方式二)
xml结果数据如下:
<?xml version="1.0" encoding="UTF-8"?> <root> <teacher> <Row> <teacher_id>1</teacher_id> <teacher_name>tom</teacher_name> </Row> <Row> <teacher_id>2</teacher_id> <teacher_name>jack</teacher_name> </Row> <Row> <teacher_id>3</teacher_id> <teacher_name>rose</teacher_name> </Row> </teacher> <student> <Row> <student_id>1</student_id> <student_name>juli</student_name> </Row> <Row> <student_id>2</student_id> <student_name>lurry</student_name> </Row> <Row> <student_id>3</student_id> <student_name>aiven</student_name> </Row> </student> <location> <Row> <location_id>1</location_id> <location>shenzhen</location> </Row> <Row> <location_id>2</location_id> <location>shanghai</location> </Row> <Row> <location_id>3</location_id> <location>guangzhou</location> </Row> </location> </root> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |