Project

Profile

Help

Bug #2750

closed

Setting of fileExtension on configuration file does not take effect

Added by O'Neil Delpratt almost 8 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Category:
Internals
Sprint/Milestone:
-
Start date:
2016-05-17
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.7
Fix Committed on Branch:
9.7, trunk
Fixed in Maintenance Release:
Platforms:

Description

Given the following command:

java -classpath saxon9ee.jar net.sf.saxon.Transform -config:config.xml -it:main -t -xsl:test.xsl

It seems like setting the resource fileExtension mapping in the config file does not take effect:

<configuration edition="EE" xmlns="http://saxon.sf.net/ns/configuration">
	<global expandAttributeDefaults="false" validationComments="true" />

	<xslt recoveryPolicy="doNotRecover" />

	<serialization saxon:indent-spaces="4" xmlns:saxon="http://saxon.sf.net/" />

	<resources>
		<fileExtension extension="rdf" mediaType="application/xml" />
	</resources>
</configuration>
Actions #1

Updated by Michael Kay almost 8 years ago

A similar test case (but using XQuery rather than XSLT) is working for me.

Actions #2

Updated by O'Neil Delpratt almost 8 years ago

The issue is that the catalog file allows users to setup a file mapping from file extensions to media types. But it does not allow the mapping from media types to resource factories to be changed. In this particular instance the current mime type was obtained from the HTTP connection but Saxon did not have a mapping for this mime type to the XmlResource.FACTORY.

Actions #3

Updated by Michael Kay almost 8 years ago

  • Status changed from New to Resolved
  • Applies to branch 9.8 added
  • Fix Committed on Branch 9.7 added

As a first step I have moved the mapping table from media types to ResourceFactory objects from the AbstractResourceFactory object to the Configuration object. This removes the ability to customize it on a per-collection basis, but it makes it much easier to customize without complex subclassing, and it opens the way to allow it to be configured via the Configuration file. A new media type can now be introduced by an API call of the form

configuration.registerMediaType("application/musicxml", XmlResource.FACTORY).

(As well as the standard factories like XmlResource.FACTORY, new user-defined resource factories can also be used).

Fix committed on the 9.7 and 9.8 branches.

Actions #4

Updated by O'Neil Delpratt almost 8 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.7.0.6 added

Bug fixed in maintenance release 9.7.0.6.

Actions #5

Updated by O'Neil Delpratt almost 7 years ago

  • Fix Committed on Branch trunk added
  • Fix Committed on Branch deleted (9.8)
Actions #6

Updated by O'Neil Delpratt almost 7 years ago

  • Applies to branch deleted (9.8)

Please register to edit this issue

Also available in: Atom PDF