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



Siv wrote:
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.

Actually, the compiler is telling you the exact reason for the error. What you probably wish for is a message that tells you what it really is that you are trying to do and how to do it, but that is impossible as the compiler can not guess what is on your mind.

An ampersand is certainly allowed in an XML comment, but it has a special meaning. It's used to specify characters otherwise impossible to enter into XML code, so it should be followed by an identifier and a semicolon, like & or <.

When you put an ampersand in the XML comment, the compiler expects it to be followed by an identifier, by instead you put a space character after it. In light of that, I hope that you see that the compiler message is perfectly logical.

:)

If you think that todays error messages are not informative enough, you weren't around when they looked like this:

ERROR 47 IN LINE 460

;)

Your response assumes I understand XML which I never use,

Obviously you do. ;)

and have never really understood why everyone raves about it?

It's main advantage is actually that everyone raves about it. :) It's a widely spread format that is easy to read, both manually and programattically. There is nothing magical about it, it's just simple and structured, which is exactly what we need for a lot of the data exchange nowadays.

For example, I can just point someone to an url where the can get an XML file, perhaps accompanied by a short description if there is something in it that is unexpected or unusal, and the person can easily look at the file and determine how to write a program to read it. I don't have to send along a 42 page documentation of the file format, including what byte order and encoding to use, a description of the file structure, and how every single piece of information is arranged.

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.

If you want security, you should encrypt the data anyway. Protection by obstruction just offers a false sense of security, not much more.

I get the interactivity between systems as a common data language, but you can achieve the same thing with a flat file??

Yes, of course you can, but XML offers a standardised and structured way of doing that. Of course, it's a very bloated format, so there are still some things that you want to use binary files for. For example, it would not make sense to have a file with 10 million lines like this:

<pixel x="42" y="18" red="242" green="72" blue="0"/>

:)

--
Göran Andersson
_____
http://www.guffa.com
.



Relevant Pages

  • Re: Structure definitions in XML
    ... XML format for C structures/definitions. ... The standard would allow for an extension ... Since XML is ASCII, there is no need for any binary representation. ... IDEs to interoperate with any compiler ...
    (comp.std.c)
  • Re: ANN: Ada source code decorator
    ... compiler has to provide functions to access that knowledge. ... The point of ASIS is to provide a standard way to access information ... version of ASIS will specify the format, using XML. ...
    (comp.lang.ada)
  • Re: XML Comment Screwed - Possibly a bug in VB??
    ... as I said to Stephany I am not experienced in XML and certainly don't feel like I need to know it inside out to make comments in my code. ... What you probably wish for is a message that tells you what it really is that you are trying to do and how to do it, but that is impossible as the compiler can not guess what is on your mind. ... An ampersand is certainly allowed in an XML comment, but it has a special meaning. ... I don't have to send along a 42 page documentation of the file format, including what byte order and encoding to use, a description of the file structure, and how every single piece of information is arranged. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Sane Syntax
    ... vital role in the future of TeX but we need some more human friendly ... Generating well formed LaTeX2e documents from XML ... Another approach is to convert existing documents to XML format and go ... TEI, together with DocBook, are the two ...
    (comp.text.tex)
  • Re: XHTML vs HTML
    ... to be the predominant type of HTML used on the web for many years yet. ... First, it is XML. ... XHTML is also ... transformed using XSL from and into virtually *any* other data format. ...
    (microsoft.public.frontpage.programming)