• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML schema problem

 
Sudhanshu Mishra
Ranch Hand
Posts: 238
1
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I just started to study XML schemas and I am facing a doubt regarding namespaces in xml schema:
1:How does the parser know what are the defined elements in the namespace if namespaces themselves do not point to any physical location.i.e in below declaration
"xs: http://www.w3.org/2001/XMLSchema ",how does the parser knows that <xs:element> is valid declaration.
2:when we say <xs:element name="name" type="xs:string">,then "type" attribute belongs to which namespace,as it is not prefixed with anything?

Thanks.
 
Jimmy Clark
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try to use your parser with the following declaration in your XML Schema and see what happens.

"xs:dsfklnsdaklfnsdkljnvxchvosdfhuigvsvn/XMLSchema"
 
Sudhanshu Mishra
Ranch Hand
Posts: 238
1
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jimmy,
Thanks for the reply.I got my answer for the first question,but what about second question?Please be patient with me if it's a silly one.
Waiting for the reply.

Thanks...
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sudhanshu Mishra wrote:
I got my answer for the first question,but what about second question?


Read this article on namespaces.
 
g tsuji
Ranch Hand
Posts: 666
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2:when we say <xs:element name="name" type="xs:string">,then "type" attribute belongs to which namespace,as it is not prefixed with anything?

The type attribute, just like the name attribute, is in null (or sometime said empty for the same) namespace. But these attributes are somehow ontologically "attached" to the element (xs:element) they are "describing" (if you are somehow knowing the rudiment of renaissance philosophy, that might help a bit), their schema is normally appearing in the schema defining the xs namespace (that is the schema or schema). Does it make thing clearer? I think you might think, hell no! Maybe you might come back to it when time comes.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic