Liquid XML Data Binder (C++, Java, VB6) / Reference / C# and VB .Net (Deprecated - use Liquid XML Objects) / Reference / SerializationContext / .Net NamespaceAliases - SerializationContext
In This Topic
    .Net NamespaceAliases - SerializationContext
    In This Topic
    This feature has been superseded by Liquid XML Objects.
    (The original functionality is still included in the product)
    Use Liquid XML Objects
    NamespaceAliasSettings NamespaceAliases
      Property Description  
        Property Name NamespaceAliases  
        Property Type NamespaceAliasSettings  
        Accessors Read Only  
        Description Returns a NamespaceAliasSettings object containing NamespaceAliasSettings.NamespaceAliasEntry items describing Prefix, NamespaceUri and WriteInRootElement (defaults to true).  
        Remarks

    By default, these namespace declarations will be written at the root level in the document. Setting WriteInRootElement = false will write the namespace declaration at the point it is required.

    The sample shows what you get if an alias "MyAlias", and URI http://sample are added to the collection.

    Example XML
    Copy Code
    <?xml version="1.0"?>
    <MyAlias:Customer xmlns:MyAlias="http://sample" xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" clubCardMember="false">
    
    API
    Copy Code
    public class NamespaceAliasSettings : IEnumerable<NamespaceAliasSettings.NamespaceAliasEntry>
    {
        public bool ContainsPrefix(string? prefix);
        public bool ContainsNamespaceUri(string namespaceUri);
        public string this[string? prefix] { get; set; }
        public void Add(string? prefix, string namespaceUri, bool writeInRootElement = true);
        public void Remove(string? prefix);
        public void Remove(NamespaceAliasEntry entry);
        public void Clear();
        public IEnumerator<NamespaceAliasEntry> GetEnumerator();
    
        public class NamespaceAliasEntry
        {
            public string Prefix { get; }
            public string NamespaceUri { get; }
            public bool WriteInRootElement { get; }
        }
    }