diff --git a/modules/juce_core/xml/juce_XmlElement.cpp b/modules/juce_core/xml/juce_XmlElement.cpp index b8afaf82b2..3e6a2fa954 100644 --- a/modules/juce_core/xml/juce_XmlElement.cpp +++ b/modules/juce_core/xml/juce_XmlElement.cpp @@ -439,6 +439,12 @@ XmlElement* XmlElement::getNextElementWithTagName (StringRef requiredTagName) co return e; } +void XmlElement::setTagName (StringRef newTagName) +{ + jassert (isValidXmlName (newTagName)); + tagName = StringPool::getGlobalPool().getPooledString (newTagName); +} + //============================================================================== int XmlElement::getNumAttributes() const noexcept { diff --git a/modules/juce_core/xml/juce_XmlElement.h b/modules/juce_core/xml/juce_XmlElement.h index 22c497439b..91de12781d 100644 --- a/modules/juce_core/xml/juce_XmlElement.h +++ b/modules/juce_core/xml/juce_XmlElement.h @@ -278,6 +278,11 @@ public: */ bool hasTagNameIgnoringNamespace (StringRef possibleTagName) const; + /** Changes this elements tag name. + @see getTagName + */ + void setTagName (StringRef newTagName); + //============================================================================== /** Returns the number of XML attributes this element contains.