• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

how to find schema of an xml from dom program at run time

 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi

i want to validate xml according to schema using dom/xom parser.at run time user passes xml and schema to be validated.
but how to find schema passed by user is correct one that is being used by xml.

i have written a program to validate xml according to schema.

but iam facing problem when user passes wrong schema that is not used by xml ,which validate xml.


please give inputs to resolve this problem.
 
Marshal
Posts: 27287
87
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're asking "Given an XML document, how can I find a schema against which it will validate successfully?" Of course there is no possible answer to that, except perhaps to produce a schema which allows all documents as valid.

If you ask the user, and the user tells you the wrong schema, then the document will be invalid. There is no way you can distinguish this case from the case where the user tells you the right schema but the document is not valid according to that schema. It's up to the user to figure out what's going on in that case, not the programmer.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic