Solved

schema targetNamespace attribute

Posted on 2015-02-05
1
96 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
ID: 40592058
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Path of Workbook 3 79
XSLT list item selection criteria not working 12 31
What language/protocol is the Angular Chat? 2 77
Randomize in Owl Carousel v1.3.2 6 46
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
The viewer will learn how to count occurrences of each item in an array.

832 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