Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use elementFormDefault and attributeFormDefault?

 
Jayadev Pulaparty
Ranch Hand
Posts: 662
  • Mark post as helpful
  • send pies
  • 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
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic