XML and InDesign

Errata for XML and InDesign

Submit your own errata for this product.


The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update



Version Location Description Submitted By Date Submitted Date Corrected
Printed, PDF
Page 13
all of chapter 3

Dear, I'm Kenshi Muto, am supervising Japanese translation version of this book with O'Reilly Japan. In Chapter 3, I'm very confusing. [Issue 1] 'CourseDescription' makes a confusion. Chapter 2 p.9: you showed simple DTD (A). It won't use CourseDescription. Chapter 3 p.15: you pull another DTD (B), uses CourseDecription. Chapter 3 p.37: minor change of DTD-B (C). CourseDescription is a next sibling of CourseDescription_Major. p.15-16 Figure3-2 and step description: on DTD-A p.17 sample XML: on DTD-B p.19-20 import sample XML: on DTD-A. -> won't work! p.22 Figure3-9: on DTD-A p.23 Figure3-10: on DTD-A -> very different from p.17 sample. p.27 Figure3-14: on DTD-A p.28 unmarked XML: on DTD-B p.35-36 on both DTD-A / DTD-B p.37 another pattern sample XML: on DTD-C p.51 Figure6-1: on DTD-A? p.63 Example8-1: on DTD-C? So... at this time, these conflicting prevents to reproduce the step is written in book. Unifiying one DTD introduces a lot of changes, I believe also. Iissue 2] There are 'CouseDescription_Head' tag name at some places and figures. It might be unified to CourseDescription_Name. [Issue 3] To bind TextFrame to CourseDescriptions element, I believe we have to change [Root] tag to [CourseDescriptions] before going step 1 on p.16. Furthermore, I think we should drag-and-drop element to TextFrame instead of using Tag palette.

Note from the Author or Editor:
The reviewer's comments are sometimes correct but sometimes don't take into account the context of the XML in the different parts of the book. I agree that the DTD on p.15 doesn't coincide with the example on p. 16 because I omitted the CourseDescription level around CourseDescription_Major. We don't need the CourseDescriptions in the DTD on p.15, we can edit it to match the example on p.16: [begin correction] <?xml version="1.0" encoding="UTF-8"?> <!ELEMENT CourseDescriptions (CourseDescription_Major | CourseDescription_Name | CourseDescription_Text | CourseDescription_Footnote)+> <!ELEMENT CourseDescription_Major (#PCDATA)> <!ELEMENT CourseDescription_Name (#PCDATA)> <!ELEMENT CourseDescription_Text (#PCDATA)> <!ELEMENT CourseDescription_Footnote (#PCDATA)> <!ATTLIST CourseDescription_Footnote type CDATA #REQUIRED > [end correction] ****************************** On p 17, I state that you can make your own DTD or not even use a DTD (there is no DTD declaration in the XML example on p.17). Suggested change on p.17 for the sentence above the XML example: [begin correction] This is the XML (without a DTD) that I imported into my placeholders for testing: [end correction] ******************************* There is a place in the book where I talk about the need for a wrapper element to make the repeating elements work, Table 3-2 and IF we created a DTD to model that structure, it would look like the original one on p.16. The paragraph on p.35 just above the tip should be changed to read: [begin correction] It seems that InDesign expects you will have a repeating type of content structure, identifiable by a “wrapper” element that contains other elements. For example, the course descriptions content needs to have a <CourseDescription> element containing the name, description, and prerequisite content. Without the wrapper <CourseDescription> element, InDesign will not properly apply the “clone” to the incoming XML when you select the Clone repeating text elements Option. (The DTD would have to be modified to add this CourseDescription level in the content model if you are using a DTD for validation.) [end correction] **************************** Lack of indentation in the XML samples on p. 37 makes this hard to compare to the DTD. It would be better if the XML samples were reformatted with the indents that represent the actual content hierarchy, as follows: [begin correction] <CourseDescriptions> <metadata><creator>Hoskins</creator><createDate>03012007</createDate><note>used for table layout (table tagged as &lt;CourseDescriptions&gt;)</note><note>placeholder text is named with element names for clarity; paragraph style names may be different, so not using Map Tags to Styles with Map by Name checkbox.</note></metadata> <CourseDescription_Major>Accounting</CourseDescription_Major> <CourseDescription> <CourseDescription_Name>ACC 101 Accounting Principles I 4 Credits</CourseDescription_Name> <CourseDescription_Text>Basic principles of financial accounting for the business enterprise with emphasis on the valuation of business assets, measurement of net income, and double-entry techniques for recording transactions. Introduction to the cycle of accounting work, preparation of financial statements, and adjusting and closing procedures. Four class hours.</CourseDescription_Text> <CourseDescription_Footnote type="prereq">Prerequisite: MTH 098 or MTH 130 or equivalent.</CourseDescription_Footnote> </CourseDescription><!-- more ...--> </CourseDescriptions> XML example including metadata elements Because the metadata tags do not match the placeholder elements that were set up, they can be excluded using the Import only elements that match structure Option. So the result should be only this in the imported XML: <CourseDescriptions> <CourseDescription_Major>Accounting</CourseDescription_Major> <CourseDescription> <CourseDescription_Name>ACC 101 Accounting Principles I 4 Credits</CourseDescription_Name> <CourseDescription_Text>Basic principles of financial accounting for the business enterprise with emphasis on the valuation of business assets, measurement of net income, and double-entry techniques for recording transactions. Introduction to the cycle of accounting work, preparation of financial statements, and adjusting and closing procedures. Four class hours.</CourseDescription_Text> <CourseDescription_Footnote type="prereq">Prerequisite: MTH 098 or MTH 130 or equivalent.</CourseDescription_Footnote> </CourseDescription><!-- more ...--> </CourseDescriptions> [end correction] ******************************* Iissue 2] There are 'CourseDescription_Head' tag name at some places and figures. It might be unified to CourseDescription_Name. A correction for p. 16 Figure 3-3 requires edited screen shot to replace the large text "CourseDescription_Head" with "CourseDescription_Name" to match the tag name A correction for p. 23, the screenshot needs to be remade, with the XML on the right redone to change "CourseDescription_Head" to "CourseDescription_Name" ************************** [Issue 3] To bind TextFrame to CourseDescriptions element, I believe we have to change [Root] tag to [CourseDescriptions] before going step 1 on p.16. Furthermore, I think we should drag-and-drop element to TextFrame instead of using Tag palette. The only correction that is required here, I think is: p.16, top of page: [begin correction] 1. Highlight the text frame and tag it with the corresponding root tag name "CourseDescriptions" found in the Tag palette. [end correction] **************************** p. 51 no change required ***************************** p.63 the DTD here is consistent with the text which follows it. This DTD does not have to be consistent with other DTD examples or screenshots in the book. However, I think it would be better to change the XML example on p. 69: [begin correction] <?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE CourseDescriptions SYSTEM "coursedescriptions.dtd"> <CourseDescriptions> <CourseDescription_Major/> <CourseDescription> <CourseDescription_Name/> <CourseDescription_Text/> <CourseDescription_Footnote type="whatever"/> </CourseDescription> </CourseDescriptions> [end correction]

Kenshi Muto  May 05, 2013 
Printed, PDF, ePub
Page 53
paw print tip, suggestion or general note

When I removed trows="#" from the aid:table statement, then Imported XML InDesign gave me the error. <Table> is an invalid table element or appears in the wrong order. I am using InDesign CS 6 (not cloud) . My question ~ Does this work in the Cloud version?

Note from the Author or Editor:
I state in the book Chapter 6: Exporting XML that the aid:trows value (not the aid:trows attribute itself) is optional and should be omitted during import if you wish to avoid truncating a table when InDesign is calculating the table layout. However, when I made this table import with the aid:trows empty, it failed in InDesign CC with the same message that you got. If I simply export a table from InDesign as a CALS table, then reimport it, using "Do not import contents of whitespace-only elements" along with the "Import CALS table as InDesign tables", that seems to work without any aid:namespace in it. I'll investigate if the aid: namespace is the same in CS6 and CC as in previous versions of InDesign, especially as applied to tables and rewrite this section if it needs clarification for those versions. Correction for book: p. 53 tip There is no <row> equivalent in InDesign table structures. The value of aid:trows should be calculated based on the total number of cells divided by number of columns. Add the number of header and footer rows to get the total trows value. It is better to have more rows than needed, which can be removed in InDesign, than too few rows, which might truncate the table during import. Table 6.1. Table attributes aid:trows="N" Defines N number of rows in the table. When generating a table to import into InDesign, calculate number of cells divided by number of columns to get number of rows, then add number of header/footer rows to get final value for aid:trows..

Anonymous  Jan 30, 2014 
Printed, PDF
Page 88
XSLT sample

Hi, I found another issue that blocks to reproduce. XSLT sample on p.88 seems be different from you expected. It produces glossTerm element and doesn't fit with the Table placeholder. I'm not sure how to fix this XSLT, but at least this XSLT won't make a result as Figure10-7.

Note from the Author or Editor:
This looks to be the wrong XSLT code example. I can provide the XSLT, sample output of the XSLT, screenshot of XML Import dialog, readme text file and IDML file in a zip for download. XSLT is copied here for page 88 replacement. It is longer and has comments to explain the use of the aid: and aid5: namespace to format tables. ****************** <?xml version="1.0" encoding="UTF-8"?> <!-- use this XSLT with XML which has glossary root with term and definition children to generate an InDesign table--> <!-- MUST use the xmlns to get the InDesign namespace aid5: for table style, cell style, and aid: for paragraph style and character style --> <!-- once the namespaces are on the output, glossary, term and definition will behave like Table and Cell in InDesign. Column width is hard-coded in the XSLT. --> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no"/> <xsl:param name="Ncols">2</xsl:param> <!-- best to set this with a param then we can use the value in a calculation if desired for glossary table we need one col for term and one col for definitiion--> <xsl:template match="/"> <!-- count terms so we know how many rows we will need for the glossary table --> <xsl:variable name="termCount"> <xsl:value-of select="count(glossary/term)"/> </xsl:variable> <!-- we have one row of column headings to add to the count we will use for the trows --> <xsl:variable name="Nrows" select="$termCount + 1"/> <!-- allow for header row--> <glossary xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/" aid:table="table" aid:trows="{$Nrows}" aid:tcols="{$Ncols}" aid5:tablestyle="GlossaryTable"> <colHead aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1" aid:ccolwidth="85" aid5:cellstyle="colHeads">Term</colHead> <colHead aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1" aid:ccolwidth="175" aid5:cellstyle="colHeads">Definition</colHead> <xsl:apply-templates/> </glossary> </xsl:template> <xsl:template match="glossary"> <!-- we can make elements behave like table cells by adding the aid: and aid5: namespace attributes to them --> <xsl:for-each select="term"> <!-- <xsl:sort order="ascending"/>--> <!-- if this xsl:sort makes InDesign crash during import and you need to sort, uncomment the xsl:sort, transform the XML and save the result prior to import (don't use XSLT during import) --> <term aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="85" aid5:cellstyle="termCell"> <xsl:value-of select="."/> </term> <definition aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="175"> <xsl:value-of select="following-sibling::definition[1]"/><!-- if there was more than one defintion per term we would need to modify the XSLT here --> </definition> </xsl:for-each> </xsl:template> </xsl:stylesheet> Input XML file: <?xml version="1.0" encoding="UTF-16"?> <!-- test import for the glossary with XSLT p.88 to generate a table with table and cell styles, paragraph and character styles --> <glossary> <term>Affidavit</term> <definition>A legal document that provides proof (of residency, payment, status as an emancipated minor, etc.). Affidavits must be prepared by an attorney, appropriate agency or counselor, and must be attested to under supplied with a notarization stamp.</definition> <term>F-1 Visa</term> <definition>An F-1visa is a nonimmigrant visa issued by the USCIS (formerly INS) to the alien student who is pursuing studies in the US. The "F" visa is reserved for nonimmigrants wishing to pursue academic studies and/or language training programs.</definition> <term>INS documentation</term> <definition>Written materials provided by US Citizen and Immigration Services (formerly Immigration and Naturalization Services) to prove a student's status as an legal nonimmigrant.</definition> <term>Non-resident tuition rate</term> <definition>Students whose primary residence is not in the state will pay the tuition rate for non-residents. However, if a student resides within the state for the six months of the year immediately preceding the start of the session for which tuition is paid, the student qualifies for the resident tuition rate.</definition> <term>EDU-PAY</term> <definition>A payment plan for students who do not have the resources to pay the bill in full or who may not qualify for sufficient financial aid to cover the entire bill at the college.</definition> </glossary> Output XML file: <?xml version="1.0" encoding="UTF-8"?><glossary xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/" aid:table="table" aid:trows="6" aid:tcols="2" aid5:tablestyle="GlossaryTable"><colHead aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1" aid:ccolwidth="85" aid5:cellstyle="colHeads">Term</colHead><colHead aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1" aid:ccolwidth="175" aid5:cellstyle="colHeads">Definition</colHead><term aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="85" aid5:cellstyle="termCell">Affidavit</term><definition aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="175">A legal document that provides proof (of residency, payment, status as an emancipated minor, etc.). Affidavits must be prepared by an attorney, appropriate agency or counselor, and must be attested to under supplied with a notarization stamp.</definition><term aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="85" aid5:cellstyle="termCell">F-1 Visa</term><definition aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="175">An F-1visa is a nonimmigrant visa issued by the USCIS (formerly INS) to the alien student who is pursuing studies in the US. The "F" visa is reserved for nonimmigrants wishing to pursue academic studies and/or language training programs.</definition><term aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="85" aid5:cellstyle="termCell">INS documentation</term><definition aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="175">Written materials provided by US Citizen and Immigration Services (formerly Immigration and Naturalization Services) to prove a student's status as an legal nonimmigrant.</definition><term aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="85" aid5:cellstyle="termCell">Non-resident tuition rate</term><definition aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="175">Students whose primary residence is not in the state will pay the tuition rate for non-residents. However, if a student resides within the state for the six months of the year immediately preceding the start of the session for which tuition is paid, the student qualifies for the resident tuition rate.</definition><term aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="85" aid5:cellstyle="termCell">EDU-PAY</term><definition aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="175">A payment plan for students who do not have the resources to pay the bill in full or who may not qualify for sufficient financial aid to cover the entire bill at the college.</definition></glossary>

Kenshi Muto  May 06, 2013