• 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

How to use elementFormDefault and attributeFormDefault?

 
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Balaji for the explanation. Got it. Expected the xslt processor to be little more smart by looking at the associated schemas
 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jayadev,
I changed Pentax.xsd to be -

You said -

If they lose their original namespace (and hence no more guided by their respective schema), why is the schema validator complaining when i add an extra element <jaya/> (as i mentioned in a earlier posting today on this thread) to one of the individual schemas??


In my case, XML Spy doesn't complain about anything.
Am I missing something?
Dan
 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dan,
You have
<xsd:element name="manual_adapter" type="pentax:manual_adapter_type"/> in Camera.xsd
and
<manual_adapter>
<speed>1/10,000 sec to 100 sec</speed>
</manual_adapter> in Camera.xml
Now, if you would like to verify that <speed> element in Camera.xml still respects the schema Pentax.xsd, you need to add something like shown below in Pentax.xsd -
<xsd:complexType name="manual_adapter_type">
<xsd:sequence>
<xsd:element name="speed" type="xsd:string"/>
<xsd:element name="jaya" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
The point here is that since you are referring to the pentax:manual_adapter_type in your Camera schema, you need to make changes to that complex type to see that the final xml document still respects the format laid out in the respective individual schema.
The above mentioned combination of xml doc and schema would definitely produce an error by the schema validator
reply
    Bookmark Topic Watch Topic
  • New Topic