mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
BugReport: Fix incorrect XML closing tag syntax generated by XmlDocumentEx (#42399)
## Summary of the Pull Request The `XmlDocumentEx::Print` method previously used `<\\` to close XML tags, which is invalid. This commit replaces `<\\` with `</` to ensure proper XML closing tag syntax. Changes include: - Replacing `<\\` with `</` in three instances where closing tags are generated. - Ensuring the XML output conforms to standard XML syntax. These changes improve the correctness of the XML output generated by the method. <img width="1014" height="499" alt="image" src="https://github.com/user-attachments/assets/a9ff6e47-6976-4290-a4f0-c23b0c773d61" /> <!-- Please review the items on the PR checklist before submitting--> ## PR Checklist - [x] Closes: #42390 - [x] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [x] **Tests:** Added/updated and all pass - [x] **Localization:** All end-user-facing strings can be localized - [x] **Dev docs:** Added/updated - [x] **New binaries:** Added on the required places - [x] **Documentation updated:** <!-- Provide a more detailed description of the PR, other things fixed, or any additional comments/features here --> ## Detailed Description of the Pull Request / Additional comments <!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well --> ## Validation Steps Performed
This commit is contained in:
committed by
Gleb Khmyznikov
parent
e556d8ad7d
commit
b2a2d85c74
@@ -19,13 +19,13 @@ void XmlDocumentEx::Print(winrt::Windows::Data::Xml::Dom::IXmlNode node, int ind
|
||||
PrintTagWithAttributes(node);
|
||||
if (!node.HasChildNodes())
|
||||
{
|
||||
stream << L"<\\" << node.NodeName().c_str() << ">" << std::endl;
|
||||
stream << L"</" << node.NodeName().c_str() << ">" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
if (node.ChildNodes().Size() == 1 && !node.FirstChild().HasChildNodes())
|
||||
{
|
||||
stream << node.InnerText().c_str() << L"<\\" << node.NodeName().c_str() << ">" << std::endl;
|
||||
stream << node.InnerText().c_str() << L"</" << node.NodeName().c_str() << ">" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ void XmlDocumentEx::Print(winrt::Windows::Data::Xml::Dom::IXmlNode node, int ind
|
||||
{
|
||||
stream << " ";
|
||||
}
|
||||
stream << L"<\\" << node.NodeName().c_str() << ">" << std::endl;
|
||||
stream << L"</" << node.NodeName().c_str() << ">" << std::endl;
|
||||
}
|
||||
|
||||
void XmlDocumentEx::PrintTagWithAttributes(winrt::Windows::Data::Xml::Dom::IXmlNode node)
|
||||
|
||||
Reference in New Issue
Block a user