Page 1 of 1

Possible bug in schema documentation generator

Posted: Sat Jul 29, 2006 6:00 pm
by bbell2000
I have a complex schema for which I'm trying to generate documentation. I'm confident that the schema is correct as we've been using it reliably to generate both C# and Java code and perform schema validation in our application.

The .xsd files are organized by version-dependent directories, i.e., module1/2006-01/module1-types.xsd, module2/2006-04/module2-types.xsd. A module may have one or more imports for common types referenced by all modules.

Using the information above as an example: when I generate documentation for module2, I get an error indicating that it is looking for an import under the 2006-04 subdirectory instead of the 2006-01 subdirectory. Iow, the problem .xsd imports from another XSD using a relative path ../module1/2006-01/module1-types.xsd, but Saxon is looking for ../module1/2006-04/module1-types.xsd.

The exact error is:

The following errors were encountered when generating schema documentation:
- Transformer Exception: net.sf.saxon.trans.DynamicError: java.io.FileNotFoundException: C:\home\bbell\k2_stable\lqmi\ues\wsapi\ues\policy-mgmt\2006-04\AuditingProfile.xsd (The system cannot find the file specified)

ues/policy-mgmt/2006-04/PolicyManagementServiceTypes.xsd imports ../../upm/2006-01/UnifiedPolicyModel.xsd which imports ./PolicyDomain.xsd which imports ./AuditingProfile.xsd.

It's my understanding that relative paths are relative to the importing schema -- in this case, it should be looking for AuditingProfile.xsd in the same directory as PolicyDomain.xsd.

Posted: Mon Jul 31, 2006 11:54 am
by sorin_ristache
Hello,

If the module inclusions are the ones which you specified then it is a bug in Saxon. Are you sure there is no inclusion path in your XML Schema from the main XSD file on which you run the schema documentation tool (I assume it is PolicyManagementServiceTypes.xsd) to C:\home\bbell\k2_stable\lqmi\ues\wsapi\ues\policy-mgmt\2006-04\AuditingProfile.xsd for which the error is reported and which really does not exist on disk ? Can you send us the schema files so that we can reproduce the error ?

Regards,
Sorin

Posted: Wed Aug 02, 2006 5:41 am
by bbell2000
I'm absolutely positive the inclusion paths are correct. I was able to temporarily get around the problem by extending the relative path a bit -- i.e., instead of "module1.xsd" which should automatically resolve to the 2006-01 subdirectory, I used "../2006-01/module1.xsd" to force it to look in the right place.

If the bug is in Saxon as you suggest, I believe I might be able to create a much smaller repro scenario for you to debug. If I find I cannot do that, I'll submit the real thing.

Posted: Wed Aug 02, 2006 9:41 am
by george
The problem should not be related to Saxon. I think it is related with the way the document function works and how the XSLT stylesheet for generating documentation obtains imported/included schema locations. Note that we use the XS3P schema documentation stylesheet with a number of fixes and enhancements. If you can get a small sample to show the problem that will be helpful.

Best Regards,
George

Posted: Fri Oct 20, 2006 10:12 am
by manuel.dorne
Ok, thanks...

My XSD doc is mainly like that:
<xs:simpleType name="AlphaUpper3To6Type">
<xs:annotation>
<xs:documentation> --------------------------------------- Maintenance: DF/2003-11-13: Comment
corrected --------------------------------------- 3, 4, 5 or 6 alpha or numeric codes (for
stations ...) The most widely used codes because of its size (for stations, points of
interests ...) --------------------------------------- </xs:documentation>
</xs:annotation>
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z0-9]{3,6}"/>
</xs:restriction>
</xs:simpleType>

i suppose the problem is --------------------- , so i delete it and it works !!! Thanks a lot !

Posted: Mon Oct 30, 2006 1:42 pm
by sorin_ristache
Hello,
manuel.dorne wrote:i suppose the problem is --------------------- , so i delete it and it works !!! Thanks a lot !
You cannot include the -- sequence of characters in xs:documentation because the xs:documentation text is displayed in the browser in a window using JavaScript which is included in the HTML page using comments. The same problem and answer is here.


Regards,
Sorin