C# Class SimpleFramework.Xml.Stream.PrefixResolver

The PrefixResolver object will store the namespaces for an element. Each namespace added to this map can be added with a prefix. A prefix is added only if the associated reference has not been added to a parent element. If a parent element has the associated reference, then the parents prefix is the one that will be returned when requested from this map.
Inheritance: NamespaceMap
Afficher le fichier Open project: ngallagher/simplexml

Méthodes publiques

Méthode Description
Get ( String reference ) : String

This acquires the prefix for the specified namespace reference. If the namespace reference has been set on this node with a given prefix then that prefix is returned, however if it has not been set this will search the parent elements to find the prefix that is in scope for the specified reference.

Iterator ( ) : String>.KeyCollection.Enumerator.System.Collections.Generic.Dictionary

This returns an iterator for the namespace of all the nodes in this NamespaceMap. This allows the namespaces to be iterated within a for each loop in order to extract the prefix values associated with the map.

PrefixResolver ( OutputNode source ) : System

Constructor for the PrefixResolver object. This is used to create a resolver for namespace prefixes using the hierarchy of elements. Resolving the prefix in this way avoids having to redeclare the same namespace with another prefix in a child element if it has already been declared.

Put ( String reference ) : String
Put ( String reference, String prefix ) : String

This is used to add the namespace reference to the namespace map. If the namespace has been added to a parent node then this will not add the reference.

Remove ( String reference ) : String

This is used to remove the prefix that is matched to the given reference. If no prefix is matched to the reference then this will silently return. This will only remove mappings from the current map, and will ignore the parent nodes.

Resolve ( String reference ) : String

This method will resolve the prefix or the specified reference by searching the parent nodes in order. This allows the prefix that is currently in scope for the reference to be acquired.

Method Details

Get() public méthode

This acquires the prefix for the specified namespace reference. If the namespace reference has been set on this node with a given prefix then that prefix is returned, however if it has not been set this will search the parent elements to find the prefix that is in scope for the specified reference.
public Get ( String reference ) : String
reference String /// the reference to find a matching prefix for ///
Résultat String

Iterator() public méthode

This returns an iterator for the namespace of all the nodes in this NamespaceMap. This allows the namespaces to be iterated within a for each loop in order to extract the prefix values associated with the map.
public Iterator ( ) : String>.KeyCollection.Enumerator.System.Collections.Generic.Dictionary
Résultat String>.KeyCollection.Enumerator.System.Collections.Generic.Dictionary

PrefixResolver() public méthode

Constructor for the PrefixResolver object. This is used to create a resolver for namespace prefixes using the hierarchy of elements. Resolving the prefix in this way avoids having to redeclare the same namespace with another prefix in a child element if it has already been declared.
public PrefixResolver ( OutputNode source ) : System
source OutputNode /// this is the XML element this is associated to ///
Résultat System

Put() public méthode

public Put ( String reference ) : String
reference String /// this is the reference to be added ///
Résultat String

Put() public méthode

This is used to add the namespace reference to the namespace map. If the namespace has been added to a parent node then this will not add the reference.
public Put ( String reference, String prefix ) : String
reference String /// this is the reference to be added ///
prefix String /// this is the prefix to be added to the reference ///
Résultat String

Remove() public méthode

This is used to remove the prefix that is matched to the given reference. If no prefix is matched to the reference then this will silently return. This will only remove mappings from the current map, and will ignore the parent nodes.
public Remove ( String reference ) : String
reference String /// this is the reference that is to be removed ///
Résultat String

Resolve() public méthode

This method will resolve the prefix or the specified reference by searching the parent nodes in order. This allows the prefix that is currently in scope for the reference to be acquired.
public Resolve ( String reference ) : String
reference String /// the reference to find a matching prefix for ///
Résultat String