您可以使用标签编辑器插入新标签、编辑现有标签以及访问有关标签的参考信息。标签选择器允许用户整理其标签,以便他们可以轻松选择常用的标签。随 Dreamweaver 提供的标签库存储有关标签的信息,可在基于标准的标记语言和使用最广泛的基于标签的脚本语言中使用这些标签。在需要访问标签编辑器和标签库并在扩展中使用它们时,可以使用 JavaScript 标签编辑器、标签选择器和标签库函数。
// "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[0].name; var firstTagAttributes = tagArray[0].attributes; // note that firstTagAttributes is an array of attributes.