• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is this valid XML ?

 
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
following snippet is taken from workflow pdf manual ts.670.wf.pdf , page 62. Its a TeamSite development manual.




in this snippet, root element is 'template_script' but then again there is another 'workflow' element. so how there be an element outside root element ? As per xml syntax rules , all the elements have to be within root elemrnt only.

Can we have a code or CDATA anywhere in the xml doc ? inside or outside root element ? If I put a code at the beginning of the document as follows is it allowed ?



Please explain this syntax about elements outside root element.

thanks
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. No elements can exist outside the root element, trailing elements will probably be ignored by parsers.
2. Starting with any tag except <?xml will probably lead to an error although parsers may tolerate a document that starts with the root element - as you would discover by trying it. Even a single leading space will cause a parser error.

3. Hiding XML inside CDATA can lead to mysterious and hard to find bugs.

Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic