Hot answers tagged

3

There are some confusing aspects to your XML, and some practices that you may end up appreciating..... Technical Your XML is valid, but it does not follow best practices. The XML: <con gurd="min>b" type="if"> This should be written: <con gurd="min&gt;b" type="if"> Even though your XML is ...


2

I have to admit it's been (thankfully) a while since I worked with XSD. A few random points: I would rename your max60Integer to "max59integer", since the maximum of 60 is excluded; Age is defined as a positive integer in your schema: <xs:element name="age" type="xs:positiveInteger"/ - but your C# code allows it to be 0 (less restrictive than the schema)...


2

/** * Retrieves the XML schema definition using an XSD. * * @param node The document (or child node) to traverse seeking processing * instruction nodes. * @return null if no XSD is present in the XML document. * @throws IOException Never thrown (uses StringReader). */ private static String getSchemaURI( Node node ) throws IOException { ...


2

Overall your structures look OK. Your actual XML document could be indented more neatly, but it's OK. I would recommend that you change your stars element to have an attribute. Using the PCDATA space is not a great place to put a numeric value.... Actually, I would recommend adding a stars attribute to the thoughts element (seems like a logical place to put ...


2

I would move PackageName and Name elements of the AbstractProcedureType to attributes. I don't think you need an AbstractProcedureType, just have a ProcedureType and FunctionType derived from it. it's not clear why ArgumentsType may have either 0 or 1 argument... I would say that it should have maxOccurs="unbounded" I would make Arguments element optional in ...


1

The code is not bad but it could be better. These are my suggestions: /* ---------------------- Write the files ---------------------- */ BuildCsFiles(new DirectoryInfo(basepath) .EnumerateFiles() .Where(x => x.Extension.Contains("cs")) .Select(y => y.FullName).ToList()); ...


Only top voted, non community-wiki answers of a minimum length are eligible