Thursday, February 16, 2012

Tech Review Software: Wednesday, February 15, 2012

xml namespace example


  • Name conflicts
    • <table>
      • <tr>
        • <td>Apples</td>
      • </tr>
    • </table>
    • <table>
      • <name>Stan</name>
    • </table>
  • Solving name conflict using a prefex
    • <h:table>
      • <h:tr>
        • <h:td>Apples</h:td>
    • <f:table>
      • <f:name>Stan</f:name>
  • XML Namespaces - the xmlns attribute
    • namespace for prefix must be defined
    • defined by xmlns attributes in the start tag of an element.
    • xmlns:prefix="URI"
    • when a namespace is defined for an element, all child elements with the same prefix are associated with the same namespace.
    • The namespace URI is not used by the parser to look up information.
  • URI - Uniform Resource Identifier
    • identifies an Internet Resource
    • URL - uniform resource locator
      • identifies an Internet domain address
    • URN - uniform resource name
  • default namespace for an element
    • saves using prefixes in all child elements
  • root element
  • xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    • tells the XML parser that the document should be validated against a schema.
  • xsi:noNamespaceSchemLocation="shiporder.xsd"
    • specifies where the schema resides.
    • local to xml in this instance
  • XML Schema Definition (XSD)
  • Standard namespace above is (xs)
  • URI associated with namespace is the Schema language definition
  • Define all element and attributes first and than refer to them
    • ref="name"
  • Can use named types

  • XML - eXtensible Markup Language
  • XML parser
  • XML Document Object Model (DOM)
  • XSD schemas or Document Type Definitions (DTDs) to verify validity
  • XmlLite vs System.XML
  • XmlLite does not schema validation
    • use MSXML.exe
  • XmlLite Security
  • Denial of Service (DoS)


No comments: