Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML Schema

 
THANGAMANI Vaiyapuri
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is true about the following XML documents?
I.
<x xmlns:n1="http://www.w3.org"
xmlns:n2="http://www.w3.org" >
<productId a="1" a="2">1234</productId>
<productId n1:a="1" n2:a="2">5678</productId>
</x>

II.
<x xmlns:n1="http://www.w3.org"
xmlns="http://www.w3.org" >
<productId a="1" b="2">1234</productId>
<productId a="1" n1:a="2">5678</productId>
</x>

Options

Select 1 correct option.

1. I and II are valid XML document

2. I and II are invalid XML document

3. I is invalid XML document but II is valid

4. I is valid XML document but II is invalid

I have come across this question in XYZWS Mock exam. The answer is 3.

I dont understand why II is valid. Please explain.

Thanks,
Thangamani
 
Jim Janssens
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Namespace spec 6.3

 
Harsha Jay
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In addition to what Jim explained, the most important thing is that the default namespaces does not apply to the attributes.

Reference

Harsha
 
THANGAMANI Vaiyapuri
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Harsha and Jim!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic