Given
<foo>
<bar baz="Hello, World!">
</foo>
How do I all but the last 4 characters of @baz? One of my attempts was:
/foo/bar/@baz[substring( ., 0, -4 )]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use:
Do note the
3in the expression.The following is wrong:
because this returns the last 5 characters of the string value of the
bazattribute.