XML syntax – PB Docs 2017

XML syntax

There are a few more restrictions on XML than on HTML; they make
parsing of XML simpler.

Tags cannot be omitted

Unlike HTML, XML does not allow you to omit tags. This
guarantees that parsers know where elements end.

The following example is acceptable HTML, but not XML:

To change this into well-formed XML, you need to add all the
missing end tags:

Representing empty
elements

Empty elements cannot be represented in XML in the same way they
are in HTML. An empty element is one that is not used to mark up data,
so in HTML, there is no end tag. There are two ways to handle empty
elements:

  • Place a dummy tag immediately after the start tag. For
    example:

  • Use a slash character at the end of the initial tag:

    This tells a parser that the element consists only of one
    tag.

XML is case sensitive

XML is case sensitive, which allows it to be used with non-Latin
alphabets. You must ensure that letter case matches in start and end
tags: <MyTag> and </Mytag> belong to two different
elements.

White space

White space within tags in XML is unchanged by parsers.

All elements must be
nested

All XML elements must be properly nested. All child elements
must be closed before their parent elements close.


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x