C
craig.wagner
I have a situation where I need to carry additional information in an
XML Schema. What I've found to appear to work is doing something like
the following:
<xs:schema xmlns:xs=" http://www.w3.org/2001/XMLSchema"
xmlns:xx="http://www.mycompany.com">
<xs:complexType name="SomeType">
<xs:sequence>
<xs:element name="AccountNumber" type="xs:int"
xx:errorAction="fail"/>
<xs:element name="AccountName" type="xs:string"
xx:errorAction="truncate" xx:length="25"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
This appears to work just fine. One thing I'm wondering though is how,
or if it's possible, to ensure that the xx: stuff that gets put in
falls within the rules we define. For example, the only valid
attributes are xx:errorAction and xx:length, xx:errorAction must be
part of a finite set (null, fail, truncate), and xx:length must be > 0.
We could live without doing this if it's going to be an excessive
amount of work, but if it's reasonable to do so it'll make the app more
bullet-proof.
Pointers or thoughts would be appreciated.
XML Schema. What I've found to appear to work is doing something like
the following:
<xs:schema xmlns:xs=" http://www.w3.org/2001/XMLSchema"
xmlns:xx="http://www.mycompany.com">
<xs:complexType name="SomeType">
<xs:sequence>
<xs:element name="AccountNumber" type="xs:int"
xx:errorAction="fail"/>
<xs:element name="AccountName" type="xs:string"
xx:errorAction="truncate" xx:length="25"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
This appears to work just fine. One thing I'm wondering though is how,
or if it's possible, to ensure that the xx: stuff that gets put in
falls within the rules we define. For example, the only valid
attributes are xx:errorAction and xx:length, xx:errorAction must be
part of a finite set (null, fail, truncate), and xx:length must be > 0.
We could live without doing this if it's going to be an excessive
amount of work, but if it's reasonable to do so it'll make the app more
bullet-proof.
Pointers or thoughts would be appreciated.