Schema Documentation not working with xs:include

Having trouble installing Oxygen? Got a bug to report? Post it all here.
ecotsonas
Posts: 1
Joined: Wed May 19, 2004 8:27 pm

Schema Documentation not working with xs:include

Post by ecotsonas »

I am attempting to generate the schema documentation in version 4.0, (Tools -> Schema Documenation). When check the "Search Included Schemas" box and then attempt to generate the documentation an error message is being raised. Is this a bug or am I doing something wrong?

The message is: Transformer Exception: Processing terminated by xsl:message at line 202

Here is the main snipit with the xs:include:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="dataTypes.xsd"/>
<!-- -->
<!-- Provider Type -->
<!-- -->

Here is the file to be included, (both files are in the same directory):
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- -->
<!-- Date Time Type -->
<!-- -->
<xs:complexType name="DateTimeType">
<xs:sequence>
<xs:element name="Date" type="xs:date" minOccurs="1" maxOccurs="1"/>
<xs:element name="Time" type="xs:time" minOccurs="0" maxOccurs="1" default="00:00:00"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

The Schema documentation tool is a wrapper around the Titanium-XS3P project [1] please refer to that for details. The processing for the included files means that there will be generated links to the documentation files corresponding to the included schemas. To make this work you must provide also a links file. See an example below assuming we have two schema file schema1.xsd and dataTypes.xsd located in a directory d:\test\current.

schema1.xsd

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:include schemaLocation="dataTypes.xsd"/>
<xs:element name="test" type="DateTimeType"/>
</xs:schema>
dataTypes.xsd

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- -->
<!-- Date Time Type -->
<!-- -->
<xs:complexType name="DateTimeType">
<xs:sequence>
<xs:element name="Date" type="xs:date" minOccurs="1" maxOccurs="1"/>
<xs:element name="Time" type="xs:time" minOccurs="0" maxOccurs="1" default="00:00:00"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
The links file should be created and placed for instance in the same directory.

links file named links.xml

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<links xmlns="http://titanium.dstc.edu.au/xml/xs3p">
<schema file-location="schema1.xsd" docfile-location="schema1.html"/>
<schema file-location="dataTypes.xsd" docfile-location="dataTypes.html"/>
</links>
Then the SchemaDocumentation option is used to generate twice documentation, first for schema1.xsd savind the result to schema1.html and then for dataTypes.xsd saving the result to dataTypes.html. In the first case the "Search included schemas" option must be set and the "Links file" field should point to the links.xml file (there you should enter an URL - file:///D:/test/current/links.xml for instance in this case).

In the end the schema1.html will contain links to the dataTypes.html - the references to DateTimeType will link to the corresponding definition in the dataTypes.html file.

[1] http://titanium.dstc.edu.au/xml/xs3p/index.shtml

Hope that helps,
George
bingo
Posts: 3
Joined: Fri Apr 09, 2004 1:50 am

Post by bingo »

I had the same problem yesterday and it took me forever to figure out what was not working...

When, in the "Schema Documentation" dialog, you bring the file browser to specify the Links file, I didn't realize that the software never appended the "file:" in front of the resulting file path. So you think the software was ok and I wasn't, but in fact, the link file path given to the schema documentation generator was wrong in the first place.

I'm running on Win2000 and my files are on a LINUX account. Once a file is selected, the file browser will give something like :
\\users\Bingo\Links.xml
instead of (which seems to be expected...)
file://users/Bingo/Links.xml

No warning are provided to tell you that something was wrong.

Also, in your answer to this post, I understood that when 2 files are in the Links.xml, they will both get generated at the same time. This is not the case and would be a nice addition if instead of specifying one single input xsd file at the time, we could process a bunch of files at the same time. In the meantime, it's easier for me to use my good-old makefile on LINUX and generate the documentation for all *.xsd files I need (which takes a few seconds for all my files)

Bing
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

The first part (file paths instead of URLs) will be fixed in the 4.1 release.
The last part, a simpler way of generating the documentation for multiple schemas was added on our bugzilla and will be implemented in a future release.

Best Regards,
George
Post Reply