The Maven settings file looks like:
<settings
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>fake31</id>
<username>username1</username>
<password>bb</password>
</server>
<server>
<id>fake</id>
<username>username2</username>
<password>aa2</password>
</server>
<server>
<id>fake3</id>
<username>username3</username>
<password>aa3</password>
</server>
</servers>
<mirrors>
[parially cut]
</mirrors>
</settings>
I have to - using xmlstarlet (?) - return a value of the username element for the id = fake.
I analyzed many examples and did countless tries but I failed.
When I use /settings/servers/server[id='fake']/username at https://www.freeformatter.com/xpath-tester.html, the result is what I expect.
Can someone help me? Thank you in advance.