• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Dynamic creation of xml document from xml schema

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to dynamically create a valid xml document from xml schema? I mean - xml schema is unknown at compile time, lets assume that we put file path or url of xml schema at runtime, and application creates valid xml document with some default values...
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basically that is impossible because a Schema defines what structure is legal but does not completely define a document.

Just think how many possible documents can be created fitting a single schema.

Bill

 
Marshal
Posts: 27211
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
I have never understood why anybody would want to do that. But I see this question a lot, so there must be some reason for it. However the people who ask the question never bother to explain why they need it so I am still baffled.

Anyway pretty much all of the XML editing tools on the market have that as a feature, I believe. I suppose they must be getting the same demand from their customers. Check them out. Google keywords: xml editor.
 
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
Right, some of the code generation tools (like IDEs) do this - they create a skeleton xml file from the xsd. And like any other auto-generated code, this too needs further manual edits to make the xml practically useful for any application specifics. But outside code generation, I don't see where auto generation of xml from a schema might be applicable.
 
Message for you sir! I think it is a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic