• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

[schema] Allow an element to have any content

 
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm having trouble creating a schema where one element can have any content, i.e. within my xml, I have an element that can consist of any sub-elements. For example:


How can I define <sub1> in my schema to allow any sub-elements?
I tried playing with <xs:any>, but the validation fails on anything under <sub1>, complaining about 'unexpected element'.
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This should work:
 
Blake Minghelli
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Lasse Koskela:
This should work:

That's exactly what I tried. Unfortunately XMLSpy still reports the error: "Element 'sub1' not defined in DTD/Schema"
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Blake!.. Could you please post your complete schema snippet using UBB code tags?
 
Blake Minghelli
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Balaji Loganathan:
Blake!.. Could you please post your complete schema snippet using UBB code tags?

Here is the entire schema. The content under the "CCI_Server_Interface" is what I am trying to set up to allow any content.
Any suggestions? Thanks
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!