Yevgeny Simkin
Yevgeny Simkin

Reputation: 28389

there's no way to comment inside an xml node, right?

I'm almost positive the answer is "no" but just to be sure... there's no syntactical mechanism for commenting out portions of stuff inside an XML node, right?

In other words something like

<myNode
//this is not being looked at
attributeFoo = "bar"
//this is also being ignored
/> 

I'm only asking because there is now SO much stuff that goes into Android's xml nodes that it would be nice to be able to comment stuff out, and/or label things... but I suspect I'm out of luck here...

Upvotes: 2

Views: 413

Answers (4)

Ry-
Ry-

Reputation: 225124

No.

There isn't. You can only put comments outside of tags. The closest thing to it is probably:

<myNode
 throwAway1="This is not being looked at"
 attributeFoo="bar"
 throwAway2="This is also being ignored"
/>

Or just use normal comments.

Upvotes: 3

Mihai
Mihai

Reputation: 2865

No, XML does not allow comments inside markup.

Upvotes: 1

MByD
MByD

Reputation: 137392

You cannot comment inside a tag, but you can wrap a tag as a comment, I have found it helpful many times:

<!-- <Activity></Activity> --> 

source: http://www.w3.org/TR/REC-xml/#sec-comments

Upvotes: 1

ByteMe
ByteMe

Reputation: 1476

Unfortunately no. You can have a comment node... but that is as close as you can get

<!-- Comment! -->

Upvotes: 1

Related Questions