Liquid XML Data Binder (C++, Java, VB6) / Reference / Java / Reference / com.liquid_technologies.ltxmllib20 / SerializationContext / Java getNamespaceAliases - SerializationContext
In This Topic
    Java getNamespaceAliases - SerializationContext
    In This Topic
    AliasNamespaceDictionary getNamespaceAliases()
      Property Description  
        Property Name DefaultNamespaceURI  
        Property Type AliasNamespaceDictionary  
        Accessors Read Only  
        Description Returns a AliasNamespaceDictionary containing NamespaceAliasEntry items describing Alias, 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 AliasNamespaceDictionary {
        public String getNamespaceURI(String nsAlias) throws LtInvalidParamException;
        public java.util.Set<String> getAliases();
        public java.util.Collection<String> getNamespaces();
        public void add(String nsAlias, String namespaceUri) throws LtInvalidParamException;
        public void add(String nsAlias, String namespaceUri, boolean writeInRootElement) throws LtInvalidParamException;
        public boolean contains(String nsAlias);
        public boolean containsNamespace(String namespaceUri);
        public void remove(String nsAlias) throws LtInvalidParamException;
    
        public class NamespaceAliasEntry {
            public String getAlias();
            public String getNamespaceUri();
            public boolean getWriteInRootElement();
        }
    }