0

im trying to find out whether following case is allowed:

Lets say I have following XSD:

    <?xml version="1.0"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xyz="http://www.example.com/abc" 
targetNamespace="http://www.example.com/abc" 
elementFormDefault="qualified" attributeFormDefault="qualified">

Does the following XML uses the correct namespace? (Please consider the namespace only):

<?xml version="1.0" encoding="UTF-8"?>
<def:whatever xmlns:def="http://www.example.com/abc">
  <def:adress="Street 1">

...

1 Answer 1

1

Yes it does.

(StackOverflow doesn't like short answers but I can't think of anything else worth saying.)

Sign up to request clarification or add additional context in comments.

1 Comment

And the opposite answer was already copyrighted. :-) arxiv.org/abs/1110.2832 Joke aside, @JohnWick: all top-level elements defined in a schema live in its targetNamespace. Since elementFormDefault is set to qualified, the other elements do as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.