Home > Ask the SOA Experts > Questions & Answers > In XML comments, two consecutive -- are not allowed. Why?
Ask The SOA Expert: Questions & Answers
EMAIL THIS

In XML comments, two consecutive -- are not allowed. Why?

Sean McGrath EXPERT RESPONSE FROM: Sean McGrath

Pose a Question
Other SOA Categories
Meet all SOA Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 06 April 2004
In XML comments, two consecutive -- are not allowed. Why?

>
This restriction dates back to the SGML days.
In SGML, the comment start string "<!-- hello world-->" is actually a combination of five things. The first bit is "<!" and is known as "Markup declaration open" or "mdo" for short. The second bit is "--" and is known as "comment delimiter" or "com" for short. Then comes the string "hello world". The fourth piece is "--" which is "com" again. The final, fifth piece is ">" which is known as "markup declaration close" or mdc for short.

In SGML the full comment "<!-- hello world -->" is seen by the parser as:
MDO COM hello world COM MDC.

So, the reason for the restriction on "--" is that as far as the parsing rules are concerned, the "--" is the delimiter of a comment and so cannot occur within one.

Consideration was taken to removing this restriction during the early days of discussions about the shape of XML but it was decided to leave it as is eventually.


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
XML and XML schema
What's the future of XML?
SOA pattern of the week (#7): policy centralization
Try XML-based Extensible Business Reporting Language (XBRL) for accounting reports
What's new at the W3C
Ganymede: Modeling tools target SOA, UML
Data services mashups emerge for SOA
Making sense of data services mashups
XML turns 10
SOA helps save 100-year-old business
Oracle maps heterogeneous data services strategy for SOA

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
class diagram  (SearchSOA.com)
Fast Infoset (FI)  (SearchSOA.com)
GeoRSS  (SearchSOA.com)
Keyhole Markup Language  (SearchSOA.com)
RELAX NG  (SearchSOA.com)
state diagram  (SearchSOA.com)
Universal Business Language  (SearchSOA.com)
Vector Markup Language  (SearchSOA.com)
XML infoset  (SearchSOA.com)
XML pipeline  (SearchSOA.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



SOA Governance White Papers - BPM, EDA, IT Governance
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2001 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts