If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2022-09-17
... I'm stunned - and I have to think over.
For the moment i thank you for another midnight lesson.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2022-09-19
Sorry I'm a bit delayed - my systems power supply had given up.
Reino, I thank you for this piece of code.
With it's concreteness and it's clearness it is something I had long been looking for.
Especially the clarification of how to combine adressing & processing helped me a lot.
sort() is for individual items, like sort(//div[@class='d-flex flex-column flex-md-row my-5 flex-justify-center']//@datetime) for instance. This won't work for sorting nodes. You'll have to use the XQuery "Order By Clause" in a FLWOR expression:
xidel-s"https://github.com/Hibbiki/chromium-win32/releases"-e"for $x in //section order by $x//@datetime descending return $x/join((.//@datetime,h2),x:cps(9))"xidel-s"https://github.com/Hibbiki/chromium-win32/releases"-e^"^ for $x in //section^ order by $x//@datetime descending^ return^ $x/join((.//@datetime,h2),x:cps(9))^"2022-10-01T15:28:04Zv106.0.5249.91-r10368262022-09-28T18:04:31Zv106.0.5249.62-r10368262022-09-14T10:45:09Zv105.0.5195.127-r10270182022-09-03T08:22:22Zv105.0.5195.102-r8562022-08-31T06:54:31Zv105.0.5195.54-r10270182022-08-17T19:50:35Zv104.0.5112.102-r10127292022-08-03T19:09:18Zv104.0.5112.81-r10127292022-07-20T21:55:38Zv103.0.5060.134-r10029112022-06-29T16:35:26Zv103.0.5060.66-r10029112022-06-22T20:10:51Zv103.0.5060.53-r1002911
It also appears that Github has changed their HTML-source a bit. In this case it leads to a shorter and more simple query, as you can see.
For the other Github-url that would be:
xidel-s"https://github.com/ArtifexSoftware/ghostpdl-downloads/releases"-e"for $x in //section order by ($x//@datetime)[1] descending return $x/join(((.//@datetime)[1],normalize-space(.//span[@class='ml-1 wb-break-all']),h2),x:cps(9))"xidel-s"https://github.com/ArtifexSoftware/ghostpdl-downloads/releases"-e^"^for$xin//section^orderby($x//@datetime)[1]descending^return^$x/join(^(^(.//@datetime)[1],^normalize-space(.//span[@class='ml-1 wb-break-all']),^h2^),x:cps(9)^)^"2022-09-21T12:19:16Zgs1000Ghostscript/GhostPDL10.0.02022-09-07T13:05:51Zgs1000rc2Ghostscript/GhostPDL10.0.0ReleaseCandidate22022-08-24T13:18:12Zgs10.0.0rc1Ghostscript/GhostPDL10.0.0ReleaseCandidate12022-04-04T14:53:27Zgs9561Ghostscript/GhostPDL9.56.12022-03-29T10:10:45Zgs9560Ghostscript/GhostPDL9.56.02022-03-14T14:47:52Zgs9560rc2Ghostscript/GhostPDL9.56.0rc22022-03-02T12:06:19Zgs9560rc1Ghostscript/GhostPDL9.56.0rc12021-09-27T09:22:22Zgs9550Ghostscript/GhostPDL9.55.02021-09-16T10:03:33Zgs9550rc1Ghostscript/GhostPDL9.55.0ReleaseCandidate12021-03-30T09:05:01Zgs9540Ghostscript/GhostPDL9.54.0
substring(concat(..., ' '), 1, 23 )
There is a (cumbersome) way to automate this:
xidel-s"https://github.com/ArtifexSoftware/ghostpdl-downloads/releases"-e"let $len:=(max(//section/(.//@datetime)[1] ! string-length(.)),max(//section/normalize-space(.//span[@class='ml-1 wb-break-all']) ! string-length(.))) for $x in //section order by ($x//@datetime)[1] descending return string-join(for $node at $i in (($x//@datetime)[1],normalize-space($x//span[@class='ml-1 wb-break-all']),$x/h2) return ($node,(1 to $len[$i] - string-length($node) + 4) ! ' '))"xidel-s"https://github.com/ArtifexSoftware/ghostpdl-downloads/releases"-e^"^let$len:=(^max(//section/(.//@datetime)[1]!string-length(.)),^max(//section/normalize-space(.//span[@class='ml-1 wb-break-all'])!string-length(.))^)^for$xin//section^orderby($x//@datetime)[1]descending^return^string-join(^for$nodeat$iin(^($x//@datetime)[1],^normalize-space($x//span[@class='ml-1 wb-break-all']),^$x/h2^)^return(^$node,^(1to$len[$i]-string-length($node)+4)!' '^)^)^"2022-09-21T12:19:16Zgs1000Ghostscript/GhostPDL10.0.02022-09-07T13:05:51Zgs1000rc2Ghostscript/GhostPDL10.0.0ReleaseCandidate22022-08-24T13:18:12Zgs10.0.0rc1Ghostscript/GhostPDL10.0.0ReleaseCandidate12022-04-04T14:53:27Zgs9561Ghostscript/GhostPDL9.56.12022-03-29T10:10:45Zgs9560Ghostscript/GhostPDL9.56.02022-03-14T14:47:52Zgs9560rc2Ghostscript/GhostPDL9.56.0rc22022-03-02T12:06:19Zgs9560rc1Ghostscript/GhostPDL9.56.0rc12021-09-27T09:22:22Zgs9550Ghostscript/GhostPDL9.55.02021-09-16T10:03:33Zgs9550rc1Ghostscript/GhostPDL9.55.0ReleaseCandidate12021-03-30T09:05:01Zgs9540Ghostscript/GhostPDL9.54.0
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2022-10-16
Hello Reino,
thank you for another elaborated reply.
- I'll be back when I read it attentively.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm working on
and I'm able to extract
the title lines
the released versions
the acc. date
All these are arrays.
When I try to produce a single line per entry, problems begin - actually on the basic level.
So am not able to combine (the version)
with the function
I get everything - syntax error, endless loop and a string of all entries - but no array of normalized entries.
So don't even reach the 'string-join'-level.
Any help?!
Thsnd Thx
Sequences.
What exactly have you tried? And what is the end-result you're actually looking for?
Reino, nice to meet you again ...
I'm trying to build 'one liners' like
I tried
giving
SET vrs=gs9561 gs1000rc2 gs10.0.0rc1 gs9560 gs9550 gs9560rc2 gs9560rc1 gs9540 gs9550rc1 gpdf_beta1
gives
SET vrs=
--extract "vrs:=($cls)//normalize-space(span[@class = 'ml-1 wb-break-all'])"
Thx for your attention
Wish I could say "likewise", but with you being anonymous that's not so obvious to me.
That would be...
or...
I'd forget about the use of external variables if I were you, because that's something very difficult to accomplish in
cmd
, if possible at all.Instead of...
I would take the parent node...
as a starting-point. The first occurrence:
Or shorter:
There are multiple
@datetime
attribute-nodes, so be sure to select the first one.Instead of
x:cps(9)
(TAB),"	"
should work as well. From your post I assumed that's what you want.And so for all occurrences:
Or of course minified:
... I'm stunned - and I have to think over.
For the moment i thank you for another midnight lesson.
Sorry I'm a bit delayed - my systems power supply had given up.
Reino, I thank you for this piece of code.
With it's concreteness and it's clearness it is something I had long been looking for.
Especially the clarification of how to combine adressing & processing helped me a lot.
... and this is what I made from it
Thank you
That's a creative way to assign the (prettified) extraction-query to a variable. The outer parenthesis
(
)
aren't necessary btw.Alternatively you could of course insert the extraction-query directly (with the necessary escape-characters):
Or minified:
And this is the final result (for now):
It's more impressive on https://github.com/Hibbiki/chromium-win32/releases, because the nodes there are not ordered chronolical per se.
btw: './/@datetime' appears only once per node - The others are dynamically loaded by the browser.
... my name is Michael, and I appreciate your expertise as well as concreteness and detailedness of your answers. Thank you.
Hello Michael,
sort()
is for individual items, likesort(//div[@class='d-flex flex-column flex-md-row my-5 flex-justify-center']//@datetime)
for instance. This won't work for sorting nodes. You'll have to use the XQuery "Order By Clause" in a FLWOR expression:It also appears that Github has changed their HTML-source a bit. In this case it leads to a shorter and more simple query, as you can see.
For the other Github-url that would be:
There is a (cumbersome) way to automate this:
Hello Reino,
thank you for another elaborated reply.
- I'll be back when I read it attentively.