Closed Kochise closed 8 months ago
Hello Kochise. If I look at your desired output (just concatenated strings), then I'd say; using 2 for-loops is a much simpler approach:
xidel -s "out.xml" -e "for $x in //file for $y in $x/error return `{$x/@name}:{$y/@line}: {$y/@source}: {$y/@message}`"
xidel -s "out.xml" -e ^"^
for $x in //file^
for $y in $x/error^
return^
`{$x/@name}:{$y/@line}: {$y/@source}: {$y/@message}`^
"
(if your binary is older than 0.9.9-8787
, then use x'...'
instead of `...`
)
Hi, using Vera++ to extract infos, I generate a XML file :
vera++ -c "out.xml" -r "%VERA_BIN%\..\lib\vera++" --profile default --show-rule -i "files_to_analyze.txt">"out.txt"
I get
out.xml
that look something like :Then I try to extract relevant information for SonarQube :
xidel "out.xml" --input-format=xml --extract="<checkstyle><file name={$file:=.}><error message={$msg:=.} line={$line:=.} source={$id:=.}/>*</file>*</checkstyle>" 1>"out.tmp" 2>nul
I get
out.tmp
that look something like :The problem is that
file := C:\Users\toto\Downloads\GLFrontier-win32\src\_host.c
comes very late.Currently I store the
id :=
,line :=
andmsg :=
tags into a temporary file with a fake header to replace them as-soon-as I get thefile :=
tag, but it requires double the work.I'd like to have it top-most to be able to convert the output into something like :
Any idea ?
Perhaps there's a way to specify the output format and get the expected file in one command.
Regards.