This function gets the DOM node for the tag that is currently selected in the Tag Selector bar at the bottom of the document window.
This function checks the VTM files to see if a tag editor has been defined for the tag. If so, the editor for that tag pops up and accepts the start tag. If not, the start tag is inserted unmodified into the user’s document.
Given the URL of a filename.vtm file, this function returns the DOM for that file, so that its contents can be edited.This function should be called only when the Tag Library editor is active.
The fileURL argument is the URL of a filename.vtm file, relative to the Configuration/Tag Libraries folder, as shown in the following example: "HTML/img.vtm"
A string: the name of the library that is currently selected in the Tag Library editor; returns an empty string if no library is selected.
If an attribute node is currently selected, this function gets the name of the tag that contains the attribute.
A string: the name of the tag that is currently selected in the Tag Library editor; returns an empty string if no tag is selected.
The fileURL argument is the path to DTD or schema file, in local URL format.
The Prefix argument is the prefix string that should be added to all tags in this tag library.
Array of tagInfo objects.
A taginfo object contains information about a single tag that is included in the tag library. The following properties are defined in a tagInfo object:
The tagName property, which is a string
The attributes property, which is an array of strings. Each string is the name of an attribute that is defined for this tag.
The following example shows that using the dw.tagLibrary.getImportedTagList() function can get an array of tags from the libName library:
// "fileURL" and "prefix" have been entered by the user. // tell the Tag Library to Import the DTD/Schema var libName = dw.tagLibrary.importDTDOrSchema(fileURL, prefix); // get the array of tags for this library // this is the TagInfo object var tagArray = dw.tagLibrary.getImportedTagList(libName); // now I have an array of tagInfo objects. // I can get info out of them. This gets info out of the first one. // note: this assumes there is at least one TagInfo in the array. var firstTagName = tagArray.name; var firstTagAttributes = tagArray.attributes; // note that firstTagAttributes is an array of attributes.