Re: XML Comment Screwed - Possibly a bug in VB??

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



The whoule point is that youre not writing a comment.

You are writing an XML comment and there is a big difference.

A comment is all the text, on a line, that follows a single '

An XML comment is a block of text where each line starts ith ''' (3) and otherwise contains well-formed XML.

If all you want to do is have readable comments in your code then just use comments.

If you want to produce documentation, using the built-in mechanism, or provide intellisense then you need to use XML comments and to use them you MUST follow the syntax rules.

It is your choice, but don't blame the product when your syntax is not correct.


"Siv" <g@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:e5RHsStzIHA.4004@xxxxxxxxxxxxxxxxxxxxxxx
Stephany,
I didn't say I didn't know it was XML I said I didn't "understand" it. I am aware that the the comments system used by VB.NET uses XML but that doesn't mean I understand its internal working. You seem to be indicating that I should? I am aware that my car uses an internal combustion engine but I wouldn't dare mess with its internal workings or know everything about how it works. I feel the same about comments. I have always used comments as a way of letting others (or indeed myself when returning to code I haven't worked on in a long time), know how a procedure works and any assumptions that I have made when processing through it.

Using XML in comments was forced on me by MS when they designed the new commenting system, and don't get me wrong, I like the fact that when I start to type a call to the commented procedure it starts to tell me the meanings of the parameters etc. To me this is just a bit of internal working of VB.NET, not something I can manipulate other than by using its advertised mechanisms. I have yet to fathom out how I turn these comments into documentation for my project which I am sure I can do, but have so far been totally unable to find out how??

To me there is a bug in the parser if it tells a (non XML understanding) VB user that there is a problem with whitespace in the comment when in fact it's a problem with you having inserted an ampersand??

Siv


"Stephany Young" <noone@localhost> wrote in message news:ORlPtFtzIHA.4004@xxxxxxxxxxxxxxxxxxxxxxx
Again, by your own words, earlier you were insering an XML comment, so saying that you didn't know it was XML just doessn't cut it.

It told you the exact reason for the warning, viz. whitespace not allowed at that location. You had a space character directly following an & character and that is not allowed in XML.

The use of XML comments, reasonably, expects the author to be able to write wel-formaed XML. If you are not comfortable with XML then don't use XML comments.


"Siv" <g@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:26255397-EBF0-42A2-9BAF-765B82D79CDB@xxxxxxxxxxxxxxxx
Hi,
Ok "Warning" I must be more precise. However, I think when I am entering a comment in my code and it "warns" me that "whitespace is not allowed at this location .." when in fact it should say "Ampersand not allowed in VB comment" it's more like a bug in VB as it is not telling me the true reason for the error.

Your response assumes I understand XML which I never use, and have never really understood why everyone raves about it? It just seems a bit insecure as a method of holding or transmitting data as it's just plain text that can be intercepted and read as such. I get the interactivity between systems as a common data language, but you can achieve the same thing with a flat file??

Siv



"Stephany Young" <noone@localhost> wrote in message news:uh%23yVlozIHA.2292@xxxxxxxxxxxxxxxxxxxxxxx
1. It's NOT an error - It is a warning!
They are totally different things.

2. & is the escape character in XML.
If you wish to include an & in XML then you need
to specify it as &amp;


"Siv" <g@xxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:0CF67692-E4BF-487D-B96C-C794E7785FAD@xxxxxxxxxxxxxxxx
Hi,

Just busily coding away and removed a procedure from my code and all of a sudden an error came up miles away from the location of the piece of code I removed and it relates to the XML comment inserted at the top of the procedure.

I had this happen once before and I couldn't fathom why it was complaining, the XML comment is like this:

''' <summary>
''' If the Bonds flag is set in the security record we have at least one Bond & Floating Charge
''' This routine locates the bonds that are linked to the Security Record and adds them as sub nodes to
''' the main Bonds node.
''' </summary>
''' <param name="ParentNode"></param>
''' <remarks></remarks>

This gives an error:

"Warning 1 XML documentation parse error: Whitespace is not allowed at this location. XML comment will be ignored. "

I then discovered if I remove the "&" ampersand symbol the error message goes away???

Is this a "by design" thing or is this a bug in the XML comments??

Siv







.



Relevant Pages

  • Re: XML::LibXML::Node nextSibling()
    ... >> Faszinierend. ... Das tut es bei mir nicht, denn die Dokumentinstanz ... In .NET wird der Whitespace wohl per ... In einem eher text-artigen XML würde ...
    (de.comp.lang.perl.misc)
  • Re: XML Comment Screwed - Possibly a bug in VB??
    ... Your response assumes I understand XML which I never use, and have never really understood why everyone raves about it? ... ''' If the Bonds flag is set in the security record we have at least one Bond & Floating Charge ... "Warning 1 XML documentation parse error: Whitespace is not allowed at this location. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Controlling whitespace in XSL output - tutorial anywhere?
    ... HTML or something else where the whitespace doesn't matter, ... I'd really greatly prefer it if things (i.e. not XML parsers ... I agree that's a Hibernate issue and not an XML ... >white space inside attribute values. ...
    (comp.text.xml)
  • Whitespace-preservating Search & Replace in multiple XML documents
    ... I am looking for a way to search and replace some strings inside various ... XML documents while at the same time binary-preserving all the ... What guarantee do I have on binary-preservation of all whitespace? ...
    (comp.text.xml)
  • Re: How to avoid entitized characters in XML column
    ... I inserted data with whitespace in XML column and the space is ... Is there any other way to avoild entitized string? ... performance problem when we need to convert whole XML document into string ...
    (microsoft.public.sqlserver.xml)