• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XML schema problem

 
Ranch Hand
Posts: 238
1
Eclipse IDE Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 2187
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 734
7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
The City calls upon her steadfast protectors. Now for a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic