Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8271757
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:55:40+00:00 2026-06-08T06:55:40+00:00

I am using the command: xmlstarlet ed –omit-decl –subnode /boinc –type elem -n app

  • 0

I am using the command:

xmlstarlet ed --omit-decl --subnode "/boinc" --type elem -n app -v "" project_00.xml > project_01.xml

However, I would like to insert two more tags into that one:

<app>
 <name>name</name>
 <nikname>nikname</nikname>
</app>

In my project_00.xml, I already have others tag app and it is causing conflicts.

The problem with this command:

xmlstarlet ed --subnode "/boinc" --type elem -n app -v "" project_00.xml|     xmlstarlet ed --subnode //app --type elem -n name -v "newApp"| xmlstarlet ed --subnode //app --type elem -n user_friendly_name -v "New.App" > project_01.xml

is that it created this.:

  <app name="wilson">
    <name>wilson</name>
    <user_friendly_name>Mr.Wilson</user_friendly_name>
    <name>newApp</name>
    <user_friendly_name>New.App</user_friendly_name>
  </app>
  <app>
    <name>newApp</name>
    <user_friendly_name>New.App</user_friendly_name>
  </app>

Does know the exactly command?

I tried this command but it replicated the to all app tags

xmlstarlet ed -s "/boinc" -t elem -n app -v "" -s "/boinc/app" -t elem -n name -v "name" -s "/boinc/app" -t elem -n user_friendly_name -v "New.App" project_00.xml > project_01.xml
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T06:55:41+00:00Added an answer on June 8, 2026 at 6:55 am

    Basically, you need an XPath expression to match the node you just inserted; since --subnode always puts new children in last place you can use /boinc/app[last()]:

    xmlstarlet ed \
      --subnode /boinc --type elem -n app -v '' \
      --subnode '/boinc/app[last()]' --type elem -n name -v newApp \
      --subnode '/boinc/app[last()]' --type elem -n user_friendly_name -v New.App \
      project_00.xml > project_01.xml
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to crash my Android app by using command-line ADB tool during
I need to read some filenames from an xml config file using xmlstarlet with
Is there a way to insert XML from one file into another using xmlstarlet
When using command line vim mode (set -o vi) and I type 'v', it
I am using command line (ant) to create and build android projects . I
I tried to create jar file using command line that I inserted into java
Is there any performance benefits to using Command objects to validate constraints over using
I'm trying to call a java program from python using command line. The code
Question: How do send data to a view model when using command binding? So
i'm trying to move folders to another folders using command line , with overwrite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.