Possible bug in schema documentation generator

Having trouble installing Oxygen? Got a bug to report? Post it all here.
bbell2000
Posts: 2
Joined: Sat Jul 29, 2006 5:37 pm

Possible bug in schema documentation generator

Post 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.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
bbell2000
Posts: 2
Joined: Sat Jul 29, 2006 5:37 pm

Post 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.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post 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
manuel.dorne
Posts: 9
Joined: Thu Oct 19, 2006 5:31 pm

Post 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 !
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post 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
Post Reply