return a string appropriate for inclusion as an XML tag
@param tagName raw string to be encoded
@return encoded tagName
@deprecated use getFormatter().escapeHtml(String)
546096
public static String encodeXMLEntity(final String tagName) {
		StringBuffer encoded = new StringBuffer(tagName);
		//replaceAll(encoded,";","&semi;");
		replaceAll(encoded,"&","&amp;");
		replaceAll(encoded,"\"","&quot;");
		replaceAll(encoded,"'","&apos;");
		replaceAll(encoded,"<","&lt;");
		replaceAll(encoded,">","&gt;");
		return encoded.toString();
	}
132278
public String extractTag(String tag) throws NaaccrIOException {
        if (tag == null)
            throw new NaaccrIOException("missing tag");
        int idx = tag.indexOf(':');
        if (idx != -1) {
            String namespace = tag.substring(0, idx), cleanTag = tag.substring(idx + 1);
            // check for the namespace only if the tag is a default one (Patient, Tumor, etc...) or if extensions are enabled
            if (_configuration.getAllowedTagsForNamespacePrefix(null).contains(cleanTag) || !Boolean.TRUE.equals(_options.getIgnoreExtensions())) {
                Set<String> allowedTags = _configuration.getAllowedTagsForNamespacePrefix(namespace);
                if (allowedTags == null || !allowedTags.contains(cleanTag))
                    throw new NaaccrIOException("tag '" + cleanTag + "' is not allowed for namespace '" + namespace + "'");
            }
            return cleanTag;
        }
        else {
            if (Boolean.TRUE.equals(_options.getUseStrictNamespaces()) && !_configuration.getAllowedTagsForNamespacePrefix(null).contains(tag))
                throw new NaaccrIOException("tag '" + tag + "' needs to be defined within a namespace");
            return tag;
        }
    }
744514
public static Element getElement(Element element, String tagName) {
		final NodeList nodeList = element.getElementsByTagName(tagName);
		if (nodeList == null || nodeList.getLength() < 1) {
			return null;
		}
		int length = nodeList.getLength();
		for (int i = 0; i < length; i++) {
			Element childEle = (Element) nodeList.item(i);
			if (childEle == null || childEle.getParentNode() == element) {
				return childEle;
			}
		}
		return null;
	}
548594
function(tagName, attributes, content) {
      var el = document.createElement(tagName);
      if (attributes) {
        Parse.$(el).attr(attributes);
      }
      if (content) {
        Parse.$(el).html(content);
      }
      return el;
    }
1149773
public <T extends AbstractJaxb> String saveToString(T tag) {
        StringWriter sw = new StringWriter();
        saveToStringWriter(tag, sw);
        return sw.toString();
    }
74877
public function serializeToXml($data, string $tagName = null): string
    {
        return $this->xmlSerializer->serialize($data, $this->xmlStreamWriter, $tagName)
               ->asXml();
    }
1345901
@Deprecated
	public static Tag getTag(Channel channel, String tagName) {
		Collection<Tag> tag = Collections2.filter(channel.getTags(),
				new TagNamePredicate(tagName));
		if (tag.size() == 1)
			return tag.iterator().next();
		else
			return null;
	}
855765
public static Tag exception(Throwable exception) {
		if (exception != null) {
			String simpleName = exception.getClass().getSimpleName();
			return Tag.of("exception", StringUtils.hasText(simpleName) ? simpleName
					: exception.getClass().getName());
		}
		return EXCEPTION_NONE;
	}
138508
@Override
    public String getValue(String xmlName) {
        int index = getIndex(xmlName);

        if (index < 0) {
            return null;
        }
        return getValue(index);
    }
268758
public boolean addPreserveTag(final String tagName) {

        Vector<Attribute> attributeList = new Vector<Attribute>(1);
        Attribute tagNameAttribute = new Attribute();
        tagNameAttribute.setName(tagName.toLowerCase());
        attributeList.add(tagNameAttribute);
        Tag keepTag = m_nodeFactory.createTagNode(null, 0, 0, attributeList);
        boolean result = m_nodeFactory.addTagPreserve(keepTag);
        return result;
    }
262313
function tag(node, tagName){
    var element = get(node) || document;

    if (tagName == '*' && element.all)
      return arrayFrom(element.all);
    else
      return arrayFrom(element.getElementsByTagName(tagName || '*'));
  }
901242
private String getTagName(final XMLEvent event) {

		if (event.isStartElement()) {
			return event.asStartElement().getName().toString();
		}

		if (event.isEndElement()) {
			return event.asEndElement().getName().toString();
		}

		return null;
	}
922717
public function getUrlByTag($tagName)
    {
        if (isset($this->urls[$tagName])) {
            return $this->urls[$tagName];
        } else {
            return null;
        }
    }
1197428
protected static Element getChildElement(final Element parent, final String tagName) {
        List<Element> elements = getElements(parent, tagName);
        if (elements.size() > 0) {
            return elements.get(0);
        } else {
            return null;
        }
    }
102280
@Override
    public String tagValue(String value) {
        String formattedValue = StringEscapeUtils.escapeJson(delegate.tagValue(value));
        return StringUtils.truncate(formattedValue, TAG_VALUE_MAX_LENGTH);
    }
356502
public <T extends Tag> T get(String tagName) {
        return (T) this.value.get(tagName);
    }
373929
public String getTagHtml(Tag tag) {

        StringBuffer result = new StringBuffer(32);
        result.append('<');
        result.append(tag.getText());
        result.append('>');
        return result.toString();
    }