if (dt != null) {
try {
identity = dt.ParseValue (value, NameTable, ParserContext.NamespaceManager);
- } catch (Exception ex) { // FIXME: This is bad manner ;-(
- // FIXME: Such exception handling is not a good idea.
+ } catch (Exception ex) { // FIXME: (wishlist) This is bad manner ;-(
HandleError ("Identity value is invalid against its data type " + dt.TokenizedType, ex);
}
}
if (itemDatatype != null) {
try {
itemDatatype.ParseValue (each, NameTable, ParserContext.NamespaceManager);
- } catch (Exception ex) { // FIXME: better exception handling ;-(
+ } catch (Exception ex) { // FIXME: (wishlist) better exception handling ;-(
HandleError ("List type value contains one or more invalid values.", ex);
break;
}
break;
case XmlSchemaDerivationMethod.Union:
XmlSchemaSimpleTypeUnion union = st.Content as XmlSchemaSimpleTypeUnion;
-// values = normalized.Split (wsChars);
- {
-string each = normalized;
-// foreach (string each in values) {
-// if (each == String.Empty)
-// continue;
+ {
+ string each = normalized;
// validate against ValidatedItemType
bool passed = false;
foreach (object eachType in union.ValidatedTypes) {
if (itemDatatype != null) {
try {
itemDatatype.ParseValue (each, NameTable, ParserContext.NamespaceManager);
- } catch (Exception) { // FIXME: better exception handling ;-(
+ } catch (Exception) { // FIXME: (wishlist) better exception handling ;-(
continue;
}
}
}
}
break;
- // TODO: rest
case XmlSchemaDerivationMethod.Restriction:
XmlSchemaSimpleTypeRestriction str = st.Content as XmlSchemaSimpleTypeRestriction;
// facet validation
if (validatedDatatype != null) {
try {
validatedDatatype.ParseValue (value, NameTable, ParserContext.NamespaceManager);
- } catch (Exception ex) { // FIXME: It is really bad design ;-P
+ } catch (Exception ex) { // FIXME: (wishlist) It is bad manner ;-(
HandleError ("Invalidly typed data was specified.", ex);
}
}
// Note that Schema Validity Assessment(Element) 1.2 takes
// precedence than 1.1 of that.
- // FIXME: xsi:type value should be normalized.
string xsiTypeName = reader.GetAttribute ("type", XmlSchema.InstanceNamespace);
if (xsiTypeName != null) {
+ xsiTypeName = xsiTypeName.Trim (XmlChar.WhitespaceChars);
object xsiType = GetLocalTypeDefinition (xsiTypeName);
if (xsiType == null)
HandleError ("The instance type was not found: " + xsiTypeName + " .");
object parsedValue = null;
try {
dt.ParseValue (normalized, reader.NameTable, this.ParserContext.NamespaceManager);
- } catch (Exception ex) {
- // FIXME: Such exception handling is not a good idea.
+ } catch (Exception ex) { // FIXME: (wishlist) It is bad manner ;-(
HandleError ("Attribute value is invalid against its data type " + dt.TokenizedType, ex);
}
if (attr.ValidatedFixedValue != null && attr.ValidatedFixedValue != normalized)
if (seq.SelectorMatches (this.elementQNameStack, reader) != null) {
// creates and registers new entry.
XsdKeyEntry entry = new XsdKeyEntry (seq, reader);
- seq./*NotFound*/Entries.Add (entry);
+ seq.Entries.Add (entry);
}
}
// (c) Evaluate field paths.
foreach (XsdKeyTable seq in this.keyTables) {
// If possible, create new field entry candidates.
- for (int i = 0; i < seq./*NotFound*/Entries.Count; i++) {
- XsdKeyEntry entry = seq./*NotFound*/Entries [i] as XsdKeyEntry;
+ for (int i = 0; i < seq.Entries.Count; i++) {
+ XsdKeyEntry entry = seq.Entries [i] as XsdKeyEntry;
// if (entry.KeyFound)
// FIXME: it should not be skipped for multiple key check!!
// continue;
try {
entry.FieldMatches (this.elementQNameStack, this);
- } catch (Exception ex) {
- // FIXME: Such exception handling is not a good idea.
+ } catch (Exception ex) { // FIXME: (wishlist) It is bad manner ;-(
HandleError ("Identity field value is invalid against its data type.", ex);
}
}
Uri absUri = new Uri ((this.BaseURI != "" ? new Uri (BaseURI) : null), tmp [i + 1]);
XmlTextReader xtr = new XmlTextReader (absUri.ToString ());
schema = XmlSchema.Read (xtr, null);
- } catch (Exception ex) {
- // FIXME: better exception handling...
-// HandleError ("Errors were occured when resolving schemaLocation specified schema document.", ex);
+ } catch (Exception ex) { // FIXME: (wishlist) It is bad manner ;-(
continue;
}
if (schema.TargetNamespace == null)
Uri absUri = new Uri ((this.BaseURI != "" ? new Uri (BaseURI) : null), noNsSchemaLocation);
XmlTextReader xtr = new XmlTextReader (absUri.ToString ());
schema = XmlSchema.Read (xtr, null);
- } catch (Exception ex) {
- // FIXME: better exception handling...
-// HandleError ("Errors were occured when resolving schemaLocation specified schema document.", ex);
+ } catch (Exception ex) { // FIXME: (wishlist) It is bad manner ;-(
}
if (schema != null && schema.TargetNamespace != null)
HandleError ("Specified schema has different target namespace.");