简体   繁体   中英

What does <x:div> mean in HTML?

In HTML, you can denote a simple element tag as such. <div></div> . But I am seeing in code something like, <x:div></div> .

Can anyone tell me roughly what that 'x' means? I can't seem to find information on it simply because I don't know how to describe it properly.

This sort of syntax is very rare in HTML, but occurs pretty commonly in XML (XML and HTML are very similar languages, both based on a standard called SGML ). In your example, "x" is an example of a namespace.

Namespaces are used in SGML-based languages for ensuring that two unrelated types of elements don't have naming conflicts. You can read more about them here (or, if that link ever goes dead, search for "xml namespaces").

EDIT: Upon further consideration, what you probably are looking at is an example of XSLT . XSLT is a way of styling XML documents to transform them into other formats such as HTML. Here's a good intro to XSLT .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM