Gary,

Carefully check that the path set for $collurl points to an XML object.
The sample code I gave you may require an additional root path.

For code examples, you can look in the code base for examples where
"cocoon:" is found.  See https://github.com/DSpace/
DSpace/blob/master/dspace-xmlui/src/main/webapp/themes/
Mirage/lib/xsl/core/page-structure.xsl#L468-L494

This is old, but it might be helpful: http://www.slideshare.net/tdonohue/
making-dspace-xmlui-your-own

The following wiki page has an overview of XMLUI, but it does not explain
how the "cocoon:" protocall works in xsl:document:
https://wiki.duraspace.org/display/DSDOC5x/XMLUI+Configuration+and+Customization
.

Terry

On Wed, Oct 19, 2016 at 11:25 PM, Gary Browne <[email protected]>
wrote:

> Hi Terry,
>
> I'm getting some way to something here...but not quite. I can pull out the
> collection metadata as one big lump of text without any formatting (is
> there a way to retain any HTML tags in the metadata?).
>
> However,
>
> document(concat('cocoon:', $collurl))"/>
>
> doesn't give me anything.
>
> How did you work all this out? Is there some documentation I can follow
> somewhere, because I can't seem to find anything like this on the dspace
> wiki?
>
> Thanks again,
> Gary
>
>
> On Thursday, October 20, 2016 at 11:48:31 AM UTC+11, Gary Browne wrote:
>>
>> Hi Terry,
>>
>> Sorry I was unclear there - yes, you were correct in assuming I want to
>> access in XSLT theme code.
>>
>> Thanks for your pointers, I'll let you know how I get on with it.
>>
>> Cheers,
>> Gary
>>
>>
>> On Thursday, October 20, 2016 at 4:35:35 AM UTC+11, Terry Brady wrote:
>>>
>>> How do you want to access the metadata?  Through SQL or in some XSLT
>>> theme code?
>>>
>>> Assuming, want to do this in XMLUI theme code, here is the process.
>>>
>>>    - Item: http://demo.dspace.org/xmlui///handle/10673/3
>>>    - Look at the XML for this document: http://demo.dspace.o
>>>    rg/xmlui/handle/10673/3?XML
>>>    - The url to the collection metadata is here
>>>       - <xsl:variable name="collurl" select="//dri:referenceSet[@n=
>>>       'collection-viewer']//dri:reference[@type='DSpace
>>>       Collection']/@url"/>
>>>    - If you view source on the following URL, you will see the
>>>    metadata: http://demo.dspace.org/xmlui//metadata/handle/1067
>>>    3/2/mets.xml
>>>    - You can use the cocoon protocol to retrieve the metadata for the
>>>    collection
>>>       - <xsl:variable name="collmeta" select="document(concat('cocoon:',
>>>       $collurl))"/>
>>>
>>> There may be a bug in the code above, but this is the general approach
>>> to follow.
>>>
>>> Terry
>>>
>>> On Tue, Oct 18, 2016 at 5:07 PM, Gary Browne <[email protected]>
>>> wrote:
>>>
>>>> Hi all,
>>>>
>>>> DSpace 5.5
>>>> XMLUI
>>>> Tomcat 7
>>>> Apache 2.2
>>>> PostGreSQL 9.2
>>>>
>>>> How can I access the collection metadata to use it in a template? For
>>>> example, if I want to display the collection introductory text or copyright
>>>> text elsewhere?
>>>>
>>>> Thanks a lot,
>>>> Gary
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "DSpace Technical Support" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to [email protected].
>>>> To post to this group, send email to [email protected].
>>>> Visit this group at https://groups.google.com/group/dspace-tech.
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>
>>>
>>> --
>>> Terry Brady
>>> Applications Programmer Analyst
>>> Georgetown University Library Information Technology
>>> http://georgetown-university-libraries.github.io/
>>> <https://www.library.georgetown.edu/lit/code>
>>> 425-298-5498 (Seattle, WA)
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "DSpace Technical Support" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Terry Brady
Applications Programmer Analyst
Georgetown University Library Information Technology
http://georgetown-university-libraries.github.io/
<https://www.library.georgetown.edu/lit/code>
425-298-5498 (Seattle, WA)

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to