lecture9

lecture9 - PIC 40A Lecture 9: XML Namespaces and XML...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: PIC 40A Lecture 9: XML Namespaces and XML Schemas A Problem with Extensibility The extensibility of XML (ability to create custom elements) can lead to naming collisions (using different elements in an XML document that have the same name). Eg Two different date elements < date >October 15, 2008</ date > < date >Dinner and Movie</ date > Solution: XML Namespaces A n XML namespace is a uniquely identifiable collection of element and attribute names Using XML namespaces can resolve naming collisions. Eg < cal:date >October 15,2008</ cal:date > < act:date >Dinner and Movie</ act:date > The prefixes cal and act specify which namespace the date element belongs to. Who creates namespaces? The XML application author creates namespaces by prefixing element names <!ELEMENT song ( xhtml:ul )> <!ELEMENT xhtml:ul ( xhtml:li , xhtml:li , xhtml:li , xhtml:li )> <!ELEMENT xhtml:li (title|artist)> <!ELEMENT title (#PCDATA)> <!ELEMENT artist (#PCDATA)> This helps avoid collisions between predefined elements and user-defined elements. Specifying namespaces The XML document author specifies an XML...
View Full Document

This note was uploaded on 03/15/2010 for the course PIC 40A taught by Professor Ouellette during the Winter '10 term at UCLA.

Page1 / 13

lecture9 - PIC 40A Lecture 9: XML Namespaces and XML...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online