2

I have this setting in dspace.cfg webui.supported.locales = en, fr, zh. I wonder why I can't get the active or current locale if I use:

    <xsl:value-of
        select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='currentLocale']"/>

in my item-view.xsl?

Viewing the page eg http://localhost:8080/DRI/handle/123456789/10476?locale-attribute=fr, it is obviously there in:

<metadata element="page" qualifier="currentLocale">fr</metadata>

Am I missing something?

euler
  • 1,401
  • 2
  • 18
  • 39

1 Answers1

1

Apparently, declaring this in a variable in the global-variables.xsl eg

<xsl:variable name="active-locale" select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='currentLocale']"/>

solved my issue.

I can now capture the current/active locale. I still don't know why it won't work if I just use and declare the variable in item-view.xsl.

euler
  • 1,401
  • 2
  • 18
  • 39
  • 3
    The `item-view.xsl` page is at a different "context" than the `global-variables.xsl`. The `item-view.xsl` only has access to information that is within the METS file containing all item-level information. Since you are asking for something from the DRI document, it is unaccessible from within `item-view.xsl`, but it is accessible from XSL files which have access to the full DRI document. This explains why the same variable works in `global-variables.xsl` but not in `item-view.xsl` – Tim Donohue Aug 17 '15 at 13:52