[xsd-users] Q: schemaLocation in schema file
Boris Kolpackov
boris at codesynthesis.com
Sun Feb 9 05:12:59 EST 2014
Hi Ravi,
Rangarajan, Ravi_Sowmian <raviraja at qti.qualcomm.com> writes:
> Currently, my schema is looking for a namespace component and a location
> component in schemaLocation attribute. If location field is missing, code
> synthesis throws an exception. Since location and/or namespace fields in
> schemaLocation are optional, then I am wondering what would be the best way
> to specify schemaLocation in the schema template such that code synthesis
> parser would handle the three scenarios below properly?
Generally, it is not a good idea to rely on the schemaLocation attribute
in production applications. It is better to ignore it and specify the
location/schema from within the application. For more information on
various ways to achieve this, refer to Section 5.1, "XML Schema Validation
and Searching" in the C++/Tree Mapping Getting Started Guide:
http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#5.1
Boris
More information about the xsd-users
mailing list