Xml namespaces
Download
1 / 6

XML Namespaces - PowerPoint PPT Presentation


  • 278 Views
  • Updated On :

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. TargetNamesapce. So, if I’m writing a schema for my superstore <schema ...

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'XML Namespaces' - ryanadan


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Xml namespaces l.jpg
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


Targetnamesapce l.jpg
TargetNamesapce

  • So, if I’m writing a schema for my superstore

    <schema ...

    targetNamespace=“http://www.superstore.com”

    >


Label prefixes l.jpg
Label prefixes

  • Instead of referring to URLs, namespaces are given short prefix labels

    <schema ...

    targetNamespace=“http://www.superstore.ca”

    xmlns:ebay=http://www.ebay.com

    >

    <element name=“eBayProduct” ref=“ebay:Product” />

    </schema>


Referring to xml schema schema l.jpg
Referring to XML Schema schema

  • XML Schema is an XML language itself with a schema.

    <xs:schema

    targetNamespace=“http://www.superstore.ca”

    xmlns:ebay=http://www.ebay.com”

    xmlns:xs=“http://www.w3.org/2001/XMLSchema”

    >

    <xs:element name=“eBayProduct” type=“ebay:Product”/>

    </xs:schema>


Default namespace l.jpg
Default Namespace

  • One namespace can be given no label, for convenience

    <schema ...

    targetNamespace=“http://www.superstore.ca”

    xmlns:ebay=http://www.ebay.com”

    xmlns=“http://www.w3.org/2001/XMLSchema”

    >

    <element name=“eBayProduct” type=“ebay:Product”/>

    </schema>


Declarations l.jpg
Declarations

  • Prefixes are not used when declaring names of elements or types

  • Prefixes are used when referring to elements or types

    <schema ...

    targetNamespace=“http://www.superstore.ca”

    xmlns:ebay=http://www.ebay.com”

    xmlns=“http://www.w3.org/2001/XMLSchema”

    >

    <element name=“eBayProduct” type=“ebay:Product”/>

    </schema>