Skip to main content

 Element reference

PSML elements from <author> to <xref>

<placeholder>

Summary

A <placeholder> element is an alternative to “search and replace”, for managing variable text in a publication or document. A valid placeholder is composed of a metadata property at the document or publication level, and the element, inline in the content. 

Resolving the <placeholder> element replaces the “placeholder text” with the value of the metadata property on the publication root document. This allows a user to update many references with a single edit. 

If the document isn’t in a publication, PageSeeder resolves the placeholders from the document’s metadata properties.

Placeholders are only supported in the v6 UI and only for single value properties with a type of text, date or datetime.

Usage context

Element categorycharacter-style
PSML levelportable
Permitted contenttext
Permitted parent
HTML equivalent<var>
OpenXML equivalent

Attributes

This element includes the following attributes:

NameTypeRequiredDescription
namelabelyesMust match the name of the metadata property that contains the placeholder content.
unresolvedbooleannoPresent when the placeholder cannot resolve to a property (fixed value true). Only allowed when the @level attribute on the <document> element has a value of processed.

@name

The name of the metadata property containing the resolved content.

@unresolved="true"

Present when the placeholder cannot be resolved to a property. It is added when the document is processed and only allowed for level="processed".

Examples

A paragraph with a <placeholder> to markup the author.

<para>This book was written by <placeholder name="author">some
writer</placeholder>.</para>

After resolving the <placeholder> with an appropriate property, it would appear as:

<para>This book was written by <placeholder name="author">Lewis Carroll</placeholder>.</para>

If the <placeholder> element could not resolve, because there was no metadata property with the name author, it would appear as:

<para>This book was written by <placeholder name="author"
unresolved="true">some writer</placeholder>.</para>

Schema

XML Schema

<xs:element name="placeholder">
  <xs:complexType>
    <xs:simpleContent>
      <xs:extension  base="xs:string">
        <xs:attribute name="name" type="label" use="required" />                 
        <xs:attribute name="unresolved"
                      type="xs:boolean"
                      fixed="true" />                 
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
</xs:element>

Relax Schema

element placeholder{
   attribute name { label },
   attribute resolved { boolean }?,
   text
}

Compatibility

This element was introduced in PSML v1.1 and is supported in the v6 UI from PageSeeder 5.9712.

Created on , last edited on