XML mode-vCard structure

Source: Internet
Author: User
Tags vcard
Recording contact information is very important to all business applications. capturing this information through an effective XML structure can simplify the processing of such data. The contact information may change greatly, so select XML. For example, some companies and individuals may have multiple addresses, phone numbers, and email accounts. Multiple such information fragments can be easily declared in the XML structure. VCar record contact information is very important to all business applications. capturing this information through an effective XML structure can simplify the processing of such data. The contact information may change greatly, so select XML. For example, some companies and individuals may have multiple addresses, phone numbers, and email accounts. Multiple such information fragments can be easily declared in the XML structure. VCar
Recording contact information is very important to all business applications. capturing this information through an effective XML structure can simplify the processing of such data.
The contact information may change greatly, so select XML. For example, some companies and individuals may have multiple addresses, phone numbers, and email accounts. Multiple such information fragments can be easily declared in the XML structure.
The vCard structure is often used to indicate contact information on the Internet. it is independent of the platform and can easily generate and import different applications. It supports some flexibility in the XML structure, but is actually a simple text-based format that uses declarative fields and extensions to provide information. Different from XML, the vCard format is flat text, which means that information cannot be directly added to various elements. A telephone number is a good example. it is not necessarily associated with an address, but only used as another phone number in the record.
W3 proposed a vCard format XML, which adopts the rdf xml standard for formatting and exchanging contact information. Using the RDF framework, you can retain some structured information during the declaration process. For example, the RDF standard supports describing data using packages, sequences, and substitution. The package allows you to declare an object (for example, multiple roles) multiple times and use the package when the sequence is not important. Sequences are used to define the order of objects, such as the hierarchy of personnel roles in an organization. You can select one option from the list, for example, multiple email addresses.
Listing 6 shows the virtual character Charles Perston's vCard.
Listing 6. Charles Perston's vCard

BEGIN:VCARDVERSION:3.0N:Perston;Charles;;;FN:Charles PerstonORG:Perston Technology;EMAIL;type=INTERNET;type=WORK;type=pref:null@perston.co.ukTEL;type=WORK;type=pref:01234 567890item1.ADR;type=WORK;type=pref:;;Perston House;Perston;Perstonshire;P1 0NS;UKitem1.X-ABADR:gbX-ABUID:5AE47BB6-4E0F-4558-980C-BD3066FA6154\:ABPersonEND:VCARD

Using the vCard XML standard, the same information can be expressed in the structure in listing 7.
Listing 7. Using the vCard XML standard to represent Charles Perston

  
  
   Charles Perston
   
   
   
    Perston
    
   
    Charles
    
   
   
   
    Perston House
    
   
    Perston
    
   
    Perstonshire
    
   
    P1 0NS
    
   
    UK
    
   
  
   null@perston.co.uk 
   
   
   
    Perston Technology
    
  
 

The XML format is longer, but it is easy to understand the content and the relationship between each part. This format provides more detailed information and details. For example, it is easy to find the desired country in the address. in the standard vCard output, this information is relatively hidden.
For example, it is easy to use an XPath or SAX event to extract a list of countries to understand the number of contacts in different regions.

The above is the detailed description of the vCard structure in XML mode. For more information, see other related articles in the first PHP community!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.