Blogz
Sign in to join Michael Dupre's fan club.

The Best Way For You To Produce Legitimate Names in XML

by Michael Dupre(2)


Hello there, i'm Jonathan Kaye. Thank you for visiting my '5 minute XML' series the place I offer you regular byte size guides.

Today's issue is actually for people who are not used to XML.

For regularity, the policies when it comes to constructing a valid attribute name are the same as those intended for forming valid element names and for the names of numerous less popular constructs. Collectively I refer to these as XML names. XML names may contain characters while in the ranges [A-Z, a-z and 0-9].

They will often also include none English letters, numbers as well as ideograms. XML names might also include an underscore, hyphen or period. A legitimate XML name may only start with a letter, ideogram and even underscore. It may possibly not start with a number hyphen or period. Element lengths usually are endless.

The next element names are all valid:

[Drivers_No]0000222[/Drivers_No]

[day-month-year]20/04/2011[/day-month-year]

[_4-bit]1010[/_4-bit]

[first-name]Peter[/first-name]

The below element names are all invalid:

[Driver's_No]0000222[/Driver's_No]

[day/month/year]20/04/2011[/day/month/year]

[4-bit>1010[/4-bit]

[first name>Peter[/first name]

Within the first line, the element name has an apostrophe. In the second line the element name has a forwards slash. While in the third line the element name begins with a numeric and in the fourth, the element name contains a space. These are illegal XML names.

Exactly how namespaces work is that each element (or attribute) classification is designated a prefix. This is certainly apart from what is referred to as the ‘local part’ of the name, with a single colon (as shown above). It's common procedure to associate a prefix with a URI (or Uniform Resource Indicator).

The most common form is a URL (or Uniform Resource Locator). The URI is not used for lookup via the internet. It's usage is solely to identify a set of data objects individually and since URI’s are utilized globally they are ideal for the job. URI’s are bound to a namespace prefix utilizing the

xmlns:prefix="URI".

Typically the prefix and also full URI definition usually are not interchangeable as URI’s could contain characters that can be illegal in an XML namespace. Additionally it is illegal make use of the three letters XML regardless combination for a namespace prefix for the reason that these are reserved.

Be aware: XML is an abbreviation for eXtensible Mark-up Language. It is just a mark-up language, not really programming language. Its purpose commonly to explain a class of data objects labeled as an XML Document. Data files is often as complicated or as basic as is essential. A large cornucopia of information is available on XML for individuals who would choose to learn more. For your definitive guide, visit www.W3.org.

I'm hoping the above is beneficial to someone reading. More content is going to be coming shortly.

Jonathan Kaye is truly an skilled practitioner in XML programming as well as XML standards and has an abundance of working expertise in XML Editor and also practical know how with XML Schema Editor.


Article submitted Wednesday, June 29, 2011 & read 7 times.

Leave your comments through Blogz:


No comments yet.
2-0-0-0-2-ADSO
Copyright © 2012 IcoLogic, Inc.
Page viewed from Cache.
Page load time: 0.008 seconds.