<commit_before>#[xml]$xml = Get-Content "c:\msys64\home\mata\downloads\pelda_jav.xml"
[xml]$xml = Get-Content C:\msys64\home\mata\downloads\export_zasob7.xml


foreach ($name in $xml.responsePack.responsePackItem.listStock.stock.stockHeader.name)
{
  $arr = $name.Split(";")
  "<line1> $arr[0] </line1> <line2> $arr[1] </line2> "
}<commit_msg>Add-XmlAttribute<commit_after>function Add-XMLAttribute([System.Xml.XmlNode] $node, [string] $attr_name, [string] $attr_value)
{
  $attrib = $node.OwnerDocument.CreateAttribute($attr_name)
  $attrib.Value = $attr_value
  $node.Attributes.Append($attrib)
  $node.InnerText = ""
}

#[xml]$xml = Get-Content "c:\msys64\home\mata\downloads\pelda_jav.xml"
$file = Get-Item "$env:USERPROFILE\Downloads\export_zasob7.xml"

# load it into an XML object:
$xml = New-Object -TypeName XML
$xml.Load($file)

$stk = @{stk = "http://www.stormware.cz/schema/version_2/stock.xsd"}
$xnode = Select-Xml -Xml $xml -Namespace $stk -XPath "//stk:stockHeader/stk:name"
#$xnode.GetType()

foreach ($item in $xnode.Node)
{
  $arr = $item.InnerText.Split(";")
  Add-XMLAttribute $item "line1" $arr[0].Trim()
  Add-XMLAttribute $item "line2" $arr[1].Trim()
  break
}

$xml.Save($(Join-Path $file.Directory "$($file.Basename)_saved.xml"))
{'fraction_non_alphanumeric': 0.19298245614035087, 'fraction_numerical': 0.015151515151515152, 'mean_word_length': 5.243781094527363, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '600845', 'n_tokens_mistral': 504, 'n_tokens_neox': 499, 'n_words': 78}