• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

6. Power XML for Web Pages > 60. Mix Content with XML Namespaces

Mix Content with XML Namespaces

An XML document can combine content of several different types.

The W3C (http://www.w3.org) XML Namespaces specification allows document syntax from several different types of XML documents to exist in one file. Firefox’s Gecko rendering engine can display some documents that are of mixed type, but not all. This hack shows combinations that are both feasible and useful.

Play with XML Namespace Syntax

Here is the syntax for namespaces. An XML document has a default namespace, which is specified by a URL. The namespace URL is different than the document definition. This XHTML 1.0 fragment shows both:

<?xml version="1.0"?>
<!DOCTYPE html PUBLIC
  "-//W3C//DTD XHTML 1.0 Strict//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"
>
<html >
...

PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint