Latest post of the previous page:
В связи сdrkns 2026-02-27 00:03:31+00:00 - build 6649
- Implement import/export for histories and local plugin configs.
<history>
<items>
...
</history>
из XML?
Latest post of the previous page:
В связи сПервое, что приходит в голову, — старый добрый
xslt. Но готовую инструкцию я предложить не могу.XMLStarlet command line XML toolkit download | SourceForge.netZeroes wrote: Sun 01 Mar, 2026 22:16 Есть какие то рабочие варианты (консольные утилиты, скрипты ps/cscript) по выпиливанию элемента history
Code: Select all
xml ed -d "//history" input.xml > output.xml
far /export, извлекает только один конкретный узел и сохраняет в указанный файл. Code: Select all
@echo off
setlocal EnableDelayedExpansion
set infile=backup.xml
set outfile=colors.xml
set capture=0
set node=colors
echo ^<farconfig^> > "%outfile%"
for /f "usebackq delims=" %%L in ("%infile%") do (
set "line=%%L"
set "test=!line:<%node%>=!"
if not "!test!"=="!line!" set capture=1
if "!capture!"=="1" >> "%outfile%" echo(%%L
set "test=!line:</%node%>=!"
if not "!test!"=="!line!" set capture=0
)
echo ^</farconfig^> >> "%outfile%"Не должен он обламываться на корректном xml.Zeroes wrote: Fri 06 Mar, 2026 22:10 у меня возникла ситуация что в историю попали символы на которых xmlstarlet обламывается
Code: Select all
([xml](Get-Content "backup.xml" -Encoding UTF8)).SelectSingleNode("//colors").OuterXml | Set-Content "colors.xml" -Encoding UTF8PowerShell имеет доступ ко всему .NET-у, умеет все, xml у него это https://learn.microsoft.com/en-us/dotne ... mldocument