Language
Edit

XmlPoke task

Sets values as specified by an XPath query into an XML file.

Parameters

The following table describes the parameters of the XmlPoke task.

Parameter Description
Namespaces Optional String parameter.

Specifies the namespaces for XPath query prefixes. Namespaces is an XML snippet consisting of Namespace elements with attributes Prefix and Uri. The attribute Prefix specifies the prefix to associate with the namespace specified in Uri attribute. Don't use an empty Prefix.
Query Optional String parameter.

Specifies the XPath query.
Value Required ITaskItem parameter.

Specifies the value to be inserted into the specified path.
XmlInputPath Optional ITaskItem parameter.

Specifies the XML input as a file path.

Remarks

In addition to having the parameters that are listed in the table, this task inherits parameters from the TaskExtension class, which itself inherits from the Task class. For a list of these additional parameters and their descriptions, see TaskExtension base class.

Example

Here's a sample.xml to modify:





In this example, if you want to modify /Package/mp:PhoneIdentity/PhoneProductId, then use


  
    
        
        
        
    



  


dn is here used as an artificial namespace prefix for the default namespace; you can use it whenever there isn't a specified prefix in the target XML.

See also