Loading XML tags. Adobe InCopy CS6

Add to My manuals
108 Pages

advertisement

Loading XML tags. Adobe InCopy CS6 | Manualzz

XML Scripting XML Elements 100

Rem You can create an XML tag without specifying a color for the tag.

Set myXMLTagA = myDocument.XMLTags.Add("XML_tag_A")

Rem You can define the highlight color of the XML tag using the UIColors enumeration...

Set myXMLTagB = myDocument.XMLTags.Add("XML_tag_B", UIColors.Gray)

Rem ...or you can provide an RGB array to set the color of the tag.

Set myXMLTagC = myDocument.XMLTags.Add("XML_tag_C", Array(0, 92, 128))

Loading XML tags

You can import XML tags from an XML file without importing the XML contents of the file. You might want to do this to work out a tag-to-style or style-to-tag mapping before importing the XML data, as shown in the following script fragment (from the LoadXMLTags tutorial script): myDocument.LoadTags("c:\test.xml")

Saving XML tags

Just as you can load XML tags from a file, you can save XML tags to a file, as shown in the following script.

When you do this, only the tags themselves are saved in the XML file; document data is not included. As you would expect, this process is much faster than exporting XML, and the resulting file is much smaller.

The following sample script shows how to save XML tags (for the complete script, see SaveXMLTags): myDocument.SaveXMLTags("c:\xml_tags.xml", "Tag set created October 5, 2006")

Creating an XML element

Ordinarily, you create XML elements by importing an XML file, but you also can create an XML element using InCopy scripting, as shown in the following script fragment (from the CreateXMLElement tutorial script):

Set myXMLTag = myDocument.XMLTags.Add("myXMLTag")

Set myRootElement = myDocument.XMLElements.Item(1)

Set myXMLElement = myRootElement.XMLElements.Add(myXMLTag) myXMLElement.Contents = "This is an XML element containing text."

Moving an XML element

You can move XML elements within the XML structure using the move

method, as shown in the following script fragment (from the MoveXMLElement tutorial script):

Set myDocument = myInCopy.Documents.Add

Set myXMLTag = myDocument.XMLTags.Add("myXMLTag")

Set myRootElement = myDocument.XMLElements.Item(1)

Set myXMLElementA = myRootElement.XMLElements.Add(myXMLTag) myXMLElementA.Contents = "This is XML element A."

Set myXMLElementB = myRootElement.XMLElements.Add(myXMLTag) myXMLElementB.Contents = "This is XML element B." myXMLElementA.Move idLocationOptions.idAfter, myXMLElementB

Deleting an XML element

Deleting an XML element removes it from both the layout and the XML structure, as shown in the following script fragment (from the DeleteXMLElement tutorial script):

advertisement

Key Features

  • Seamless collaboration between copywriters and designers
  • Copyflow workspace tailored for editorial workflows
  • Effortless integration with InDesign for copy placement and editing
  • Comprehensive text editing and styling capabilities
  • Efficient handling of long-form and complex documents
  • Streamlined copyfitting and typesetting features
  • Advanced typography controls for precise text formatting

Related manuals

Frequently Answers and Questions

Can InCopy be used independently of InDesign?
Yes, InCopy can be used as a standalone application for text editing and styling.
How does InCopy integrate with InDesign?
InCopy seamlessly integrates with InDesign, allowing copywriters to place and edit copy within InDesign page layouts.
What are the benefits of using InCopy for editorial workflows?
InCopy provides a specialized copyflow workspace tailored for editorial workflows, ensuring efficient and collaborative copywriting and editing.
Does InCopy support advanced typography features?
Yes, InCopy offers advanced typography controls for precise text formatting, giving you complete control over the appearance of your text.
Download PDF

advertisement

Table of contents