4
$ xmlstarlet edit -L -u "/parse-plugins/mimeType/plugin[@id='parse-html']/@id" -v 'parse-tika' conf/parse-plugins.xml

Why doesn't it replace the plugin id of mimetpes currently using parse-html plugin?

From xmlstarlet documentation:

Update value of an attribute

xml ed -u ’/xml/table/rec[@id=3]/@id’ -v 5 xml/tab-obj.xml

I'm working on nutch parse-plugins.xml.

6
  • 1
    It works for me. Do you get an error of some kind? Commented Apr 27, 2011 at 12:26
  • @Mark - does the file content change? Commented Apr 27, 2011 at 12:27
  • Yes, it rewrites the file for me. Commented Apr 27, 2011 at 12:35
  • (There's one parse-html attribute left, but of course that's at a different path within the document.) Commented Apr 27, 2011 at 12:37
  • hmmm..some how re-opening the file (for the nth time) I see it changed! Commented Apr 27, 2011 at 12:42

1 Answer 1

2

as Mark pointed out, it works! To check that things changed use

$ xmlstarlet sel -t -c "/parse-plugins/mimeType/plugin[@id='parse-html']" conf/parse-plugins.xml

or the last-modified file attribute.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.