Google Группы больше не поддерживают новые публикации и подписки в сети Usenet. Опубликованный ранее контент останется доступен.

The Correct Way To Be Able To Write Valid Names in XML

5 просмотров
Перейти к первому непрочитанному сообщению

sarah...@yahoo.co.uk

не прочитано,
3 июл. 2015 г., 14:35:2203.07.2015
Just for consistency, the principles with regards to making a valid attribute name overlap with those intended for producing valid element names and for the names of quite a few lesser known constructs.

Collectively I reference these as XML names. XML names could have characters within the ranges [A-Z, a-z and 0-9]. They will often likewise incorporate none English letters, numbers and ideograms. XML names may feature an underscore, hyphen or full stop.

A valid XML name could start with a letter, ideogram or maybe underscore. It may possibly not start out with a number hyphen or period. Element lengths usually are unrestricted.

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]

While in the 1st line, the element name carries an apostrophe. While in the second line the element name has a ahead slash. Inside third line the element name starts with a numeric and in the fourth, the element name contains a space. Each of these are actually illegal XML names.

Exactly how namespaces work is that each element (or attribute) classification is allocated a prefix. This is certainly segregated from what is called the 'local part' of the name, with a single colon (as indicated above).

It's quite common procedure to couple a prefix with a URI (or Uniform Resource Indicator). The commonest form is a URL (or Uniform Resource Locator).

The URI is not used for lookup over the web. It's adoption will be strictly to distinguish a set of data objects individually and since URI's are used world-wide perfect for the job. URI's are bound to a namespace prefix utilizing the

xmlns:prefix="URI".

The actual prefix plus the full URI definition won't be interchangeable as URI's can easily have characters that happens to be illegal in an XML namespace. It's also illegal to use the three letters XML at any rate combination for a namespace prefix because they are generally reserved.

Note: XML is an abbreviation for eXtensible Mark-up Language. It's a mark-up language, as opposed to a programming language. Its function ought to illustrate a class of data objects referred to as an XML Document.

File types could be as complicated or as simple as becomes necessary. A wealth of details are available on XML for people who would want to discover more. For the definitive guide, visit www.W3.org.

http://www.liquid-technologies.com/xml.aspx







































0 новых сообщений