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 901171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T15:30:49+00:00 2026-05-15T15:30:49+00:00

So there’s a messy XML file where all white spaces between tags have been

  • 0

So there’s a messy XML file where all white spaces between tags have been stripped, so it’s a valid XML file but it’s somewhat unreadable.

I press the magic Ctrl+K, D, and the file is beautifully formatted.

I edit it, and then I want to put it back into the compressed, hardly readable state, removing all whitespaces between the tags. How do I do that in VS 2008? I looked though the list of all available commands but couldn’t find any.

  • 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-05-15T15:30:50+00:00Added an answer on May 15, 2026 at 3:30 pm

    Using Notepad++

    I recommend you get Notepad++ and install the XML Tools plugin. The Plugins > XML Tools menu contains a Linarize XML item that does exactly what you want.

    Using Visual Studio

    You could do a Find & Replace using a regular expression.

    First remove all the whitespace preceding any XML tags using these search criteria:

    Find what: :Wh*[<]
    Replace with: <

    Then remove all the whitespace preceding any text or attributes:

    Find what: :Wh+{:Al}
    Replace with: \1

    Note: There should be a space in front of \1.

    Disclaimer: This method may not be completely accurate, so make sure to double-check the result!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are 3 integer variables which can have values 0 or 1. If all
There's a Rails 3.2.3 web application which doesn't use any database. But in spite
There are nice SO question and answers about this issue, but these options didn't
I have just tried to save a simple *.rtf file with some websites and
There's obviously something I'm missing here - I've been through the developer.android reference and
There was a smbmrx sample code using RDBSS in WDK Vista. But since WDK
There was a thread on this in comp.lang.javascript recently where victory was announced but
This could be a duplicate question, but I have no idea what search terms
There is a trigger on a table for updates, inserts, and deletes, but the
There is a list standard python exceptions that we should watch out, but I

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.