skip to main |
skip to sidebar
Tech Review Software: Wednesday, February 15, 2012
xml namespace example
- Name conflicts
- <table>
- </table>
- <table>
- </table>
- Solving name conflict using a prefex
- 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
- 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
- XmlLite Security
- Denial of Service (DoS)
No comments:
Post a Comment