Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
deleted 47 characters in body
Source Link
The Impaler
  • 49.3k
  • 10
  • 50
  • 90

You shouldn't do it, I know. I mean, perPer the XML specification you aren't supposed to. Stop reading this answer. It's a hack!

Having said that... I really needed it badly, so here's the trick. Surround the section you want to comment with an unused processing instruction:

<some-tags /> <?comment <!-- traditional comment 1 --> <badtag prop1="123"> <!-- traditional comment 2 --> </badtag> <!-- traditional comment 3 --> ?> <rest-of-my-tags /> 

You can use any processing instruction that's not in use. I chose "comment" as the unused processing instruction, so I started the big comment with <?comment and ended it with ?>.

Pretty much any word will do as a processing instruction, since they aren't really used most of the time. I mean, when was the last time you used one?

You shouldn't do it, I know. I mean, per the XML specification you aren't supposed to. Stop reading this answer. It's a hack!

Having said that... I really needed it badly, so here's the trick. Surround the section you want to comment with an unused processing instruction:

<some-tags /> <?comment <!-- traditional comment 1 --> <badtag prop1="123"> <!-- traditional comment 2 --> </badtag> <!-- traditional comment 3 --> ?> <rest-of-my-tags /> 

You can use any processing instruction that's not in use. I chose "comment" as the unused processing instruction, so I started the big comment with <?comment and ended it with ?>.

Pretty much any word will do as a processing instruction, since they aren't really used most of the time. I mean, when was the last time you used one?

You shouldn't do it, I know. Per the XML specification you aren't supposed to.

Having said that... I really needed it badly, so here's the trick. Surround the section you want to comment with an unused processing instruction:

<some-tags /> <?comment <!-- traditional comment 1 --> <badtag prop1="123"> <!-- traditional comment 2 --> </badtag> <!-- traditional comment 3 --> ?> <rest-of-my-tags /> 

You can use any processing instruction that's not in use. I chose "comment" as the unused processing instruction, so I started the big comment with <?comment and ended it with ?>.

Pretty much any word will do as a processing instruction, since they aren't really used most of the time. I mean, when was the last time you used one?

deleted 115 characters in body
Source Link
The Impaler
  • 49.3k
  • 10
  • 50
  • 90

You shouldn't do it, I know. I mean, per the XML specification you aren't supposed to. Stop reading this answer. It's a hack! (well... maybe a good one).

Having said that... I really needed it badly, so here's the tricktrick. Surround the section you want to comment with an unused unused processingprocessing instruction:

<some-tags /> <?comment <!-- traditional comment 1 --> <badtag prop1="123"> <!-- traditional comment 2 --> </badtag> <!-- traditional comment 3 --> ?> <rest-of-my-tags /> 

You can use any processing instruction that's not in use. I chose "comment" as the unused processing instruction, so I started the big comment with <?comment and ended it with ?>.

Pretty much any word will do as a processing instruction, since they aren't really used most of the time. I mean, didwhen was the last time you ever used anyone?

You shouldn't do it, I know. I mean, per the XML specification you aren't supposed to. Stop reading this answer. It's a hack! (well... maybe a good one).

Having said that... I really needed it badly, so here's the trick. Surround the section you want to comment with an unused processing instruction:

<some-tags /> <?comment <!-- traditional comment 1 --> <badtag prop1="123"> <!-- traditional comment 2 --> </badtag> <!-- traditional comment 3 --> ?> <rest-of-my-tags /> 

You can use any processing instruction that's not in use. I chose "comment" as the unused processing instruction, so I started the big comment with <?comment and ended it with ?>.

Pretty much any word will do as a processing instruction, since they aren't really used most of the time. I mean, did you ever used any?

You shouldn't do it, I know. I mean, per the XML specification you aren't supposed to. Stop reading this answer. It's a hack!

Having said that... I really needed it badly, so here's the trick. Surround the section you want to comment with an unused processing instruction:

<some-tags /> <?comment <!-- traditional comment 1 --> <badtag prop1="123"> <!-- traditional comment 2 --> </badtag> <!-- traditional comment 3 --> ?> <rest-of-my-tags /> 

You can use any processing instruction that's not in use. I chose "comment" as the unused processing instruction, so I started the big comment with <?comment and ended it with ?>.

Pretty much any word will do as a processing instruction, since they aren't really used most of the time. I mean, when was the last time you used one?

added 8 characters in body
Source Link
The Impaler
  • 49.3k
  • 10
  • 50
  • 90

You shouldn't do it, I know. I mean, per the XML specification you aren't supposed to. Stop reading this answer. It's a hack! (maybewell... maybe a good one).

Having said that... I really needed it badlyI really needed it badly, so here's the trick. Surround the section you want to comment with an unused processing instruction:

<some-tags /> <?comment <!-- traditional comment 1 --> <badtag prop1="123"> <!-- traditional comment 2 --> </badtag> <!-- traditional comment 3 --> ?> <rest-of-my-tags /> 

You can use any processing instruction that's not in use. I chose "comment" as the unused processing instruction, so I started the big comment with <?comment and ended it with ?>.

Pretty much any word will do as a processing instruction, since they aren't really used most of the time. I mean, how long ago did you useever used any?

You shouldn't do it, I know. I mean, per the XML specification you aren't supposed to. Stop reading this answer. It's a hack! (maybe a good one).

Having said that... I really needed it badly, so here's the trick. Surround the section you want to comment with an unused processing instruction:

<some-tags /> <?comment <!-- traditional comment 1 --> <badtag prop1="123"> <!-- traditional comment 2 --> </badtag> <!-- traditional comment 3 --> ?> <rest-of-my-tags /> 

You can use any processing instruction that's not in use. I chose "comment" as the unused processing instruction, so I started the big comment with <?comment and ended it with ?>.

Pretty much any word will do as a processing instruction, since they aren't really used most of the time. I mean, how long ago did you use any?

You shouldn't do it, I know. I mean, per the XML specification you aren't supposed to. Stop reading this answer. It's a hack! (well... maybe a good one).

Having said that... I really needed it badly, so here's the trick. Surround the section you want to comment with an unused processing instruction:

<some-tags /> <?comment <!-- traditional comment 1 --> <badtag prop1="123"> <!-- traditional comment 2 --> </badtag> <!-- traditional comment 3 --> ?> <rest-of-my-tags /> 

You can use any processing instruction that's not in use. I chose "comment" as the unused processing instruction, so I started the big comment with <?comment and ended it with ?>.

Pretty much any word will do as a processing instruction, since they aren't really used most of the time. I mean, did you ever used any?

added 70 characters in body
Source Link
The Impaler
  • 49.3k
  • 10
  • 50
  • 90
Loading
added 5 characters in body
Source Link
The Impaler
  • 49.3k
  • 10
  • 50
  • 90
Loading
Source Link
The Impaler
  • 49.3k
  • 10
  • 50
  • 90
Loading