As you didn't provide the input you're using, I couldn't test this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2022-08-28
thx Reino for your instant response on a sunday afternoon.
May I have another question ... ???
I try to use this in a FOR-loop - and I can't find a way to get
... extract(@onclick, '.\"(.)\"', 1), ... e.g. extract(@onclick, '.\^"(.)\^"', 1),
working because of (DOS) syntax errors.
Is there a way to let XIDEL read it's commands from a file ?
thx again
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Within a for-loop you shouldn't end a line with a ^.
Escape-character-hell! It's not about escaping the \", it's about (.*) between the second pair of double-quotes.
In a for-loop the following characters need to be escaped: % & < > ^ | , ; = " ( ). Except when they're between a single pair of double-quotes.
And please put the input before the extraction-query.
For the other command I posted, where the extraction-query is 'prettified' and thus covers multiple lines, all the above mentioned characters need to be escaped:
No problem.
One last thing I forgot to mention: substring-before(@id,'_link') is another option instead of extract(@onclick,'\"(.*)\"',1). Probably easier because there are no double-quotes to deal with.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2022-08-29
I used @onclick because I thought, @onclick references the 'true' UUID.
When I realized, that UUID is consistantly used all over the site, I switched to @id in the way you mentioned.
... sInce " double-quotes are no problem anymore :-)
Thank you very much, Reino
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2022-08-29
... since " double-quotes are no problem anymore :-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm working on
You could use
--extract-exclude
:There is however no need for so many extraction-queries. One is enough:
Or alternatively with let-variables:
As you didn't provide the input you're using, I couldn't test this.
thx Reino for your instant response on a sunday afternoon.
May I have another question ... ???
I try to use this in a FOR-loop - and I can't find a way to get
... extract(@onclick, '.\"(.)\"', 1), ... e.g. extract(@onclick, '.\^"(.)\^"', 1),
working because of (DOS) syntax errors.
Is there a way to let XIDEL read it's commands from a file ?
thx again
Could you share the input/source you're processing as well as the exact
cmd
command and the error-message?The input is:
https://www.catalog.update.microsoft.com/Search.aspx?q=KB5016676%20windows%207%20-embedded
The command is:
Multiple things are going wrong here.
xidel
variables with--output-format=cmd
in a for-loop is by using"delims="
instead of"tokens=*"
. See https://stackoverflow.com/a/61972422. https://sourceforge.net/p/xidel/discussion/help/thread/3797db1dc8/ could also be informative.^
.\"
, it's about(.*)
between the second pair of double-quotes.In a for-loop the following characters need to be escaped:
% & < > ^ | , ; = " ( )
. Except when they're between a single pair of double-quotes.So
--extract-exclude^=x86^,x64
,--output-format^=cmd
and^(.*^)
(between a second pair of double-quotes;-e "...\"(.*)\"..."
) needed to be escaped.You can also use
"
, the XQuery notation for a double-quote. Then there's no second pair of double-quotes and thus no need to escape(.*)
:For the other command I posted, where the extraction-query is 'prettified' and thus covers multiple lines, all the above mentioned characters need to be escaped:
A minified command is a lot easier though:
Yes. 'query.xq':
or
or
And then:
or
And as you can see, in this case it doesn't matter if you use Windows- or Linux quotation for the extraction-file.
What an enlightenment! Every line! ... and so many things I should have known.
Reino, I thank you this late night lesson. - I won't forget this one.
No problem.
One last thing I forgot to mention:
substring-before(@id,'_link')
is another option instead ofextract(@onclick,'\"(.*)\"',1)
. Probably easier because there are no double-quotes to deal with.I used @onclick because I thought, @onclick references the 'true' UUID.
When I realized, that UUID is consistantly used all over the site, I switched to @id in the way you mentioned.
... sInce " double-quotes are no problem anymore :-)
Thank you very much, Reino
... since
"
double-quotes are no problem anymore :-)