Solved

schema targetNamespace attribute

Posted on 2015-02-05
1
93 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
VB.NET and XML parsing 6 66
replace quotes with UTF-8 character 38 86
XML filtering Windows Event Viewer 10 48
SQL XML ALL Nodes Compare in function 2 18
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
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 …

867 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

21 Experts available now in Live!

Get 1:1 Help Now