{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

xmlAdvanced - XML Advanced Namespaces Databases and Java...

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

View Full Document Right Arrow Icon
Copyright 1999-2008 Ellis Horowitz 1 XML Advanced Namespaces, Databases and Java
Background image of page 1

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

View Full Document Right Arrow Icon
Copyright 1999-2008 Ellis Horowitz 2 XML Refers to a Combination of Technologies XML 1.0 the core specification, – http://www.w3.org/TR/REC-xml DOM, function calls for manipulating XML docs via a programming language, http://www.w3.org/TR/DOM-Level-2- Core/ XML Namespaces, http://www.w3.org/TR/REC-xml-names/ XML Schemas, http://www.w3.org/TR/xmlschema-0/ XSL, alternate way of expressing style (transform & formatting) – http://www.w3.org/TR/xsl/ – includes XSLT - transformation rules, http:// www.w3.org/TR/xslt plus other technologies – see list of XML topics on W3C home page
Background image of page 2
Copyright 1999-2008 Ellis Horowitz 3 XML Namespaces Name conflicts can arise when processing multiple XML files <table><tr><item>Apple<item>Plum</tr></table> vs <table><tr><item>Desk<item>Chair</tr></table> – above the <item> tag has different meanings Namespaces are a collection of names that can be used as element or attribute names in an XML document. The namespace qualifies element names uniquely on the Web in order to avoid conflicts between elements with the same name. The namespace is identified by some URI reference
Background image of page 3

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

View Full Document Right Arrow Icon
Copyright 1999-2008 Ellis Horowitz 4 XML Namespaces • Names from XML namespaces may appear as qualified, which means they contain a single colon, separating the name into two parts: a namespace prefix and a local part. • The prefix, which is mapped to a URI selects a namespace <table><tr><fruit:item>Apple</fruit:item></tr></table> vs <table><tr><furniture:item>Desk</furniture:item></tr></ table> • Namespaces are declared using the xmlns attribute, e.g.: <x xmlns:fruit='http://www.efruit.org/schema'> <!-- declares the fruit namespace which applies to the "x" element and its contents --> </x>
Background image of page 4
Copyright 1999-2008 Ellis Horowitz 5 Qualified Names •An example of a qualified name serving as an element type: <x xmlns:edi='http://ecommerce.org/schema'> <!-- below the 'price' element's namespace is http:// ecommerce.org/schema --> <edi:price units='Euro'>32.18</edi:price> </x> •Attributes are either namespace declarations or their names are given as qualified <x xmlns:edi='http://ecommerce.org/schema'> <!-- the 'taxClass' attribute's namespace is http://ecommerce.org/schema --> <lineItem edi:taxClass="exempt">Baby food</lineItem> </x>
Background image of page 5

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

View Full Document Right Arrow Icon
Copyright 1999-2008 Ellis Horowitz 6 Namespace Scoping The namespace declaration is considered to apply to the element where it is specified and to all elements within the content of that element, unless overridden by another namespace declaration: <?xml version="1.0"?> <!-- all elements here are explicitly in the HTML namespace --> <html:html xmlns:html='http://www.w3.org/TR/REC-html40'> <html:head><html:title>Sample</html:title></html:head> <html:body><html:p>Moved to <html:a href='http://mysite.com'>here.</html:a> </html:p></html:body> </html:html>
Background image of page 6
Copyright 1999-2008 Ellis Horowitz 7 Uniqueness of Attributes • In XML documents, no tag may contain two attributes which: – have identical names, or – have qualified names with the same local part and with prefixes which have been bound to namespace names that are identical.
Background image of page 7

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

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}