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 have been several questions on SO regarding getting Contacts numbers using the Contacts
There are numerous Agile software development methods. Which ones have you used in practice
I have just tried to save a simple *.rtf file with some websites and
There will be 500+ threads concurrently uploading an unique object to a bucket all
There is this strange situation I'm fighting on. I have 3 pages, les call
There is a text file with 1,000,000 lines of code floating around and Ctrl+F
There was a thread on this in comp.lang.javascript recently where victory was announced but
There are many tutorials that talk about deleting index.php from the url. But I
There must be a simple solution to this, but after 4 hours of browsing
We are using XSLT to translate a RIXML file to XML. Our RIXML contains

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.