Interface IXmlPropertySet2
- Namespace
- ESRI.ArcGIS.Geodatabase
- Assembly
- ESRI.Server.Geodatabase.dll
Provides access to members that manage metadata.
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("01700025-EF62-47E3-BD1E-7A47D0696541")]
public interface IXmlPropertySet2
Remarks
When using this interface on a newly-created XmlPropertySet, the InitGeneric method should be called. See the XmlPropertySet coclass documentation for more information.
Properties
CountX[string]
Number of occurrances of an element in the metadata.
int CountX[string Name] { get; }
Parameters
Namestring
Property Value
Remarks
Documentation for this property can be found at the IXmlPropertySet::CountX description.
IsNew
Indicates if a new XmlPropertySet was created on retrieving the metadata.
bool IsNew { get; }
Property Value
Remarks
Documentation for this property can be found at the IXmlPropertySet::IsNew description.
OverwriteSyncAttribute
Indicates if the Sync attribute will be ignored when setting an element's value.
bool OverwriteSyncAttribute { get; set; }
Property Value
Remarks
By default the OverwriteSyncAttribute property is set to false. If the property is changed it remains true for the time the object is held in memory. Once the object is released, the OverwriteSyncAttribute is set back to false.
The OverwriteSyncAttribute property is set for an entire property set and not individual properties.
When the property is set to true, the syncing parameter used and the SetPropertyX methods is ignored. The SetPropertyX action, determined by the esriXmlSetPropertyAction, is then carried out. Otherwise if the OverwriteSyncAttribute property remains false, the esriXmlSetPropertyAction and value of the syncing parameter in the SetPropertyX determine the action.
A complete understanding of the syncing parameter is recommended when setting and getting the OverwriteSyncAttribute property. See the documentation for IXmlPropertySet.SetPropertyX for more information.
Methods
DeleteProperty(string)
Deletes the specified elements.
void DeleteProperty(string Name)
Parameters
Namestring
Remarks
Documentation for this property can be found at the IXmlPropertySet::DeleteProperty description.
DeletePropertyByAttribute(string, string, bool)
Deletes the elements which have the specified attribute value.
void DeletePropertyByAttribute(string Attribute, string Value, bool deleteParent)
Parameters
Remarks
Documentation for this property can be found at the IXmlPropertySet::DeletePropertyByAttribute description.
DeletePropertyByNameAndAttribute(string, string, string, bool)
Deletes the specified elements which have the specified attribute value.
void DeletePropertyByNameAndAttribute(string Name, string Attribute, string Value, bool deleteParent)
Parameters
Remarks
The DeletePropertyByNameAndAttribute method provides additional parameters to delete XML elements and their corresponding values from metadata documents. Similar actions can be accomplished through other methods (DeleteProperty, DeletePropertyByAttribute) and XPath strings. For instance the following lines of pseudocode accomplish the same action;
xmlPropertySet.DeletePropertyByNameAndAttribute("idinfo/keywords/theme/themekey", "new", "yes", False)
xmlPropertySet.DeleteProperty("idinfo/keywords/theme/themekey[@new='yes']")
The Name parameter uses XPath to describe the location and condition of XML nodes in metadata. More information on XPath can be found at the IXmlPropertySet documentation.
If children elements of the specified Name parameter exist, the DeletePropertyByNameAndAttribute method will also remove them from the XML Document.
The Attribute parameter must contain a valid string character. Otherwise the DeleteProperty method should be used for deleting elements without having to specify attributes.
By setting the attribute Value parameter to "", all elements that match the Name and Attribute parameter will be deleted. The DeletePropertyByAttribute method should be used to delete elements without specifying attribute values.
The deleteParent parameter is a Boolean expression that indicates if the parent element of the Name parameter should be deleted. Special attention should be made to this parameter when deleting a Thumbnail or Binary Enclosure. The parent of the Thumbnail element is the Enclosure element, which also happens to be a parent element of the Data element that holds the Binary information. If deleteParent is set to true when specifying the Data or Thumbnail tag, all Enclosures information will be removed.
GetAttribute(string, string, out object)
Returns the set of values for the specified attribute from the specified elements.
void GetAttribute(string Name, string Attribute, out object Value)
Parameters
Remarks
The GetAttribute method returns the attribute value of the specified metadata element.
The Name parameter uses XPath to describe the location and condition of XML nodes in metadata. More information on XPath can be found at the IXmlPropertySet documentation.
The Attribute must contain a valid string. If no string is declared (""), a run time error will occur.
GetPropertiesByAttribute(string, string, bool, out object, out object)
Returns the set of names and values for elements which have the specified attribute value.
void GetPropertiesByAttribute(string Attribute, string Value, bool noValues, out object Tags, out object Values)
Parameters
Remarks
Documentation for this property can be found at the IXmlPropertySet::GetPropertiesByAttribute description.
GetXml(string)
Returns the XML corresponding to the specified element as a string.
string GetXml(string Name)
Parameters
Namestring
Returns
Remarks
The GetXml method returns both the metadata element tag (including attributes/values pairs) and the corresponding value as string.
Specifying an XML element with children nodes will return all children elements and values also.
Because the return variable is of type string, specifying enclosures, images or pictures return the data encoded as Base64 inside of XML tags (unless TransformImages has been called).
If repeating elements are specified, i.e. "idinfo/keywords/theme/themekey", nothing will be returned. More detailed criteria are necessary when specifying the Name parameter. This can be achieved with an XPath query. More information on XPath can be found at the IXmlPropertySet documentation and through documentation below.
InitExisting()
Initializes an XmlPropertySet and adds the Esri group of elements.
void InitExisting()
Remarks
Documentation for this property can be found at the IXmlPropertySet::InitExisting description.
InitGeneric(string)
Initializes an XmlPropertySet without adding the Esri group of elements.
void InitGeneric(string rootName)
Parameters
rootNamestring
Remarks
The InitGeneric method initializes an XmlPropertySet without adding the ESRI group of elements.
This method is available to the XmlProperty CoClass through the IXmlPropertySet2 Interface.
SaveAsFile(string, string, bool, ref string)
Transforms the metadata using an XSL stylesheet if specified, writes out the header if specified, and saves it in a file.
void SaveAsFile(string xslPath, string header, bool outputANSI, ref string outPath)
Parameters
Remarks
Documentation for this property can be found at the IXmlPropertySet::SaveAsFile description.
SetAttribute(string, string, object, esriXmlSetPropertyAction)
Sets the attribute of the specified element.
void SetAttribute(string Name, string Attribute, object Value, esriXmlSetPropertyAction action)
Parameters
NamestringAttributestringValueobjectactionesriXmlSetPropertyAction
Remarks
Documentation for this property can be found at the IXmlPropertySet::SetAttribute description.
SetPropertyX(string, object, esriXmlPropertyType, esriXmlSetPropertyAction, bool)
Sets the value of the specified element.
void SetPropertyX(string Name, object Value, esriXmlPropertyType propType, esriXmlSetPropertyAction action, bool syncing)
Parameters
NamestringValueobjectpropTypeesriXmlPropertyTypeactionesriXmlSetPropertyActionsyncingbool
Remarks
Documentation for this property can be found at the IXmlPropertySet::SetPropertyX description.
SetXml(string)
Replaces existing metadata with the content defined in the XML.
void SetXml(string xml)
Parameters
xmlstring
Remarks
The SetXML method replaces the entire metadata document with the Xml string supplied in the XML parameter.
To target specific XML elements, the SetPropertyX method should be used.
SimpleGetProperty(string)
The values of the specified property.
string SimpleGetProperty(string Name)
Parameters
Namestring
Returns
Remarks
Documentation for this property can be found at the IXmlPropertySet::SimpleGetProperty description.
TransformImages(string, out object)
Transforms encoded thumbnail and image enclosures to files and links them into the metadata.
void TransformImages(string Path, out object fileNames)
Parameters
Remarks
Documentation for this property can be found at the IXmlPropertySet::TransformImages description.