Thanks Hussein, I have just managed to solve the problem for my own
application. FYI here is what I've done.
For my particular application the URLs I want to resolve via a catalog
are not arbitrary but are all relative to just one or two base locations
which can be "hard coded" into my configuration but which need the
catalog resolution.
I have found I can get exactly the result I need by declaring those
locations using this:
<property
url="true"
name="BASE_LOCATION">location:/to/resolve/via/catalog</property>
If I then have a relative URL in variable $relURL, this then resolves
via the catalog when my macro contains:
<get expression="sys:getProperty('BASE_LOCATION')"/>
<get expression="resolve-uri($relURL, %_"/>
<command name="viewHTML" parameter="%_"/>
I looks as though the base location is resolved when the configuration
is read rather than when it is used. Is this the case? Can I write
something like this:
<get expression="sys:setProperty('BASE_LOCATION', $new_value)"/>
and have the new location resolve via the catalog?
The piece I had not found when I wrote my question was the uri="true"
declaration.
Philip Nye
--
Engineering Arts
Hussein Shafie wrote:
> Philip Nye wrote:
>> I am sure my answer is somewhere in your documentation, but I cannot
>> find it.
>>
>> I want to use viewHTML in a macro to open a document whose location must
>> be resolved via a catalog.
>>
>> viewHTML itself does not seem to accept this and neither does
>> resolve-uri(). Is there a way to force a catalog lookup from a macro?
>
> I'm sorry but there is currently no way to use XML catalogs in a macro.
>
> Excerpt of
> http://www.xmlmind.com/xmleditor/_distrib/doc/configure/index.html:
> ---
> XXE uses XML Catalogs not only to resolve the locations of the DTD and
> other external entities, but also to resolve URLs found in the following
> places:
>
> * Schema locations in xsi:schemaLocation and in
> xsi:noNamespaceSchemaLocation.
>
> * Schema locations in xs:include, xs:redefine, xs:import.
>
> * Document locations passed to the document() XPath function.
>
> * All XXE configuration elements referencing an URL. Example: <include
> location="..."/>.
>
> * CSS style sheet locations in @import.
>
> * CSS style sheet locations in <?xml-stylesheet href="..."?>.
>
> * XSLT style sheets in the transform child element of a process command.
>
> * Resources in the copyProcessResource child element of a process command.
>
> * XSLT style sheets included or imported by other XSLT style sheets
> (that is, the XML Catalogs used by XXE are passed to Saxon, the XSLT
> engine bundled with XXE).
>
> * RELAX NG schema locations in <?xxe-relaxng-schema location="..."?>.
> ---
>