IDML 中 Story XML 的逻辑顺序
我是 IDML 新手,我正在尝试理解这一点。
我发现 IDML 是包含多个 XML 文件的 zip 文件。 我打开了 designmap.xml
并在 Document
元素中看到了 StoryLine
属性。 但是,StoryLine
属性中的此顺序不一定与实际内容上显示的文本的逻辑顺序一致。
例如,IDML SDK 中的 BusinessCardTemplate 具有以下逻辑顺序:
John Doe
Software Developer
InDesign
Adobe Systems Incorporated
801 North 34th Street
Seattle, WA 98103
Phone: 206.675.7000
[email protected]
www.adobe.com
但是根据 StoryList
属性,以下是它引用的顺序:
Software Developer
InDesign
John Doe
[email protected]
www.adobe.com
Phone: 206.675.7000
801 North 34th Street
Seattle, WA 98103
Adobe Systems Incorporated
有没有办法从 IDML 的内容中找出了解这些故事的逻辑顺序(最好是从左上角到左下角)?
提前致谢
I am new to IDML and I am trying to understand this.
I have figured out that IDML is zip file containing multiple XML files.
I have opened the designmap.xml
and saw the StoryLine
attribute in Document
element.
However, this order in the StoryLine
atribute does not necessary agree with logical order of the text displayed on actual content.
For example the BusinessCardTemplate inside the IDML SDK has the following logical order:
John Doe
Software Developer
InDesign
Adobe Systems Incorporated
801 North 34th Street
Seattle, WA 98103
Phone: 206.675.7000
[email protected]
www.adobe.com
However according to the StoryList
attribute the following is the order that it refers as following:
Software Developer
InDesign
John Doe
[email protected]
www.adobe.com
Phone: 206.675.7000
801 North 34th Street
Seattle, WA 98103
Adobe Systems Incorporated
Is there any way to figure out from the content of IDML to know the logical order (preferably from top left to bottom left) of those stories?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
故事只是文本内容,从文档中的使用中抽象出来。如果您想以正确的顺序获取故事,您需要:
1) 在解压的 IDML 文件的根目录中找到 designmap.xml(首先解压整个文件 - 我想您已经知道这一点)
2) 获取 Spreads 的顺序通过查找跨页元素:
3) 在每个跨页文档中,获取 TextFrames 的顺序:
4) 检查每个文本框架的 ParentStory 引用:
5) 查找相关故事:在本例中它将是
Stories/Story_uda.xml。
在一个简单的文档中,每个 TextFrame 都与一个故事相匹配,这将为您提供故事在文档中出现的顺序。
然而,在某些情况下 - 例如链接到单个故事的多个框架,或线程框架(其中一个故事被拆分为多个 TextFrame) - 这种映射不会那么简单。还要注意 MasterSpreads 引入的复杂性。
您会发现 Adobe IDML 文档很有用: http://www.adobe.com/ devnet/indesign/documentation.html#idml
The story is just the text content, abstracted from its use in the document. If you want to get stories in the right order, you need to:
1) Find designmap.xml in the root of your unpacked IDML file (unzip the whole thing first - I think you know this already)
2) Get the order of Spreads from it by finding the spread elements:
3) Within each spread document, get the order of TextFrames:
4) Check the ParentStory reference of each text frame:
5) Find the related story: in this case it will be
Stories/Story_uda.xml.
In a simple document, where each TextFrame is matched to one story, this will give you the order in which your stories appear in the document.
There are, however, some circumstances - such as multiple frames linked to a single story, or threaded frames, where one story is split over a number of TextFrames - where this mapping will not be so straightforward. Look out also for complexity introduced by MasterSpreads.
You will find the Adobe IDML documentation useful: http://www.adobe.com/devnet/indesign/documentation.html#idml
直接处理故事是相当困难的。如果您使用标记功能会更容易。打开 InDesign 文件并导入具有正确数据结构的 XML 文件。然后,您可以标记文档的各个部分以映射到 XML 节点。
完成此操作后,将文档导出到 IDML,然后查看 XML 目录中的
BackingStory.xml
文件,您将在其中找到如下所示的节点:这定义了指令 XML 节点到 Story_u16a 的映射。 xml 文件。但是,您不再需要担心 Story,因为您现在已经可以访问将注入到 Story 中的节点值。
本教程介绍 InDesign XML 标记。
Working directly with the Stories is quite difficult. It is easier if you use the Tagging features. Open your InDesign file and import an XML file with the correct structure for your data. You can then Tag the parts of the document to map to the XML nodes.
Once that is done export the document to IDML and then look in the XML directory at the file
BackingStory.xml
where you will find nodes like this:This defines the mapping for the Instructions XML node into the Story_u16a.xml file. However you no longer need to worry about the Story because you now already have access to the node value that will be injected into the Story.
This tutorial explains the InDesign XML tagging.