如何使用XML数据生成InDesign内容 [英] How to generate InDesign content using XML data

查看:257
本文介绍了如何使用XML数据生成InDesign内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过导入XML数据在InDesign中生成一些内容,但是我不知道该怎么做。这就是我所拥有的:

I'm trying to generate some content in InDesign by importing XML data, but I can't figure out how to do it. Here's what I have:

<stuff>
    <person>
        <name>John</name><age>42</age>
        <name>Oscar</name><age>39</age>
    </person>
</stuff>

这就是我想要的结果:

Person: John, 42
Person: Oscar, 39

我该怎么做?

推荐答案

这真的很容易做到。完整的说明可在《 Adob​​e InDesign和XML设计人员指南》一书中找到。

This is actually very easy to do this. Complete directions can be found in the book a Designer's Guide to Adobe InDesign and XML.

最简单的方法是将XML源导入InDesign。将一个数据节点拖到布局中。在数据前面添加重复的文本元素,例如 Person:。格式化所有占位符(按xml中出现的顺序保留它们),然后从结构面板中删除不属于主要占位符的所有节点。 。

The easiest way to do this is to import your XML source into InDesign. Drag one data node into the layout. Add the repetitive text elements in front of your data, such as "Person:" Format all your placeholders (keep them in the order appearing in the xml) and then delete all nodes from the structure panel that aren't part of the main placeholders.

重新导入XML源,然后在导入xml对话框中选中以下框:克隆重复元素...,仅导入匹配的元素...,然后忽略空白...

Re-import the XML source and in the Import xml dialog check the boxes: clone repeating elements..., only import elements that match..., and "ignore whitespace..."

这将在XML数据中并以您想要的方式对其进行格式化。您的布局可能仅针对一个数据节点进行结构化。要剩下的内容,只需将适当的父元素从结构面板拖到布局中即可。

This will being in the XML data and format it in the manner you want. Your layout may be structured only for one data node. To flow the rest, just drag the appropriate parent element from the structure panel to the layout.

InDesign的XSLT功能有限,主要是XML导入选项对话框中的选项。如果需要更多详细说明,则必须在导入期间使用外部XSLT。

InDesign has limited XSLT capabilities, mostly the options in the XML import options dialog. If you need anything more elaborate you'll have to use an external XSLT during import.

InDesign仅支持XSLT版本1.0

InDesign only supports XSLT version 1.0

这篇关于如何使用XML数据生成InDesign内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆