Further info on validation issue

MURATA Makoto (FAMILY Given) eb2m-mrt at asahi-net.or.jp
Tue Aug 4 14:45:17 CEST 2009


> As an aside, the schemas have to manually edited before they will work
> with Xerces also (this is related to the declaration of the 'xml'
> Namespace IIRC). I have a defect report brewing to this effect ...

I avoided the problem by specifying the property of the namespace:

"http://apache.org/xml/properties/schema/external-schemaLocation"

But I do not know if this approach is common.  I'm no expert of XSD.

Here is my code fragment:

		String schemaLocation = "http://schemas.openxmlformats.org/package/2006/content-types "
				+ DEFAULT_WXS_OPC_PATH
				+ "opc-contentTypes.xsd "
				+

				"http://schemas.openxmlformats.org/package/2006/relationships "
				+ DEFAULT_WXS_OPC_PATH
				+ "opc-relationships.xsd "
				+

				"http://schemas.openxmlformats.org/package/2006/metadata/core-properties "
				+ DEFAULT_WXS_OPC_PATH
				+ "opc-coreProperties.xsd "
				+
				
				"http://schemas.openxmlformats.org/wordprocessingml/2006/main "
				+ DEFAULT_WXS_NOPC_PATH
				+ "wml.xsd "
				+

				"http://schemas.openxmlformats.org/presentationml/2006/main "
				+ DEFAULT_WXS_NOPC_PATH
				+ "pml.xsd "
				+

				"http://schemas.openxmlformats.org/spreadsheetml/2006/main "
				+ DEFAULT_WXS_NOPC_PATH
				+ "sml.xsd "
				+

				"http://schemas.openxmlformats.org/drawingml/2006/picture "
				+ DEFAULT_WXS_NOPC_PATH
				+ "dml-picture.xsd "
				+

				"http://schemas.openxmlformats.org/drawingml/2006/main "
				+ DEFAULT_WXS_NOPC_PATH
				+ "dml-main.xsd "
				+

				"http://schemas.openxmlformats.org/officeDocument/2006/extended-properties "
				+ DEFAULT_WXS_NOPC_PATH
				+ "shared-documentPropertiesExtended.xsd "
				+

				" http://schemas.openxmlformats.org/drawingml/2006/main "
				+ DEFAULT_WXS_NOPC_PATH
				+ "dml-main.xsd "
				+

				"http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing "
				+ DEFAULT_WXS_NOPC_PATH
				+ "dml-spreadsheetDrawing.xsd "
				+

				"http://schemas.openxmlformats.org/drawingml/2006/chart "
				+ DEFAULT_WXS_NOPC_PATH + "dml-chart.xsd "
				+
				
				"http://purl.org/dc/elements/1.1/ " 
				+ DEFAULT_WXS_LIBARAY_PATH
				+ "dc.xsd "
				+

				"http://purl.org/dc/terms/ "
				+ DEFAULT_WXS_LIBARAY_PATH
				+ "dcterms.xsd "
				+ 
				
				"http://purl.org/dc/dcmitype/ "
				+ DEFAULT_WXS_LIBARAY_PATH
				+ "dcmitype.xsd "
				+ 

				"http://www.w3.org/XML/1998/namespace "
				+ DEFAULT_WXS_LIBARAY_PATH
				+ "xml.xsd ";

		if (vmlValidation) {
			schemaLocation += "urn:schemas-microsoft-com:vml "
					+ DEFAULT_WXS_NOPC_PATH + "vml-main.xsd ";
		}

		try {
			parser.setProperty(EXTERNAL_SCHEMALOCATION_ID, schemaLocation);
		} catch (SAXException e) {
			System.err.println("could not set parser property");
		}


Cheers,
Makoto



More information about the sc34wg4 mailing list