XML Namespaces - PowerPoint PPT Presentation

About This Presentation
Title:

XML Namespaces

Description:

http://www.ebay.com. http://www.amazon.com. http://www.superstore.ca. TargetNamesapce ... targetNamespace='http://www.superstore.com' Label prefixes ... – PowerPoint PPT presentation

Number of Views:38
Avg rating:3.0/5.0
Slides: 7
Provided by: Eri753
Category:
Tags: xml | namespaces

less

Transcript and Presenter's Notes

Title: XML Namespaces


1
XML Namespaces
  • Each schema file associated with a URL to
    uniquely identify where elements come from
  • Like packages in Java

http//www.ebay.com
http//www.amazon.com
http//www.superstore.ca
2
TargetNamesapce
  • So, if Im writing a schema for my superstore
  • ltschema ...
  • targetNamespacehttp//www.superstore.com
  • gt

3
Label prefixes
  • Instead of referring to URLs, namespaces are
    given short prefix labels
  • ltschema ...
  • targetNamespacehttp//www.superstore.ca
  • xmlnsebayhttp//www.ebay.com
  • gt
  • ltelement nameeBayProduct refebayProduct
    /gt
  • lt/schemagt

4
Referring to XML Schema schema
  • XML Schema is an XML language itself with a
    schema.
  • ltxsschema
  • targetNamespacehttp//www.superstore.ca
  • xmlnsebayhttp//www.ebay.com
  • xmlnsxshttp//www.w3.org/2001/XMLSchema
  • gt
  • ltxselement nameeBayProduct
    typeebayProduct/gt
  • lt/xsschemagt

5
Default Namespace
  • One namespace can be given no label, for
    convenience
  • ltschema ...
  • targetNamespacehttp//www.superstore.ca
  • xmlnsebayhttp//www.ebay.com
  • xmlnshttp//www.w3.org/2001/XMLSchema
  • gt
  • ltelement nameeBayProduct typeebayProduct/gt
  • lt/schemagt

6
Declarations
  • Prefixes are not used when declaring names of
    elements or types
  • Prefixes are used when referring to elements or
    types
  • ltschema ...
  • targetNamespacehttp//www.superstore.ca
  • xmlnsebayhttp//www.ebay.com
  • xmlnshttp//www.w3.org/2001/XMLSchema
  • gt
  • ltelement nameeBayProduct typeebayProduct/gt
  • lt/schemagt
Write a Comment
User Comments (0)
About PowerShow.com