Provides access to members that manage metadata.
Members
Name | Description | |
---|---|---|
![]() |
CountX | Number of occurrances of an element in the metadata. |
![]() |
DeleteProperty | Deletes the specified elements. |
![]() |
DeletePropertyByAttribute | Deletes the elements which have the specified attribute value. |
![]() |
DeletePropertyByNameAndAttribute | Deletes the specified elements which have the specified attribute value. |
![]() |
GetAttribute | Returns the set of values for the specified attribute from the specified elements. |
![]() |
GetPropertiesByAttribute | Returns the set of names and values for elements which have the specified attribute value. |
![]() |
GetXml | Returns the XML corresponding to the specified element as a string. |
![]() |
InitExisting | Initializes an XmlPropertySet and adds the Esri group of elements. |
![]() |
InitGeneric | Initializes an XmlPropertySet without adding the Esri group of elements. |
![]() |
IsNew | Indicates if a new XmlPropertySet was created on retrieving the metadata. |
![]() |
OverwriteSyncAttribute | Indicates if the Sync attribute will be ignored when setting an element's value. |
![]() |
SaveAsFile | Transforms the metadata using an XSL stylesheet if specified, writes out the header if specified, and saves it in a file. |
![]() |
SetAttribute | Sets the attribute of the specified element. |
![]() |
SetPropertyX | Sets the value of the specified element. |
![]() |
SetXml | Replaces existing metadata with the content defined in the XML. |
![]() |
SimpleGetProperty | The values of the specified property. |
![]() |
TransformImages | Transforms encoded thumbnail and image enclosures to files and links them into the metadata. |
IXmlPropertySet2.CountX Property
Number of occurrances of an element in the metadata.
Public Function get_CountX ( _
ByVal Name As String _
) As Integer
public int get_CountX (
string Name
);
Remarks
Documentation for this property can be found at the IXmlPropertySet::CountX description.
IXmlPropertySet2.DeleteProperty Method
Deletes the specified elements.
Public Sub DeleteProperty ( _
ByVal Name As String _
)
public void DeleteProperty (
string Name
);
Remarks
Documentation for this property can be found at the IXmlPropertySet::DeleteProperty description.
IXmlPropertySet2.DeletePropertyByAttribute Method
Deletes the elements which have the specified attribute value.
Public Sub DeletePropertyByAttribute ( _
ByVal Attribute As String, _
ByVal Value As String, _
ByVal deleteParent As Boolean _
)
public void DeletePropertyByAttribute (
string Attribute,
string Value,
bool deleteParent
);
Remarks
Documentation for this property can be found at the IXmlPropertySet::DeletePropertyByAttribute description.
IXmlPropertySet2.DeletePropertyByNameAndAttribute Method
Deletes the specified elements which have the specified attribute value.
Public Sub DeletePropertyByNameAndAttribute ( _
ByVal Name As String, _
ByVal Attribute As String, _
ByVal Value As String, _
ByVal deleteParent As Boolean _
)
public void DeletePropertyByNameAndAttribute (
string Name,
string Attribute,
string Value,
bool deleteParent
);
Remarks
The DeletePropertyByNameAndAttributemethod 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 Nameparameter exist, the DeletePropertyByNameAndAttributemethod****will also remove them from the XML Document.
The Attributeparameter 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 Attributeparameter will be deleted. The DeletePropertyByAttribute method should be used to delete elements without specifying attribute values. ****
The deleteParentparameter 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.
IXmlPropertySet2.GetAttribute Method
Returns the set of values for the specified attribute from the specified elements.
Public Sub GetAttribute ( _
ByVal Name As String, _
ByVal Attribute As String, _
ByRef Value As Object _
)
public void GetAttribute (
string Name,
string Attribute,
ref object Value
);
Description
The Name parameter determines the location of the XML element.
Because XML elements may contain multiple attributes/value pairs, the Attribute parameter is used to specify the attribute.
The Value argument****is returned containing the attribute values.
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.
IXmlPropertySet2.GetPropertiesByAttribute Method
Returns the set of names and values for elements which have the specified attribute value.
Public Sub GetPropertiesByAttribute ( _
ByVal Attribute As String, _
ByVal Value As String, _
ByVal noValues As Boolean, _
ByRef Tags As Object, _
ByRef Values As Object _
)
public void GetPropertiesByAttribute (
string Attribute,
string Value,
bool noValues,
ref object Tags,
ref object Values
);
Remarks
Documentation for this property can be found at the IXmlPropertySet::GetPropertiesByAttribute description.
IXmlPropertySet2.GetXml Method
Returns the XML corresponding to the specified element as a string.
Public Function GetXml ( _
ByVal Name As String _
) As String
public string GetXml (
string Name
);
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.
IXmlPropertySet2.InitExisting Method
Initializes an XmlPropertySet and adds the Esri group of elements.
Public Sub InitExisting ( _
)
public void InitExisting (
);
Remarks
Documentation for this property can be found at the IXmlPropertySet::InitExisting description.
IXmlPropertySet2.InitGeneric Method
Initializes an XmlPropertySet without adding the Esri group of elements.
Public Sub InitGeneric ( _
ByVal rootName As String _
)
public void InitGeneric (
string rootName
);
Remarks
The InitGenericmethod initializes an XmlPropertySetwithout adding the ESRI group of elements.
This method is available to the XmlProperty CoClass through the IXmlPropertySet2 Interface.
IXmlPropertySet2.IsNew Property
Indicates if a new XmlPropertySet was created on retrieving the metadata.
Public ReadOnly Property IsNew As Boolean
public bool IsNew {get;}
Remarks
Documentation for this property can be found at the IXmlPropertySet::IsNew description.
IXmlPropertySet2.OverwriteSyncAttribute Property
Indicates if the Sync attribute will be ignored when setting an element's value.
Public Property OverwriteSyncAttribute As Boolean
public bool OverwriteSyncAttribute {get; set;}
Remarks
By default the OverwriteSyncAttributeproperty 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 OverwriteSyncAttributeis set back to false.
The OverwriteSyncAttributeproperty is set for an entire property set and not individual properties.
When the property is set to true, the syncingparameter**used and the SetPropertyXmethods is ignored. The SetPropertyXaction, determined by the esriXmlSetPropertyAction, is then carried out. Otherwise if the OverwriteSyncAttributeproperty 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 OverwriteSyncAttributeproperty. See the documentation for IXmlPropertySet.SetPropertyX for more information.
IXmlPropertySet2.SaveAsFile Method
Transforms the metadata using an XSL stylesheet if specified, writes out the header if specified, and saves it in a file.
Public Sub SaveAsFile ( _
ByVal xslPath As String, _
ByVal header As String, _
ByVal outputANSI As Boolean, _
ByRef outPath As String _
)
public void SaveAsFile (
string xslPath,
string header,
bool outputANSI,
ref string outPath
);
Remarks
Documentation for this property can be found at the IXmlPropertySet::SaveAsFile description.
IXmlPropertySet2.SetAttribute Method
Sets the attribute of the specified element.
Public Sub SetAttribute ( _
ByVal Name As String, _
ByVal Attribute As String, _
ByVal Value As Object, _
ByVal action As esriXmlSetPropertyAction _
)
public void SetAttribute (
string Name,
string Attribute,
object Value,
esriXmlSetPropertyAction action
);
Remarks
Documentation for this property can be found at the IXmlPropertySet::SetAttribute description.
IXmlPropertySet2.SetPropertyX Method
Sets the value of the specified element.
Public Sub SetPropertyX ( _
ByVal Name As String, _
ByVal Value As Object, _
ByVal propType As esriXmlPropertyType, _
ByVal action As esriXmlSetPropertyAction, _
ByVal syncing As Boolean _
)
public void SetPropertyX (
string Name,
object Value,
esriXmlPropertyType propType,
esriXmlSetPropertyAction action,
bool syncing
);
Remarks
Documentation for this property can be found at the IXmlPropertySet::SetPropertyX description.
IXmlPropertySet2.SetXml Method
Replaces existing metadata with the content defined in the XML.
Public Sub SetXml ( _
ByVal xml As String _
)
public void SetXml (
string xml
);
Remarks
The SetXML method replaces the entire metadata document with the Xml string supplied in the XMLparameter.
To target specific XML elements, the SetPropertyXmethod should be used.
IXmlPropertySet2.SimpleGetProperty Method
The values of the specified property.
Public Function SimpleGetProperty ( _
ByVal Name As String _
) As String
public string SimpleGetProperty (
string Name
);
Remarks
Documentation for this property can be found at the IXmlPropertySet::SimpleGetProperty description.
IXmlPropertySet2.TransformImages Method
Transforms encoded thumbnail and image enclosures to files and links them into the metadata.
Public Sub TransformImages ( _
ByVal Path As String, _
ByRef fileNames As Object _
)
public void TransformImages (
string Path,
ref object fileNames
);
Remarks
Documentation for this property can be found at the IXmlPropertySet::TransformImages description.
Classes that implement IXmlPropertySet2
Classes | Description |
---|---|
XmlPropertySet | Esri XML PropertySet object. |
Remarks
When using this interface on a newly-created XmlPropertySet, the InitGeneric method should be called. See the XmlPropertySet coclass documentation for more information.