en-US/Xmlips.dll-Help.xml

<?xml version="1.0" encoding="utf-8"?>
<helpItems xmlns="http://msh" schema="maml">
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Add-Xml</command:name>
<maml:description>
<maml:para>Adds an XML element.</maml:para>
</maml:description>
<command:verb>Add</command:verb>
<command:noun>Xml</command:noun>
</command:details>
<maml:description>
<maml:para>The command creates and adds a new XML element to the specified.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Add-Xml</maml:name>
<command:parameter required="true" position="0" >
<maml:name>Tag</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="1" >
<maml:name>Xml</maml:name>
<command:parameterValue required="true">XmlElement[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Namespace</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="0" >
<maml:name>Tag</maml:name>
<maml:description>
<maml:para>Specifies the new element name.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" pipelineInput="true (ByValue)" position="1" >
<maml:name>Xml</maml:name>
<maml:description>
<maml:para>Specifies the parent element.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Namespace</maml:name>
<maml:description>
<maml:para>The namespace URI of the element.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>System.Xml.XmlElement</maml:name>
</dev:type>
<maml:description>
<maml:para>Input parent XML element.</maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>System.Xml.XmlElement</maml:name>
</dev:type>
<maml:description>
<maml:para>Added child XML element.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code>$xml = [xml]&apos;&lt;r/&gt;&apos;
Add-Xml e $xml.DocumentElement | Set-Xml a, 1
$xml.OuterXml</dev:code>
<dev:remarks>
<maml:para>This example adds a new element &quot;e&quot; to the root element and passes the
added result element in Set-Xml which sets its attribute &quot;a&quot; to &quot;1&quot;.</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Project site:</maml:linkText>
<maml:uri>https://github.com/nightroman/Xmlips</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Copy-Xml</command:name>
<maml:description>
<maml:para>Copies the inner XML of one element to another.</maml:para>
</maml:description>
<command:verb>Copy</command:verb>
<command:noun>Xml</command:noun>
</command:details>
<maml:description>
<maml:para>The cmdlet compares inner XML of the source and target. If they are
different then the source is copied to the target. Note that this
command does not affect attributes.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Copy-Xml</maml:name>
<command:parameter required="true" position="0" >
<maml:name>Source</maml:name>
<command:parameterValue required="true">XmlElement</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="1" >
<maml:name>Target</maml:name>
<command:parameterValue required="true">XmlElement</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="0" >
<maml:name>Source</maml:name>
<maml:description>
<maml:para>Specifies the source element.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="1" >
<maml:name>Target</maml:name>
<maml:description>
<maml:para>Specifies the target element.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Project site:</maml:linkText>
<maml:uri>https://github.com/nightroman/Xmlips</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Export-Xml</command:name>
<maml:description>
<maml:para>Exports elements as fragments.</maml:para>
</maml:description>
<command:verb>Export</command:verb>
<command:noun>Xml</command:noun>
</command:details>
<maml:description>
<maml:para>The cmdlet exports specified XML elements as fragments.
Exported elements may be imported later by Import-Xml.
 
The cmdlet may be used in order to save XML query results for later use.
Another use case is logging using XML format, in this case the switch
Append is normally used in order to add new data to logs effectively.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Export-Xml</maml:name>
<command:parameter required="true" position="0" >
<maml:name>Path</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="1" >
<maml:name>Xml</maml:name>
<command:parameterValue required="true">XmlElement[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Append</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="0" >
<maml:name>Path</maml:name>
<maml:description>
<maml:para>Specifies the destination file path.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" pipelineInput="true (ByValue)" position="1" >
<maml:name>Xml</maml:name>
<maml:description>
<maml:para>Specifies elements to be exported.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Append</maml:name>
<maml:description>
<maml:para>Tells to append data if the file exists.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>System.Xml.XmlElement</maml:name>
</dev:type>
<maml:description>
<maml:para>XML elements.</maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Import-Xml</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Project site:</maml:linkText>
<maml:uri>https://github.com/nightroman/Xmlips</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Find-Xml</command:name>
<maml:description>
<maml:para>Gets the specified existing or just added element.</maml:para>
</maml:description>
<command:verb>Find</command:verb>
<command:noun>Xml</command:noun>
</command:details>
<maml:description>
<maml:para>The cmdlet gets a single element specified by its name, key attribute name,
and unique value. If the element is not found then it is created with the
specified key attribute value and added to the input parent.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Find-Xml</maml:name>
<command:parameter required="true" position="0" >
<maml:name>Tag</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="1" >
<maml:name>Key</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="2" >
<maml:name>Value</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="3" >
<maml:name>Xml</maml:name>
<command:parameterValue required="true">XmlElement[]</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="0" >
<maml:name>Tag</maml:name>
<maml:description>
<maml:para>Specifies the element name.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="1" >
<maml:name>Key</maml:name>
<maml:description>
<maml:para>Specifies the key attribute name.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="2" >
<maml:name>Value</maml:name>
<maml:description>
<maml:para>Specifies the unique attribute value.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" pipelineInput="true (ByValue)" position="3" >
<maml:name>Xml</maml:name>
<maml:description>
<maml:para>Specifies the parent element.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>System.Xml.XmlElement</maml:name>
</dev:type>
<maml:description>
<maml:para>XML elements.</maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>System.Xml.XmlElement</maml:name>
</dev:type>
<maml:description>
<maml:para>Found or created XML element.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code>$xml = [xml]&apos;&lt;r&gt; &lt;e a=&quot;1&quot;/&gt; &lt;/r&gt;&apos;
Find-Xml e a 1 $xml.DocumentElement
Find-Xml e a 2 $xml.DocumentElement
$xml.OuterXml</dev:code>
<dev:remarks>
<maml:para>The first Find-Xml gets the existing element &quot;e&quot; with a=&quot;1&quot;.
The second Find-Xml gets the created element &quot;e&quot; with a=&quot;2&quot;.</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Project site:</maml:linkText>
<maml:uri>https://github.com/nightroman/Xmlips</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Get-Xml</command:name>
<maml:description>
<maml:para>Gets XML nodes or data using XPath.</maml:para>
</maml:description>
<command:verb>Get</command:verb>
<command:noun>Xml</command:noun>
</command:details>
<maml:description>
<maml:para>The cmdlet uses XPath queries to search for nodes or data in XML nodes.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Get-Xml</maml:name>
<command:parameter required="true" position="0" >
<maml:name>XPath</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="1" >
<maml:name>Xml</maml:name>
<command:parameterValue required="true">XmlNode[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Namespace</maml:name>
<command:parameterValue required="true">IDictionary</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Property</maml:name>
<command:parameterValue required="true">Object[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Single</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="0" >
<maml:name>XPath</maml:name>
<maml:description>
<maml:para>Specifies an XPath search query. Variables are supported. XPath uses
the same variable notation as PowerShell: $Variable. Variables are
evaluated as existing PowerShell variables.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" pipelineInput="true (ByValue)" position="1" >
<maml:name>Xml</maml:name>
<maml:description>
<maml:para>Specifies one or more XML nodes. The XPath query is applied to them.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Namespace</maml:name>
<maml:description>
<maml:para>Specifies a hash table of the namespaces used in the XML.
See Select-Xml parameter Namespace for more details.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Property</maml:name>
<maml:description>
<maml:para>Tells to evaluate the specified XPath expressions on the result node
and return them as PSObject properties. Strings may be converted to
specified types.
 
The parameter accepts one or more items. Items are defined as:
 
&lt;XPath&gt;
 
    Get-Xml //log $xml -Property &apos;@time&apos;, &apos;@count&apos;
 
@{&lt;PropertyName&gt; = &lt;XPath&gt;}
 
    Get-Xml //log $xml -Property @{Time = &apos;@time&apos;}, @{Count = &apos;@count&apos;}
 
@{&lt;PropertyName&gt; = &lt;XPath&gt;, &lt;ResultType&gt;}
 
    Get-Xml //log $xml -Property @(
        @{Time = &apos;@time&apos;, [DateTime]}
        @{Count = &apos;@count&apos;, [int]}
    )
 
PowerShell conversion is used to convert strings to specified types.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Single</maml:name>
<maml:description>
<maml:para>Tells to return the first found node, if any, for each input node.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>System.Xml.XmlNode</maml:name>
</dev:type>
<maml:description>
<maml:para>XML nodes.</maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>System.Xml.XmlNode</maml:name>
</dev:type>
<maml:description>
<maml:para>XML nodes.</maml:para>
</maml:description>
</command:returnValue>
<command:returnValue>
<dev:type>
<maml:name>PSObject</maml:name>
</dev:type>
<maml:description>
<maml:para>Objects with evaluated properties specified by Property.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code>$xml = [xml]&apos;&lt;r&gt; &lt;e a=&quot;1&quot;/&gt; &lt;e a=&quot;2&quot;/&gt; &lt;/r&gt;&apos;
$a = 2
Get-Xml &apos;//e[@a = $a]&apos; $xml</dev:code>
<dev:remarks>
<maml:para>This example creates an XML document and gets an element &quot;e&quot; which
attribute &quot;a&quot; is equal to 2. The value is specified by a variable.</maml:para>
<maml:para></maml:para>
</dev:remarks>
</command:example>
<command:example>
<maml:title>-------------------------- EXAMPLE 2 --------------------------</maml:title>
<dev:code>$xml = [xml]&apos;&lt;r&gt; &lt;e id=&quot;1&quot; date=&quot;2015-01-02&quot;/&gt; &lt;e id=&quot;2&quot; date=&quot;2015-11-12&quot;/&gt; &lt;/r&gt;&apos;
Get-Xml //e $xml -Property @{Id = &apos;@id&apos;, [int]}, @{Date = &apos;@date&apos;, [DateTime]}</dev:code>
<dev:remarks>
<maml:para>This example queries for elements &quot;e&quot; and tells to return PSObject&apos;s with
properties &quot;Id&quot; (int) and &quot;Date&quot; (DateTime) based on attributes &quot;id&quot; and
&quot;date&quot;.</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Project site:</maml:linkText>
<maml:uri>https://github.com/nightroman/Xmlips</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Import-Xml</command:name>
<maml:description>
<maml:para>Imports elements from a file or strings.</maml:para>
</maml:description>
<command:verb>Import</command:verb>
<command:noun>Xml</command:noun>
</command:details>
<maml:description>
<maml:para>The command reads elements from the source with multiple root elements. The
result is a single element &quot;root&quot; which contains imported elements as child
nodes.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Import-Xml</maml:name>
<command:parameter required="true" position="0" >
<maml:name>Path</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
</command:syntaxItem>
<command:syntaxItem>
<maml:name>Import-Xml</maml:name>
<command:parameter required="true" position="named" >
<maml:name>Content</maml:name>
<command:parameterValue required="true">String[]</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="0" >
<maml:name>Path</maml:name>
<maml:description>
<maml:para>Specifies the source file path.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" position="named" >
<maml:name>Content</maml:name>
<maml:description>
<maml:para>Specifies the content string(s).</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>System.Xml.XmlElement</maml:name>
</dev:type>
<maml:description>
<maml:para>An element &quot;root&quot; with imported elements.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code># pandoc.exe --to=html outputs as XHTML, without --standalone it is not well-formed XML
$fragments = pandoc.exe --to=html README.md
 
# import and get all links, the namespace http://www.w3.org/1999/xhtml is not needed
Import-Xml -Content $fragments | Get-Xml //a</dev:code>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Export-Xml</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Project site:</maml:linkText>
<maml:uri>https://github.com/nightroman/Xmlips</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>New-Xml</command:name>
<maml:description>
<maml:para>Creates a new XML element.</maml:para>
</maml:description>
<command:verb>New</command:verb>
<command:noun>Xml</command:noun>
</command:details>
<maml:description>
<maml:para>The cmdlet creates and returns an XML element.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>New-Xml</maml:name>
<command:parameter required="false" position="0" >
<maml:name>Tag</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="1" >
<maml:name>Attribute</maml:name>
<command:parameterValue required="true">String[]</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="false" position="0" >
<maml:name>Tag</maml:name>
<maml:description>
<maml:para>Specifies the new element name.
The default name is &quot;root&quot;.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="1" >
<maml:name>Attribute</maml:name>
<maml:description>
<maml:para>Specifies attribute name/value pairs followed by an optional inner
text. In other words, if the number of items is odd then the last
item is the inner text.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>System.Xml.XmlElement</maml:name>
</dev:type>
<maml:description>
<maml:para>Created XML element.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Project site:</maml:linkText>
<maml:uri>https://github.com/nightroman/Xmlips</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Save-Xml</command:name>
<maml:description>
<maml:para>Saves a document read by Read-Xml.</maml:para>
</maml:description>
<command:verb>Save</command:verb>
<command:noun>Xml</command:noun>
</command:details>
<maml:description>
<maml:para>The cmdlet saves a document read by Read-Xml if it is changed.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Save-Xml</maml:name>
<command:parameter required="true" position="0" >
<maml:name>Xml</maml:name>
<command:parameterValue required="true">XmlNode</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="0" >
<maml:name>Xml</maml:name>
<maml:description>
<maml:para>Any node of the document read by Read-Xml.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code>$xml = Read-Xml data.xml
...
Save-Xml $xml</dev:code>
<dev:remarks>
<maml:para>The example shows a typical scenario: an XML document is read from a file,
some operations are performed on returned $xml, and then Save-Xml is called.</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Read-Xml</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Project site:</maml:linkText>
<maml:uri>https://github.com/nightroman/Xmlips</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Set-Xml</command:name>
<maml:description>
<maml:para>Sets XML attributes and text.</maml:para>
</maml:description>
<command:verb>Set</command:verb>
<command:noun>Xml</command:noun>
</command:details>
<maml:description>
<maml:para>The cmdlet sets the specified attribute and text values.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Set-Xml</maml:name>
<command:parameter required="true" position="0" >
<maml:name>Attribute</maml:name>
<command:parameterValue required="true">String[]</command:parameterValue>
</command:parameter>
<command:parameter required="true" position="1" >
<maml:name>Xml</maml:name>
<command:parameterValue required="true">XmlElement[]</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Change</maml:name>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Changed</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="0" >
<maml:name>Attribute</maml:name>
<maml:description>
<maml:para>Specifies attribute name/value pairs followed by an optional inner
text. In other words, if the number of items is odd then the last
item is the inner text.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="true" pipelineInput="true (ByValue)" position="1" >
<maml:name>Xml</maml:name>
<maml:description>
<maml:para>Specifies the XML element which attributes and text are set.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Change</maml:name>
<maml:description>
<maml:para>Tells to set only changed values.
 
The same values are not set and the document is not changed.
This may avoid unnecessary writing to disk by Save-Xml.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Changed</maml:name>
<maml:description>
<maml:para>Tells to set only changed values and return changed information.
 
For each changed value an object describing the change is written.
The properties are Attribute, OldValue, NewValue, Element.
The attribute name is empty for the text value.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>System.Xml.XmlElement</maml:name>
</dev:type>
<maml:description>
<maml:para>XML element which attributes and text are set.</maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>None or change information objects</maml:name>
</dev:type>
<maml:description>
<maml:para>Optional change data information.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code>$xml = [xml]&apos;&lt;r&gt; &lt;e a=&quot;1&quot;/&gt; &lt;e/&gt; &lt;/r&gt;&apos;
Get-Xml //e $xml | Set-Xml a, 2
$xml.InnerXml</dev:code>
<dev:remarks>
<maml:para>This example gets all elements &quot;e&quot; and sets their attribute &quot;a&quot; to &quot;2&quot;.</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Project site:</maml:linkText>
<maml:uri>https://github.com/nightroman/Xmlips</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Read-Xml</command:name>
<maml:description>
<maml:para>Reads a document and gets its root element.</maml:para>
</maml:description>
<command:verb>Read</command:verb>
<command:noun>Xml</command:noun>
</command:details>
<maml:description>
<maml:para>The cmdlet reads an XML document from a file and returns its root element.
Use Save-Xml with any node of this document in order to save the changes.
Note that Save-Xml does not write to disk if the document is not changed.
 
The document, if needed, can be obtained as the property OwnerDocument.
It is derived from XmlDocument and contains extra properties:
 
    IsChanged
        Tells that the document is changed.
 
    IsNew
        Tells that the document is created from Content.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Read-Xml</maml:name>
<command:parameter required="true" position="0" >
<maml:name>Path</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Content</maml:name>
<command:parameterValue required="true">String</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Settings</maml:name>
<command:parameterValue required="true">XmlReaderSettings</command:parameterValue>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Backup</maml:name>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" position="0" >
<maml:name>Path</maml:name>
<maml:description>
<maml:para>Specifies the source XML file. The file must exist unless Content is
specified.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Backup</maml:name>
<maml:description>
<maml:para>Tells to create a backup copy of the original source file on saving of
the changed document by Save-Xml. The backup file name is the original
name with added &quot;.bak&quot;.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Content</maml:name>
<maml:description>
<maml:para>Tells to create a new document from the specified content if the source
file does not exist. In this case the properties IsNew and IsChanged
are set to true.</maml:para>
</maml:description>
</command:parameter>
<command:parameter required="false" position="named" >
<maml:name>Settings</maml:name>
<maml:description>
<maml:para>Specifies the custom XML reader settings instead of the default.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name>Xmlips.FileXmlDocument</maml:name>
</dev:type>
<maml:description>
<maml:para>XmlDocument with extra members IsNew, IsChanged.</maml:para>
</maml:description>
</command:returnValue>
</command:returnValues>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code>$xml = Read-Xml data.xml
...
Save-Xml $xml</dev:code>
<dev:remarks>
<maml:para>The example shows a typical scenario: an XML document is read from a file,
some operations are performed on returned $xml, and then Save-Xml is called.</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Save-Xml</maml:linkText>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Project site:</maml:linkText>
<maml:uri>https://github.com/nightroman/Xmlips</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10">
<command:details>
<command:name>Remove-Xml</command:name>
<maml:description>
<maml:para>Removes XML nodes.</maml:para>
</maml:description>
<command:verb>Remove</command:verb>
<command:noun>Xml</command:noun>
</command:details>
<maml:description>
<maml:para>This cmdlet removes the input nodes from their parents.</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Remove-Xml</maml:name>
<command:parameter required="true" position="0" >
<maml:name>Xml</maml:name>
<command:parameterValue required="true">XmlNode[]</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" pipelineInput="true (ByValue)" position="0" >
<maml:name>Xml</maml:name>
<maml:description>
<maml:para>Specifies one or more nodes to be removed.</maml:para>
</maml:description>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name>System.Xml.XmlNode</maml:name>
</dev:type>
<maml:description>
<maml:para>XML nodes to be removed.</maml:para>
</maml:description>
</command:inputType>
</command:inputTypes>
<command:examples>
<command:example>
<maml:title>-------------------------- EXAMPLE 1 --------------------------</maml:title>
<dev:code>$xml = [xml]&apos;&lt;r&gt; &lt;e a=&quot;1&quot;/&gt; &lt;e a=&quot;2&quot;/&gt; &lt;/r&gt;&apos;
Get-Xml &apos;//e[@a = 2]&apos; $xml | Remove-Xml
$xml.InnerXml</dev:code>
<dev:remarks>
<maml:para>This example gets elements with a=&quot;2&quot; and removes them.</maml:para>
</dev:remarks>
</command:example>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText>Project site:</maml:linkText>
<maml:uri>https://github.com/nightroman/Xmlips</maml:uri>
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
</helpItems>