[xep-support] Behavior of xml:base in font configuration file (3.77)

From: W. Eliot Kimber (ekimber@innodata-isogen.com)
Date: Thu Aug 26 2004 - 14:23:18 PDT

  • Next message: Chris Johnson: "[xep-support] Internal document links - best practices?"

    I think the behavior of xml:base in font configuration files is
    incorrect. At a minimum it's both different from what I expected and not
    useful as currently implemented (in that it doesn't help to make the
    font configuration file transportable).

    What I need to be able to do is create a font configuration file that
    can be deployed without knowledge of where either the file itself is put
    or where it is relative to the XEP installation. In this scenario both
    the font configuration file and the fonts it references are in
    consistent locations relative to each other.

    Here's what I have in my font configuration file:

    <fonts xml:base="../lib/fonts/">

    Where the font file is in a directory that is a sibling of the lib/
    directory, e.g.:

    dist/config/xep-fonts.xml
    dist/lib/fonts/someefont.ttf
    dist/lib/fonts/afm/Helvetica-BoldOblique.afm

    A typical font specification is:

        <font name="Helvetica-BoldOblique"
              afm="afm/Helvetica-BoldOblique.afm"
              embed="false">
           <alias name="Helv-BoldOblique"/>
           <alias name="Swiss-BoldOblique"/>
        </font>

    I am calling XEP with the FONTLIST set to the location of the
    xep-fonts.xml file, e.g.:

    XSLDriver -DXEP_HOME=$XEP_HOME
       -DFONTLIST=/user/local/dist/config/xep-fonts.xml
       myfile.fo

    When I make the xml:base value an absolute path ending in "lib/fonts"
    then this font is resolved.

    If I use the above relative xml:base, then I get a failure message like
    this:

    [error] java.io.FileNotFound exception:
    /home/xml/XEP/fonts/afm/Helvetica.afm (No such file or directory)

    This suggests that XEP is using the location of the Java JAR file, not
    the location of the xep-fonts.xml file, as the base for constructing an
    absolute URL from the relative xml:base value.

    My reading of both the XML Base specs and RFC 2396, on which it depends,
    suggest that in a case like this the location of the document should be
    used as the base for resolving relative URIs.

    This is with version 3.77.

    Cheers,

    Eliot

    -- 
    W. Eliot Kimber
    Professional Services
    Innodata Isogen
    9390 Research Blvd, #410
    Austin, TX 78759
    (512) 372-8122
    eliot@innodata-isogen.com
    www.innodata-isogen.com
    -------------------
    (*) To unsubscribe, send a message with words 'unsubscribe xep-support'
    in the body of the message to majordomo@renderx.com from the address
    you are subscribed from.
    (*) By using the Service, you expressly agree to these Terms of Service http://www.renderx.com/tos.html
    


    This archive was generated by hypermail 2.1.5 : Thu Aug 26 2004 - 14:41:13 PDT