[
https://issues.apache.org/jira/browse/FOP-3238?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Kainzbauer updated FOP-3238:
------------------------------------
Summary: baseURI given for FopFactoryBuilder is overridden <base> in
fop.xconf (was: baseURI given for FopFactoryBuilder is overridden <base> in
fop.xconf, but only if URI in <base> is absolute)
> baseURI given for FopFactoryBuilder is overridden <base> in fop.xconf
> ---------------------------------------------------------------------
>
> Key: FOP-3238
> URL: https://issues.apache.org/jira/browse/FOP-3238
> Project: FOP
> Issue Type: Bug
> Components: documentation
> Affects Versions: 2.10
> Reporter: Michael Kainzbauer
> Priority: Minor
> Attachments: InitFopFactory.java
>
>
> I am not sure if this is only a documentation issue or a bug.
> {*}Observed behavior{*}:
> When I create a FopFactoryBuilder like so:
> {{var baseURI = new URI("http://example.com");}}
> {{var fopFactoryBuilder = new FopFactoryBuilder(baseURI);}}
>
> it's baseURI is set to {{{}"http://example.com"{}}}, which works as expected.
>
> When I further set a configuration to this builder, which has a relative
> baseURI,
>
> {{var configWithRelativeBase =
> configurationBuilder.build(apacheXConfWithRelativeBaseURI());}}
> {{fopFactoryBuilder.setConfiguration(configWithRelativeBase);}}
>
> the baseURI changes to {{{}"http://example.com/"{}}}, as above, but with a
> trailing /, so the base changes to the initial baseURI passed to the
> constructor + the relative URI in <base>
>
>
> When I instead set a configuration to this builder, which has a absolute
> baseURI, the baseURI changes to this value configured in <base></base>.
>
> {*}Expected behavior{*}:
> The documentation should mention this behavior, so that it is clear the URI
> specified in <base> will be resolved by the baseURI passed to the
> constructor. So relative URIs are resolve by whatever URI is the combination
> from the baseURI passed to the constructor and a relative URI in <base>
>
> There is a footnote in the documentation:
> [https://xmlgraphics.apache.org/fop/2.10/configuration.html#fn:1]
>
> {quote}Relative URIs for those properties are evaluated relative to the base
> URI of the configuration file. If the configuration is provided
> programmatically, the base URI can be set with
> {{FopFactory.setUserConfigBaseURI}} ; default is the current working directory
> {quote}
>
> However, there is no {{setUserConfigBaseURI}} in class {{{}FopFactory{}}},
> which seems to be an error in the documentation.
>
> Also, either the behavior of overwriting the baseURI passed to the
> constructor by the <base> value from fop.xconf is inconsistent or not
> documented correctly.
>
> Please find a minimum example for reproducing this behavior attached to this
> issue.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)