Import error: Attribute "href" must be declared for element type "topicref"
This error occurs when a map has the @href
attribute on a
topicref, which is not allowed in DRM environments.
Description
You receive a message in the Import Errors dialog similar to this:
Unable to import dita file: Unable to import file in the
generic type. [Attribute "href" must be declared for element
type "elementName".] file :
.../.../filename.dita
DRM does not allow the use of @href
on any elements except for
external references (for example, <xref href="www.madcapsoftware.com"
scope=external/>
. All references to content objects—in this case, a
map's reference to a topic—must be done using @keyref
.
Usually, any non-external @href
attributes are automatically
refactored to @keyref
during a content import but an error in the
DTD catalog can prevent this from happening, causing this error. To resolve it, you
need to make a few changes to the DTD catalog.
Solution
- Open the TEXTML Administration perspective and connect to the content store.
- Check out and open system/plugins/com.ixiasoft.dita13.dtd/catalog.xml.
- Find the following
entries:
<public publicId="-//IXIA//ELEMENTS DITA Global Href Constraints//EN" uri="dtd/drm/constraint-href-global.mod"/> <public publicId="-//IXIA//ELEMENTS DITA Topic Href Constraints//EN" uri="dtd/drm/constraint-href-topic.mod"/> <public publicId="-//IXIA//ELEMENTS DITA Map Href Constraints//EN" uri="dtd/drm/constraint-href-map.mod"/>
- Change them
to:
<public publicId="-//IXIA//ELEMENTS DITA Global Href Constraints//EN" uri="dtd/drm/constraint-null.mod"/> <public publicId="-//IXIA//ELEMENTS DITA Topic Href Constraints//EN" uri="dtd/drm/constraint-null.mod"/> <public publicId="-//IXIA//ELEMENTS DITA Map Href Constraints//EN" uri="dtd/drm/constraint-null.mod"/>
- Save your changes and check in catalog.xml.
- Restart the CCMS.