Solved

schema targetNamespace attribute

Posted on 2015-02-05
1
90 Views
Last Modified: 2015-02-05
Can someone please explain what this means:

It is important to remember that many XML 1.0 documents are not associated with namespaces at all. To validate these documents, it is necessary to use a schema that doesn't have a targetNamespace attribute.

What would be the problem with the schema having a targetNamespace attribute if the XML instance document isn't associated with a namespace?
0
Comment
Question by:SAbboushi
1 Comment
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
Comment Utility
the targetNamespace in a schema puts the elements declared in that schema in a namespace.
if the schema has a targetNamespace it means you need to associate the elements in the instance that needs validation by that schema with that namespace

if schema has targetnamespace "urn:com:foo"
and there is an element declaration in that schema
<xs:element name="bar">

Then

<foo:bar xmlns:foo="urn:com:foo">....
refers to the element declared in that schema by prefix binding

<bar xmlns="urn:com:foo">....
refers to the element declared in that schema by default binding

<bar>....
has no relation at all with the element declared in the schema
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now