How do I override upper-case of @href in my keyref document?

I'm setting up a keyref to map href paths for xref linking.  However, SDL converts the @href entry to uppercase.  The output creates a URL that is all upper-case, which renders the link as invalid.

Now I'm forced to adjust my OT plugin to convert the @href to lowercase.  I can understand (slightly) why SDL does this for an @id but why, why does it insist on doing this for a keyref document, which is strictly used for indirection?

Parents
  • Hey Rick,

    You might overcome this issue by tweaking the IWritePluginConfiguration so that the 'ISHSYSHYPERLINKSTOMETADATA' plugin is seperated for ISHMasterDoc, ISHModules and ISHLibrary objects.

    The default OOTB plugin is something as shown below (copied from our Documentation set)

    ----- OOTB plugin configuration -----

    <plugin name="ISHSYSHYPERLINKSTOMETADATA" handler="BlobExtractHyperlinks"
    ishcondition="CurrentAction in ('Create', 'Update', 'Checkin') and (ISHType in ('ISHMasterDoc', 'ISHModule', 'ISHLibrary') and EDT='EDTXML')">
    <description>Find hyperlinks in document and put them on card</description>
    <workingset>
    <ishfields>
    <ishfield name="FISHHYPERLINKS" level="lng" />
    </ishfields>
    </workingset>
    <initialize>
    <parameters>
    <parameter name="ExtractXPath">
    (//*[contains(@class,' topic/xref ')][@href!='-dita-use-conref-target' or not(@conref)][not(ancestor::*[@conref])][not(ancestor-or-self::*[@scope and @scope!=''][position()=1]/@scope='external')]/@href) | (//*[contains(@class,' topic/link ')][@href!='-dita-use-conref-target' or not(@conref)][not(ancestor::*[@conref])][not(ancestor-or-self::*[@scope and @scope!=''][position()=1]/@scope='external')]/@href) | (//*[contains(@class,' map/reltable ')]//*[contains(@class,' map/topicref ')][@href!='-dita-use-conref-target' or not(@conref)][not(ancestor::*[@conref])][not(ancestor-or-self::*[@scope and @scope!=''][position()=1]/@scope='external')]/@href) | (//*[contains(@class,' map/reltable ')]//*[contains(@class,' map/navref ')][@mapref!='-dita-use-conref-target' or not(@conref)][not(ancestor::*[@conref])][not(ancestor-or-self::*[@scope and @scope!=''][position()=1]/@scope='external')]/@mapref)
    </parameter>
    <parameter name="MetadataField">FISHHYPERLINKS</parameter>
    <parameter name="HyperlinkSeparator">#</parameter>
    <parameter name="MetadataUpperCase">Yes</parameter>
    <parameter name="DocumentUpperCase">Yes</parameter>
    <parameter name="AddObjectRef">Yes</parameter>
    </parameters>
    </initialize>
    </plugin>
    ----- end of plugin configuration -----

    As you can see from this configuration, the hyperlink is turned into UpperCase in the document as well. This is based upon the parameter DocumentUpperCase with the value 'Yes'.

    So separating the definition for ISHMasterDoc and ISHModule from the ISHLibrary based objects might allow you to change the DocumentUpperCase parameter value from Yes to No which should prevent the UpperCase feature in the document.

    Please test this out with caution as it might have some other side effects, I'm currently overlooking.

    Kind Regards,

    Raf
  • What is the rationale for some of these defaulting to 'YES'? This occasionally causes issues because it can break hrefs. What would be the risks of changing them to 'NO'?

Reply Children
  • In general, choices from the past, and customers that are on a multitude of versions (;-)) that all expect easy and fast upgrades.

    The rest is a bit of logical thinking on this legacy. A lot of metadata is and relies to be case-insensitive - especially the uppercase LogicalId GUIDs. Toggling that creates issue as you suddenly don't have matches anymore.

    Imagine your Windows file system which is case-insensitive suddenly toggling, what would C:\Windows\ do or c:\WINDOWS if suddenly not found/matched anymore in all kinds of configurations and usages?

    Hope this quickie gives some insights.
    Dave