Akelpad+xmllint (XML validator)
- Author
- Message
-
Offline
- Posts: 5
- Joined: Sat Apr 11, 2015 3:33 pm
Akelpad+xmllint (XML validator)
Hello guys, need help about how use xmllint for check validation XML files.
With notepad ++ used this command and parameters:
xmllint.exe --valid --noout $(FULL_CURRENT_PATH),
where $(FULL_CURRENT_PATH) is path to current open file
Hope somebody help me how convert this line to use with Akelpad and show log status.
Many tnx
With notepad ++ used this command and parameters:
xmllint.exe --valid --noout $(FULL_CURRENT_PATH),
where $(FULL_CURRENT_PATH) is path to current open file
Hope somebody help me how convert this line to use with Akelpad and show log status.
Many tnx
-
Offline
- Posts: 1161
- Joined: Sun Oct 20, 2013 11:44 am
-
Offline
- Posts: 1161
- Joined: Sun Oct 20, 2013 11:44 am
oddi
May be
?
See \AkelFiles\Docs\Log-End.txt:
4096 - Source input - selection or all document if selection is empty.
May be
Code: Select all
-"XML tester" Call("Log::Output", 1, `"xmllint.exe" --valid --noout`, "", "", "", "", "", 4096) Icon(0)
See \AkelFiles\Docs\Log-End.txt:
4096 - Source input - selection or all document if selection is empty.
-
Offline
- Posts: 1949
- Joined: Sat Mar 06, 2010 7:40 pm
- Location: Poland
oddi
%f - active file
%f - active file
Code: Select all
"XML tester" Call("Log::Output", 1, `"xmllint.exe" --valid --noout "%f"`)
-
Offline
- Posts: 1161
- Joined: Sun Oct 20, 2013 11:44 am
xmllint uses Error Return Codes and it's not very convenient because xmllint does not write "valid" or "invalid" in STDOUT/STDERR).
XMLStarlet is more interesting (one file!):
(with jump to the text from the panel)
XMLStarlet is more interesting (one file!):
Code: Select all
"Validate XML (well-formedness only)" Call("Log::Output", 1, `"%a\AkelFiles\Tools\XMLStarlet\xml.exe" val --well-formed --err "%f"`, "", "^file:///([A-Za-z]:/[^:]+):(\d+)\.(\d+):", "/GOTOLINE=\2:\3")
Code: Select all
"Validate XML (XSD schema)" Call("Log::Output", 1, `"%a\AkelFiles\Tools\XMLStarlet\xml.exe" val --xsd "%a\AkelFiles\Tools\XMLStarlet\name.xsd" --err "%f"`, "", "^file:///([A-Za-z]:/[^:]+):(\d+)\.(\d+):", "/GOTOLINE=\2:\3")
Last edited by Skif_off on Tue Feb 16, 2016 12:57 am, edited 1 time in total.
-
Offline
- Posts: 5
- Joined: Sat Apr 11, 2015 3:33 pm
@Skif off - many tnx , later i watch this xmlstarlet
@KDJ : in notepad++ i used this:
xmllint.exe --valid --noout $(FULL_CURRENT_PATH),
and report is :
if file is correct -i see error 0 in log window
if file is broken - i see in log window all errors and lines where have this errors.
Now i wanna reproduce this in Akelpad with same results in log window, but atm not luck
PS:
@Skif off - many tnx again for idea with XMLstarlet
worked amazing , with errors, lines and etc etc
@KDJ : in notepad++ i used this:
xmllint.exe --valid --noout $(FULL_CURRENT_PATH),
and report is :
if file is correct -i see error 0 in log window
if file is broken - i see in log window all errors and lines where have this errors.
Now i wanna reproduce this in Akelpad with same results in log window, but atm not luck
PS:
@Skif off - many tnx again for idea with XMLstarlet
worked amazing , with errors, lines and etc etc
-
Offline
- Posts: 96
- Joined: Tue Nov 10, 2015 4:56 am
I get an errorSkif_off wrote:Code: Select all
"Validate XML (well-formedness only)" Call("Log::Output", 1, `"%a\AkelFiles\Tools\XMLStarlet\xml.exe val --well-formed --err "%f"`, "", "^file:///([A-Za-z]:/[^:]+):(\d+)\.(\d+):", "/GOTOLINE=\2:\3")
Code: Select all
"Validate XML (XSD schema)" Call("Log::Output", 1, `"%a\AkelFiles\Tools\XMLStarlet\xml.exe val --xsd "%a\AkelFiles\Tools\XMLStarlet\name.xsd" --err "%f"`, "", "^file:///([A-Za-z]:/[^:]+):(\d+)\.(\d+):", "/GOTOLINE=\2:\3")
Code: Select all
Can't execute command: "D:\Program Files\AkelPad\AkelFiles\Tools\XMLStarlet\xml.exe val --well-formed --err "E:\backup\building\Content.xml"
but it is unclear what it means "(with jump to the text from the panel)" - from the Log:Output? from the Log:Output not going jump ...
-
Offline
- Posts: 1161
- Joined: Sun Oct 20, 2013 11:44 am
Fixed.InFive wrote:I get an error
На русском, извиняюсьInFive wrote:but it is unclear what it means "(with jump to the text from the panel)" - from the Log:Output? from the Log:Output not going jump ...
Вывод утилиты идёт в Log:Output, сообщение об ошибке начинается с новой строки и выглядит так:
file:///полное имя файла:номер строки с ошибкой.позиция от начала строки: ошибка
Плагин парсит вывод утилиты и когда вы в панели Log:Output дважды кликаете по строке с ошибкой, курсор прыгает в документ в позицию номер строки с ошибкой:позиция ошибки от начала строки.
Если не работает, то попробуйте запустить в консоли с файлом с ошибками - формат не изменился с выходом новой версии? Уже засыпаю, могу забыть посмотреть. Хотя обычно не меняют без крайней нужды, тем более у чисто консольной утилиты.
-
Offline
- Posts: 96
- Joined: Tue Nov 10, 2015 4:56 am
Skif_off
Thank you, my native Russian ...
I realized that I did not understand the last time - for some reason it goes from the log is not always to the place of the error, and the cursor can be put in place well before the error ... I will logically calculate the principle of its going to the error ...
One sorry - he only checks the file saved on the disk, not the currently open document and after every edit is necessary to save the document to better check ...
Thank you, my native Russian ...
I realized that I did not understand the last time - for some reason it goes from the log is not always to the place of the error, and the cursor can be put in place well before the error ... I will logically calculate the principle of its going to the error ...
One sorry - he only checks the file saved on the disk, not the currently open document and after every edit is necessary to save the document to better check ...
-
Offline
- Posts: 1161
- Joined: Sun Oct 20, 2013 11:44 am
I don't know the reason, it may be the case in the opening or closing tag: that is, the moment from which the structure is broken - not invalid closing tag, for example, but the beginning of an element with an error. I mainly use XMLValidator.js and he sometimes behaves as.InFive wrote:for some reason it goes from the log is not always to the place of the error, and the cursor can be put in place well before the error
It's possible (only?) with js-script and temp-file (aka MarkdownPreview.js), maybe later.InFive wrote:he only checks the file saved on the disk, not the currently open document