Closed Cicorione closed 6 months ago
This works as expected.
When the focus is in "Nephew
", the XPath expression must be ../../@accent
(two levels up and then the attribute @accent
)
<SetVariable variable="color" select="../../@accent" />
(line 63)
Hi Patrick, coding is not my expertise, so I am not sure how it should work, but I did as you suggested: ../../@accent
and I continue to get the same error:
<SetVariable variable="color" select="../../@accent" />
<Message select="concat('The color is: ', $color)" />
And this is the output of the message:
Message: "The color is: \
This is box: \
1\
"
But accent
is here:
<data>
<Parent title="SP Color Test" accent="spyellow">
[...]
</data>
While the text in the message belong to these tags:
<Baby>This is box: </Baby>
<Baby>1</Baby>
Going upper: ../../../@accent
did not change anything:
Unless I really I didn't get what is the purpose on this new parser, which I do not exclude as possibility, the point is I am recalling a specific attribute, so eventually I expect a nil
value not value from other tags.
Thanks.
Can you send me the log file, the layout and the data file running in verbose mode?
You are not using lxpath. Please run sp --xpath lxpath
.
Oh I see, I was unaware about such command!
Using sp --xpath lxpath
works fine on my end!
In the news I read this is going to be the default parser the next major version, isn't it?
In the news I read this is going to be the default parser the next major version, isn't it?
Yes, there is no ETA yet. I will release it when there are no more bug reports ;-)
(I guess it will be beginning of 2024)
Hi @pgundlach
I believe I was able to reproduce the bug I was stepped in while looking to use new lxpath parser:
../@attribute
. I don't believe mylayout
code is incorrect:data
layout
When I check the
protocol
I see something wrong:This is apply on the same version on
Win/Linux/FreeBSD
.spcolor7.pdf
Thanks... 🙏