Path: redb-route/redb.Route/Expressions/Tokenizers/XmlTokenizer.cs
Snapshot: redb-route, development snapshot 2026-12-06. This is the development state of the public mirrors; it may differ from the published packages.
License: Apache-2.0. Repository: https://github.com/redbase-app/redb-route
Page: https://redbase.app/src/dev-2026-12-06/redb-route/redb.Route/Expressions/Tokenizers/XmlTokenizer.cs
----
using System.Runtime.CompilerServices;
using System.Xml;
namespace redb.Route.Expressions.Tokenizers;
///
/// Splits XML body content by extracting elements matching the given local name.
/// Uses async for streaming parse with XXE protection.
///
internal static class XmlTokenizer
{
/// Tokenizes XML body by extracting elements with the given name.
/// Exchange body (Stream, string, or byte[]).
/// Local name of the elements to extract.
/// Optional parent element name whose namespaces should be injected.
/// Cancellation token.
internal static async IAsyncEnumerable