FM XML Cookbook
FM XML Cookbook
0
XML Cookbook
Welcome
Welcome to Adobe FrameMaker 7.0, the premier desktop authoring, page-layout, and
XML, HTML, and SGML publishing software. FrameMaker 7.0 advances the ease of
publishing to paper, PDF, and common markup languages for Web display and data
exchange (HTML, XML, SGML). FrameMaker combines easy-to-use word-processing,
page-layout, large file, and book handling features and provides a powerful authoring and
publishing platform for small and large projects. Structured FrameMaker adds Structured
Authoring—today’s popular method of structuring and organizing information—so that
content and organization can be tightly controlled and, therefore, easily integrated with
content management and publishing systems.
Many new and enhanced features in FrameMaker 7.0 increase the value of FrameMaker as
your content authoring and publishing application. The XML Cookbook highlights many
of these important capabilities in Structured FrameMaker including:
• Structured Authoring
• XML Importing and Exporting
• Read/Write Mapping Rules
• CSS and XSL
• SVG
• Tagged PDF.
Overview
The XML Cookbook is divided into ten sections to help you learn, study, and review each
aspect of setting up Structured FrameMaker for XML authoring, importing, and exporting:
• Cookbook Setup:
Setting up your computer for the XML Cookbook exercises.
• Application Setup:
Setting up Structured FrameMaker for Importing and Exporting XML.
• Enabling Namespaces:
Defining how Structured FrameMaker handles XML Namespaces when import or
exporting XML.
• Document Schemas:
Generating a Structured FrameMaker Element Definition Document (EDD) from an
XML DTD and adding formatting controls.
• Structured Authoring:
Using “Guided Editing” to easily edit and validate a Structured FrameMaker
document.
Structured FrameMaker 7.0 extends the basic FrameMaker interface to enable you to
easily structure your content so that it is similar to the structure that is applied to XML or
SGML, enabling smooth incorporation of XML into your publishing process.
Unstructured FrameMaker 7.0 is the perfect tool for basic word processing and authoring
that have paper and PDF publishing requirements.
More recently, Extensible Markup Language (XML) has been adopted by the World Wide
Web Consortium (W3C), an international organization made up of software industry
leaders including Adobe, Intel, and Microsoft, as well as numerous other representatives
from the software/hardware industry and academia. Now, with FrameMaker 7.0, authors
can create structured documents using either markup language—SGML or XML.
The XML syntax is comprehensive and can take a long time to master. Most text editors
for XML are not user-friendly and vary greatly from one operating system to another.
FrameMaker 7.0 hides the markup syntax from the author and provides a powerful
graphical user interface that is easy to learn and use. The Structured View enables you to
look at the hierarchy of your structure. The Element catalog guides you easily through the
most complex structures, helping you to make decisions about valid elements at any
location in the document. The Validation tool quickly locates invalid elements and assists
you in correcting the errors.
Although FrameMaker 7.0 documents are not XML documents, they can be easily
exported to XML as well as SGML, XHTML, and HTML. FrameMaker can easily import
XML and SGML as well as add structure to unstructured documents through the use of a
conversion table.
Structure Features: Structured FrameMaker 7.0 is a complete structured publishing
system providing:
Application Setup
Getting Started
Tip Typically, the To create a Structured XML application you can either edit the default structapps.fm
Structured Template that is installed with Structured FrameMaker or make a copy for you own use.
designer creates and
edits the XML You will include references to the following files in your XML Cookbook
applications to be used structapps.fm file:
by the Structured
FrameMaker authors. • XML DTD—XML rules document
• ChapterTemplate.fm—Structured FrameMaker template
• ChapterReadWriteRules.fm—Read/Write mapping rules document.
You will also set the following preferences in your XML Cookbook structapps.fm
application:
Tip The structapps.fm • Namespaces—Enabled to preserve Namespaces on XML import and export
file is used to manage • Stylesheet—CSS and XSL references to tell your exported XML how to reference a
applications for both
stylesheet.
XML and SGML import
and export.
The following graphic shows a sample Application created to import and export DocBook
XML.
Notice that the Application above is comprised of file references and application settings.
Preparing an application is similar to setting parser and application settings in a Web or
XML environment.
The first step in setting up your XML Application in the structapps.fm file is to identify
all the files that are needed for XML import and/or export. Structured FrameMaker
provides a default structapps.fm document that you will open and save into your
practice folder for use with your XML Cookbook lessons.
1. Start FrameMaker, and check to see if you are currently running Structured
FrameMaker.
• Start FrameMaker 7.0.
• Choose the File>Preferences>General command (Windows and Macintosh)
or the keyboard shortcut !fP (Unix).
• Check the value in the Product Interface drop-down menu.
Tip You will work in 3. Save the structapps.fm file into your “App” folder.
your own copy of • Choose the File>Save As command.
structapps.fm for the
XML Cookbook. You do • Navigate to the “App” folder in your“Practice” folder.
this by opening • Click the Save button.
FrameMaker’s default
structapps.fm file and
then saving it to a new
location on your
computer.
Tip The default 4. Take a moment to review the contents of structapps.fm. You will edit
application file installed structapps.fm to define an application for your XML Cookbook.
with Structured Notice that structapps.fm is a structured document. For ease of navigation and
FrameMaker contains
editing, you will add your XML Application to structapps.fm with element
applications for several
boundaries turned on and the Element Catalog and Structure View open.
XML and SGML
publishing projects Element Boundaries identify the beginning and ending of elements in your document.
including DocBook,
You can view the elements with square brackets or as Tags by choosing the
XDocBook, and XHTML.
appropriate command from the View menu.
• Click the Structure View icon, located in the top right-hand corner of the
document window, to open the Structure View.
Tip Structapps.fm on
Unix does not include the
XDocBook and DocBook
applications.
Insertion point
The Element Catalog displays valid elements. Notice that XMLApplication is one of
your valid choices. The Element Catalog display can be set to display more than valid
elements. To set the Element Catalog display, click the Options button in the Element
Catalog.
Tip Although XML and 5. Begin defining your XML Application by inserting the “XMLApplication” element.
SGML applications in • In the Element Catalog, select the “XMLApplication” element.
Structured FrameMaker
are very similar, one
difference to note is that
an SGML application
can include an SGML
Declaration document
and an XML application
does not.
The XMLApplication
element and its first child,
ApplicationName, are
inserted.
Tip An XML DTD can Structured FrameMaker needs several files in order to import and export XML. These
be thought of as rules file files are referenced in a special structure called an “Application” in structapps.fm.
that defines what For your XML Cookbook project you will reference the XML DTD, the Structured
elements can be used in a FrameMaker template, and the Read/Write Rules document. You will also set the
document or sub- XML DOCTYPE so that Structured FrameMaker can automatically recognize the
document (document
XML document type on import. Many of these settings will also be important for
fragment) including how
XML export.
many times it can occur
and what type of content • In the Structure View, click after the “ApplicationName” element.
it can contain. The
equivalent file in
Structured FrameMaker
is the Element Definition
Document (EDD). You
can use the
File>Structure Insertion point
Tools>Open DTD to
turn a DTD into an EDD,
or use the
File>Structure
Tools>Save as DTD to
turn an EDD into a DTD.
Insertion point
• In the Structure View, place the insertion point after the “ReadWriteRules”
element.
Insertion point
7. Identify the XML DOCTYPES that you want your XML Application to recognize
when importing or exporting XML. For your XML Cookbook project you will
include Chapter and Section DOCTYPES.
• In the Structure View, click after the “Template” element.
Insertion point
• Type Chapter
Insertion point
• Type Section
Leave structapps.fm open while you are developing your XML project.
Tip Structured 9. Read structapps.fm back into Structured FrameMaker’s memory so that your
FrameMaker changes become active.
automatically reads the
• Choose the File>Structure Tools>Read Application Definitions command.
structapps.fm file
located in the Structure
folder at startup. When
you change the location
or make changes to the
structapps.fm file that
you want Structured
FrameMaker to use, you
need to have
FrameMaker “read” the
file before your changes
take effect.
• Locate and review the element and attribute definitions for the “table”
element.
• Locate and review the element and attribute definitions for the “topicxref”
element.
These elements and attributes will require read/write rules to control their behavior
during XML import and export.
Notice that the new file contains some comments and the statement #include
"isoall.rw". This statement tells Structured FrameMaker to use read/write rule
mappings for the ISO special entity for special characters used when authoring
FrameMaker content.
Tip In Structured • Save the new Read/Write Rules file as “ChapterReadWriteRules.fm” into
FrameMaker you can your “App” folder in your “Practice” folder.
create your read/write
rules as a FrameMaker
document (not
structured), as a
Structured FrameMaker
document (structured),
or as an ASCII file. You
select the file type
according to the
requirements of your
project.
Most rules in the Read/Write Rules document are expressed from the XML
perspective. For example, a rule like
element "pname" is fm element "ProductName";
equates the XML generic identifier “pname” with the Structured FrameMaker
element tag “ProductName”. The rule is written from the XML viewpoint, and it
applies equally to both import and export. A few rules pertain to Structured
FrameMaker constructs that have no XML counterparts, and these rules are expressed
from the Structured FrameMaker perspective. For example, a rule might specify
dropping the Structured FrameMaker element “IndexMarker” on export as:
fm element "IndexMarker" drop;
Tip Although read/write 4. Enter read/write rules to map names between XML and Structured FrameMaker.
rules appear to be • Place the insertion point at the end of the Read/Write Rules document.
written for XML import,
unless you make specific
use of the “Read” or
“Write” syntax, the rules
apply equally to both
import and export.
Insertion point
Tip Elements names in • Type the following read/write rule to map the “Section” element:
XML should be human- element "section" is fm element "Section";
readable. If a user were
to look at the XML
markup, they should be
able to understand the
name and meaning of
each element.
Read/Write rule
Tip For more • Type the following read/write rule to map the “Para” element:
information on creating
read/write rules to map
element names, see
Chapter 15,
“Translating Elements
and Their Attributes,” in
Structure_Dev_
Guide.pdf, located in
the FrameMaker Online Read/Write rule
Manuals folder.
• Type the following read/write rule to map the “TopicsList” element:
element "tplist" is fm element "TopicsList";
This one rule maps the XML element “tplist” to “TopicsList” on import and
“TopicsList” to “tplist” on export. The quotation marks around the element names are
required. This type of read/write rule is always terminated with a semicolon.
• On the next line, type the following rule to map the “TopicHead” element:
element "tphead" is fm element "TopicHead";
• On the next line, type the following rule to map the “TopicPara” element:
element "tppara" is fm element "TopicPara";
• On the next line, type the following rule to map the “FirstUse” element:
element "firstuse" is fm element "FirstUse";
Tip For more 5. Continue to type read/write rules to map names and element types between XML and
information on creating Structured FrameMaker as follows:
read/write rules to map
• On the next line, type the following rule:
table elements, see
element "tbody" is fm table body element "TableBody";
Chapter 17,
“Translating Tables,” in • On the next line, type the following rule:
Structure_Dev_ element "thead" is fm table heading element "TableHead";
Guide.pdf, located in • On the next line, type the following rule:
the FrameMaker Online
element "tfoot" is fm table footing element "TableFoot";
Manuals folder.
• On the next line, type the following rule:
element "trow" is fm table row element "TableRow";
• On the next line, type the following rule:
element "tentry" is fm table cell element "TableCell";
6. Enter a read/write rule to map an element, its attributes, and its attribute values
between XML and Structured FrameMaker. The attribute value rules are nested in
subrules. No semicolon is used with the main rule when a subrule follows. Subrules
are begun with an open curly brace “{” and ended with a close curly brace “}”.
Tip For more • On the next lines, type the following rules for the “Head” element and its “Id”
information on creating attribute:
read/write subrules, see element "head"
Chapter 13, “Rule {
syntax,” in is fm element "Head";
Structure_Dev_
attribute "id" is fm attribute "Id";
Guide.pdf, located in
}
the FrameMaker Online
Manuals folder. 7. Enter a read/write rule to map an element, its attributes, and attribute values between
XML and Structured FrameMaker. This read/write requires subrules.
• On the next lines, type the following rules for the “Chapter” element, the
“AuthorName” attribute, and the “Version” attribute values:
element "chapter"
{
is fm element "Chapter";
attribute "names" is fm attribute "AuthorName";
attribute "version"
{
is fm attribute "Version";
value "1" is fm value "1st Draft";
value "2" is fm value "2nd Draft";
value "3" is fm value "3rd Draft";
value "4" is fm value "Final";
}
}
read/write rules that contain more than one action require that the rule be broken into
subrules as indicated in the “Chapter” rules.
10. Continue to create read/write rules following the remaining steps in this section, or
close your current ChapterReadWriteRules.fm, and replace it with the completed
version located in the “Completed” folder.
11. Enter a read/write rule to map a graphic element between XML and Structured
FrameMaker. This rule will include mappings for TIFF and SVG graphic export
(facet writer rules).
Tip For more • On the next lines, type the following rules for the “Graphic” element and its
information on creating attributes:
read/write rules to map element "graphic"
graphic elements, see {
Chapter 18, is fm graphic element "Graphic";
“Translating Graphics
attribute "type"
and Equations,” in
{
Structure_Dev_
Guide.pdf, located in is fm attribute "Type";
the FrameMaker Online value "byreference" is fm value "ByReference";
Manuals folder. value "bycopy" is fm value "ByCopy";
}
attribute "format" is fm attribute "Format";
attribute "entityref" is fm property entity;
attribute "fileref" drop;
attribute "filename" drop;
attribute "entity" drop;
writer facet "TIFF"
{
specify size in pt;
export to file "$(entity).jpg" as "JPEG";
convert referenced graphics;
}
writer facet "SVG"
{
specify size in pt;
export to file "$(docname).svg" as "SVG";
}
}
12. Enter a read/write rule to map a table element and its attributes between XML and
Structured FrameMaker.
Tip For more • On the next lines, type the following rule for the “Table” element and its
information on creating attributes. The rule specifies that the name of the FrameMaker table style
read/write rules to map will be preserved as the attribute “Tablestyle” in the XML document:
table elements and element "table"
attributes, see Chapter {
17, “Translating
is fm table element "Table";
Tables,” in
attribute "colsep" is fm property column ruling;;
Structure_Dev_
Guide.pdf, located in attribute "rowsep" is fm property row ruling;
the FrameMaker Online attribute "tablestyle" is fm property table format;
Manuals folder. }
13. Enter a read/write rule to map an index marker between XML and Structured
FrameMaker.
Tip For more • On the next lines, type the following rule for the “Index” element. The rule
information on creating specifies that the index marker text will be treated as an attribute in the XML
read/write rules to map document:
markers, see Chapter 21, element "indexentry"
“Translating Markers,” {
in Structure_Dev_
is fm marker element "IndexEntry";
Guide.pdf, located in
marker text is attribute;
the FrameMaker Online
Manuals folder. }
14. Enter a read/write rule to map the “Caption” element.
• On the next lines, type the following rule for the “Caption” element:
element "caption" is fm element "Caption";
15. Enter a read/write rule to map a cross-reference marker between XML and Structured
FrameMaker.
• On the next lines, type the following rule for the “CrossReference” element:
element "crossreference"
{
is fm cross-reference element "CrossReference";
attribute "referenceId" is fm property cross-reference
id;
}
16. Enter a read/write rule to tell Structured FrameMaker how to reference the XML
DTD in the XML instance when it is created.
Tip For more • On the next lines, type the following rule for referencing the dtd when
information on creating exporting XML from Structured FrameMaker:
read/write rules to writer external dtd is system "Chapter.dtd";
manage the import and
17. Save ChapterReadWriteRules.fm.
export process, see
Chapter 16, • Choose the File>Save command.
“Translating Entities Leave ChapterReadWriteRules.fm open.
and Processing
Instructions,” in
Structure_Dev_
Guide.pdf located in
the FrameMaker Online
Manuals folder.
Enabling Namespaces
XML uses Namespaces to differentiate between XML coming from different DTDs or
Schemas. A Namespace qualifies element names with a Namespace prefix, for example,
ns:element.
So, for example, if you have a table element in both a furniture catalog and an XHTML
file, you could use the qualified elements furniture:table and xhtml:table in your
document, so you would know from which DTD or schema each arose. In this way,
Namespaces prevent names from “colliding.” More importantly they identify and
differentiate XML applications such as XSLT, SVG, VoiceXML, and any XML
applications that you create yourself.
Insertion point
Namespace enabled
This setting in the structapps.fm file is to prepare Structured FrameMaker for XML
import and export. An upcoming lesson in the XML Cookbook will take you through
the steps to assign a Namespace to a Structured FrameMaker element.
Document Schemas
The Element Definition Document—better known as the EDD—controls the order and
use of the elements in your structured documents. The EDD is like an XML DTD or
Schema, or an SGML DTD, but it is expressed in Structured FrameMaker using elements.
EDDs contain element and attribute definitions similar to those in a DTD, but it can also
include formatting rules.
There are two easy ways to fix this file location problem: 1) Create a separate XML
application to be used only when opening DTDs; or 2) Place a copy of the DTD in a
folder that is appropriate for your XML application. For the XML Cookbook you will
make a copy of the DTD and place it in the “Practice” folder.
For Windows:
• Use Unix commands to copy Chapter.dtd from the “App” directory to the
“Practice” directory.
37
Document Schemas
Make sure that you choose Chapter.dtd in the “Practice” folder and not the “App”
folder. If you do choose the wrong copy of the DTD, Structured FrameMaker will
generate an error saying that it can not locate the ChapterReadWriteRules.fm file.
This is because the Structured FrameMaker structapps.fm application rule for
38
Document Schemas
locating the read/write rules file refers to the “App” folder at the same level as the file
that is being opened or imported.
39
Document Schemas
If you have trouble opening the DTD and would like to skip to the next section of the
XML Cookbook, you can use the completed EDD located in the Completed folder.
Copy ChapterEDD.fm from the “Completed” folder to the “App” folder.
The new EDD appears.
Structured FrameMaker includes your application name at the beginning of the EDD.
Notice that the EDD elements and attributes reflect the mappings that you created in
your read/write rules document.
Application name
Notice that the name of the application has been set to “TechPubs.”
40
Document Schemas
Collapsed element
Expanded element
41
Document Schemas
• To expand elements, in the element’s bubble, to the left of the element name, click
once on the plus (+) symbol to expand and once on the minus (-) symbol to collapse
an element.
Expand symbol
Collapse symbol
TABLE 1.
Symbol Meaning
This element is Valid at the current location
This element is valid in the current element, however inserting it will make ele-
ments after it invalid
42
Document Schemas
The EDD is a structured document. You will edit it with the document’s element
boundaries turned on and the Element Catalog and Structure View open.
1. Turn on Element Boundaries and open the Element Catalog and Structure View.
• Choose the View>Element Boundaries command.
• Choose the Element>Element Catalog command.
• Click the Structure View icon located in the top right-hand corner of the
document window.
When Structured FrameMaker converts a DTD, the first element encountered in the
DTD is assumed to be the root element. In the EDD, notice that the “Chapter”
element has already been defined as “Valid at Highest Level.”
You can modify the EDD to correct any conversion errors or to change elements for which
you did not create read/write rules. For example, the “IndexEntry” element in your EDD
needs to have its marker type identified.
1. Edit the “IndexEntry” element definition to add an index marker type.
Tip For information on • Locate the “IndexEntry” element.
defining markers in an
EDD, see Chapter 11,
“Setting a marker type,”
in Structure_Dev_
Guide.pdf, located in
the FrameMaker Online
Manuals folder.
• Click to the right of the “Marker” element.
Insertion point
43
Document Schemas
44
Document Schemas
2. Edit the “FirstUse” element to define it as a text range element. For this exercise, you
will use the “AllContextsRule” element that will be defined later.
Tip For information on • Locate the “FirstUse” element.
defining All Context
Rules and specific
Context Rules in an
EDD, see Chapter 9,
“All-context Rules and
Context-specific rules,”
in Structure_Dev_
Guide.pdf, located in
the FrameMaker Online
Manuals folder.
• Click after the “GeneralRule” element.
Insertion point
45
Document Schemas
Adding Auto-Insertions
Structured FrameMaker elements can have their first child element automatically inserted.
Structured FrameMaker allows you to define as many levels of insertion for child
elements as you need. This saves the step of the author having to select the child element
from the element catalog—the child element and the insertion point will automatically
appear when the parent element is inserted.
Tip For information on In this exercise you will define auto-insertions for the “Chapter”, “TopicPara”, “Section”,
defining auto-insertion and “Figure” elements.
rules in an EDD, see
Chapter 8, “Inserting
descendants
automatically in
containers,” in
Structure_Dev_
Guide.pdf, located in
the FrameMaker Online
Manuals folder.
46
Document Schemas
47
Document Schemas
• Click at the end of the “Container” element (after the “GeneralRule” and
“AttributeList” elements.
Insertion point
• Type Head
48
Document Schemas
There are several methods you can use to specify formatting characteristics for elements:
• Reference paragraph and character styles in the document’s template.
• Specify one or more formatting characteristics in the EDD.
• Define an arbitrary group of formatting characteristics, give it a name, and reference
it.
Tip Elements inherit Element Paragraph Formatting: Paragraph formats (styles) can be assigned to elements.
formats from their parent When the element is inserted by the author, it is automatically formatted with the
elements except where paragraph tag.
the element references a
paragraph or character 1. Associate the “TopicHead” paragraph format with the “TopicHead” element.
style; therefore, it may • Locate the “TopicHead” element.
not be necessary to
define formatting for all
elements. To realize the
greatest benefit of format
inheritance, try to
associate paragraph
formats only to the
higher level elements.
For information on
defining element • Click after the “GeneralRule” element.
paragraph format rules
in an EDD, see Chapter
9, “Paragraph
formatting,” in
Structure_Dev_
Guide.pdf, located in Insertion point
the FrameMaker Online
Manuals folder.
49
Document Schemas
• Type TopicHead
50
Document Schemas
51
Document Schemas
Insertion point
52
Document Schemas
• Type FirstUse
53
Document Schemas
Collapsed element
Insertion point
54
Document Schemas
55
Document Schemas
56
Document Schemas
57
Document Schemas
• Type HeadingColor
58
Document Schemas
• Type 5pt
• Click after the “ParagraphSpacing” element.
• Insert a “LineSpacing” element.
• Insert a “Height” element.
• Type 13pt
3. Save your changes.
• Choose the File>Save command.
Context Formatting: Context Formatting Rules apply formatting to an element when it
falls in a specific context in the element hierarchy. Formatting can be applied by either
associating a paragraph format or defining specific property values.
1. Define a context rule for the “Para” element so that the first paragraphs of a “Chapter”
are italicized.
• Locate the “Para” element.
Collapsed element
59
Document Schemas
Insertion point
• Type Chapter
• Click below the “Specification” element.
• Insert a “ParagraphFormatting” element.
• Insert a “PropertiesFont” element.
• Insert an “Angle” element.
The “Italic” element is automatically inserted.
60
Document Schemas
Tip For information on 1. Define context rules for four levels of the “Head” element.
defining level format • Locate the “Head” element.
rules in an EDD, see
Chapter 9, “Level
rules,” in
Structure_Dev_
Guide.pdf, located in
the FrameMaker Online
Manuals folder.
Collapsed
element
Insertion point
61
Document Schemas
62
Document Schemas
Insertion point
63
Document Schemas
• Type 1
Insertion point
64
Document Schemas
• Type Level1
65
Document Schemas
Insertion point
66
Document Schemas
67
Document Schemas
68
Document Schemas
69
Document Schemas
70
Document Schemas
Tip For information on 1. Modify the “TopicPara” element to include the prefix characters “->”
defining prefix and suffix • Locate the “TopicPara” element.
formatting rules in an
EDD, see Chapter 9,
“Defining prefixes and
suffixes,” in
Structure_Dev_
Guide.pdf, located in
the FrameMaker Online
Manuals folder.
Insertion poin
71
Document Schemas
72
Document Schemas
• Type ->
73
Document Schemas
74
Document Schemas
First and Last Paragraph Formatting: Formatting rules can be defined to specify
formatting to the first and last paragraph contained in an element.
Tip For information on 1. Modify the “TopicList” element to add extra space above the first, and below the last
defining first and last paragraphs in list.
formatting rules in an
• Locate the “TopicsList” element.
EDD, see Chapter 9,
“Writing first and last • Click after the “GeneralRule” element.
formatting rules,” in • Insert a “FirstParagraphRules” element.
Structure_Dev_
• Insert an “AllContextsRule” element.
Guide.pdf, located in
the FrameMaker Online Set the Basic Properties.
Manuals folder.
• Insert a “ParagraphFormatting” element.
• Insert a “PropertiesBasic” element.
• Insert a “ParagraphSpacing” element.
• Insert a “SpaceAbove” element.
• Type 12pt
• Click after the “FirstParagraphRules” element.
• Insert a “LastParagraphRules” element.
• Insert an “AllContextsRule” element.
• Insert a “ParagraphFormatting” element.
Set the Basic Properties.
75
Document Schemas
with text or objects and can control certain behaviors of Structured FrameMaker. For
example, a graphic element can be pasted or imported into an anchored frame, and an
attribute value can control how Structured FrameMaker prompts the user to either import a
graphic or to create an anchored frame.
Tip For information on 1. Modify the “Graphic” element to either display the Import Graphic dialog box or the
defining context Anchored Frame dialog box according to which attribute value the user selects.
formatting rules that use
• Locate the “Graphic” element.
attribute values in an
EDD, see Chapter 9, • Click after the “AttributesList” element.
“Writing context- • Insert an “InitialObjectFormat” element.
dependent format rules,”
• Insert a “AllContextsRule” element.
in Structure_Dev_
Guide.pdf, located in • Insert an “AnchoredFrame” element.
the FrameMaker Online 2. Save your changes.
Manuals folder.
• Choose the File>Save command.
76
Document Schemas
4. If errors occur, review them in the Element Catalog Manager Report and correct them
in the EDD. Repeat Step 2 to import the EDD into the template.
5. Save ChapterTemplate.fm.
• Choose the File>Save command.
6. Close ChapterTemplate.fm.
• Choose the File>Close command.
77
Document Schemas
78
Reading an XML Instance
We have set all of the properties necessary to open an XML instance. Your
structapps.fm file should now have the following application settings:
• Namespace—Enabled
• DOCTYPE—for Chapter and Section.
79
Reading an XML Fragment
Insertion point
80
Reading an XML Fragment
• For Windows and Unix, in the Unknown File Type dialog box, select XML,
and click the Convert button.
81
Reading an XML Fragment
Notice that the “Section” element has an asterisk at the end of its name. This indicates
that this element has a namespace associate with it.
Namespace indicator
• In the Structure View, select the “Section” element with the Namespace
reference.
82
Reading an XML Fragment
83
Reading an XML Fragment
Tip When importing text • Navigate to your “Practice” folder, select ColorSection2.xml, turn on Copy
or graphics into a into Document, and click Import.
FrameMaker or
Structured FrameMaker
document, choose Import
By Reference if you want
to keep a link to the
external file or Copy Into
Document if you want to
import a copy. A
referenced object cannot
be edited in the
FrameMaker or
Structured FrameMaker
document.
• For Windows and Unix, in the Unknown File Type dialog box, select XML,
and click the Convert button.
84
Structured Authoring
Structured Authoring
Structured FrameMaker provides you with a full set of authoring and editing features to
create simple and complex technical and business documents. The skills you’ve developed
so far in setting up your XML Application are the same skills you will use to author and
edit content.
Editing Documents
When creating and editing content in Structured FrameMaker, you use the Structure View
to help navigate and manage the structure of your document, and you use the Element
Catalog to guide you when inserting or moving elements as you work.
1. Open ColorDoc.fm if it is not already open.
2. Open the Element Catalog and Structure View. You may optionally turn on element
boundaries.
Editing Attributes
The Chapter element has an “AuthorName” attribute, which is required but has not yet
been entered. Editing attributes is easy with the Attribute Editor.
1. Enter your name in the “AuthorName” attribute.
• In the Structure View, click on the “Chapter” element.
• Click on the Attributes Editor icon located at the top right corner of the
document window.
Attribute Editor
85
Structured Authoring
Notice that the new value has appeared next to the “AuthorName” attribute in the
Structure View.
86
Structured Authoring
Missing element
A vertical dotted line appears from the location of the misplaced element. Move the
invalid element to a new position or insert elements around the element to correct the
error.
Beginning of misplaced
element
87
Structured Authoring
1. In the Structure View, set the insert point before the first “Section” element.
Insertion point
Tip The Element Notice that the Element Catalog immediately refreshes to display the next set of valid
Catalog view can be elements and that “Section” is valid in this location.
customized using the
Options button. Initially,
Valid elements
the displayed elements
are strictly valid.
88
Structured Authoring
2. In the Element Catalog select “Section” and click the insert button.
Head element is
automatically
inserted
Also notice that the Structure View indicates missing elements with a red square hole.
Missing elements
89
Structured Authoring
90
Structured Authoring
• Enter the following values and choices in the Anchored Frame dialog
window:
Element Tag: Graphic
Anchoring Position: Below Current Line
Alignment: Left
Cropped: Off
Floating: Off
Size: Width: 246 pt.
Size: Height: 94 pt.
• Click the New Frame button.
An anchored frame is inserted.
91
Structured Authoring
Tip Scalable Vector • In the Import SVG dialog, click the Set button.
Graphics (SVG) are
imported and rasterized
for view, PDF, and
printing from
FrameMaker.
FrameMaker also stores
the SVG XML markup
with the graphic so that
the graphic can be
exported to XML in the
The SVG graphic is imported into the anchored frame.
original SVG format.
92
Structured Authoring
Double-click on
Format attribute to
edit it
Attribute Value
drop-down menu
SVG format
Attribute value
entered
93
Structured Authoring
Set Value
Type attribute
selected
ByReference
attribute value
94
Structured Authoring
Set Value
Done button
95
Structured Authoring
• Enter the following values and choices in the Anchored Frame dialog
window:
Element Tag: Graphic
Anchoring Position: Below Current Line
Alignment: Left
Cropped: Off
Floating: Off
Size: Width: 246 pt.
Size: Height: 94 pt.
• Click the New Frame button.
An anchored frame is inserted.
96
Structured Authoring
• Enter the following values and choices in the Anchored Frame dialog
window:
Element Tag: Graphic
Anchoring Position: Below Current Line
Alignment: Left
Cropped: Off
Floating: Off
Size: Width: 246 pt.
Size: Height: 94 pt.
• Click the New Frame button.
An anchored frame is inserted.
97
Structured Authoring
Set button
98
Structured Authoring
• Enter the following values and choices in the Anchored Frame dialog
window:
Element Tag: Graphic
Anchoring Position: Below Current Line
Alignment: Left
Cropped: Off
Floating: Off
Size: Width: 246 pt.
Size: Height: 94 pt.
• Click the New Frame button.
An anchored frame is inserted.
99
Structured Authoring
• Enter the following values and choices in the Anchored Frame dialog
window:
Element Tag: Graphic
Anchoring Position: Below Current Line
Alignment: Left
Cropped: Off
Floating: Off
Size: Width: 246 pt.
Size: Height: 94 pt.
• Click the New Frame button.
An anchored frame is inserted.
100
Structured Authoring
• Enter the following values and choices in the Anchored Frame dialog
window:
Element Tag: Graphic
Anchoring Position: Below Current Line
Alignment: Left
Cropped: Off
Floating: Off
Size: Width: 246 pt.
Size: Height: 94 pt.
• Click the New Frame button.
An anchored frame is inserted.
101
Structured Authoring
Insertion
point
102
Structured Authoring
Insertion point
Elements (in
Document Order)
list
103
Structured Authoring
Insert button
Cross-reference
attribute value
Insertion point
• From the Element Catalog, insert a “TopicPara” element.
• In the Cross-Reference dialog window, select “Head(Level2)” in the Element
Tags list.
• In the Cross-Reference dialog window, select “Printing terminology” in the
Elements (in Document Order) list.
• In the Cross-Reference dialog window, click the Insert button.
• In the Structure View, click below the last “TopicPara” element.
• From the Element Catalog, insert a “TopicPara” element.
104
Structured Authoring
105
Structured Authoring
106
Writing an XML Instance
107
Writing XML with a CSS2 Stylesheet
108
Writing XML with an XSL Stylesheet
109
Writing XML with an XSL Stylesheet
Adobe, the Adobe logo, and FrameMaker are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States
and/or other countries. Windows is either a registered trademark or trademark of Microsoft Corporation in the United States and/or other countries.
Macintosh is a trademark of Apple Computer, Inc., registered in the United States and other countries. UNIX is a registered trademark of
The Open Group. © 2002 Adobe Systems Incorporated. All rights reserved.
110