resolve xinclude through catalog
Posted: Fri Dec 18, 2020 2:32 am
Hi,
my team has a large project with files in many subfolders. We'd like to use XInclude for including common stuff from a file called Vokabular.xml which lives in the project root.
Including with relative works fine when creating new files via templates. The following complex XPath expression gets expanded to a correct relative path in the project folder structure:
But this technique is not robust against moving the files to an other folder level. That's why we'd prefer resolving the included stuff through a catalog file.
Here is the catalog entry (from ${pdu}/resources/catalog.xml):
But the include fails. I set the logging to verbose and the related
message are:
What's going wrong here?
Kind regards,
Christian
my team has a large project with files in many subfolders. We'd like to use XInclude for including common stuff from a file called Vokabular.xml which lives in the project root.
Including with relative works fine when creating new files via templates. The following complex XPath expression gets expanded to a correct relative path in the project folder structure:
Code: Select all
<xi:include href="${xpath_eval(concat( string-join((tokenize(replace(substring-after('${cfdu}', '${pdu}'), '^/', ''), '/') ! '../'), ''), 'Vokabular.xml') )}" xpointer="encodingDesc"/>
Code: Select all
<xi:include href="http://wwu.de/ArabistikIslam/ALEA/Vokabular.xml" xpointer="encodingDesc"/>
Code: Select all
<uriSuffix uriSuffix="ALEA/Vokabular.xml" uri="../Vokabular.xml"/>
message are:
Code: Select all
Description: Could not resolve PublicID: [null] SystemID: [http://wwu.de/ArabistikIslam/ALEA/Vokabular.xml]
Description: Resolved URI: [http://wwu.de/ArabistikIslam/ALEA/Vokabular.xml] [file:/home/clueck/Projekte/edition-ibn-nubatah/Vokabular.xml]
Description: Could not resolve PublicID: [null] SystemID: [http://wwu.de/ArabistikIslam/ALEA/Vokabular.xml]
Kind regards,
Christian