Hi Terry,

you do not say why it doesn't work, but my guess is it's the variable.

I don't know what the surrounding code is (perhaps a for-each), but
keep in mind that the xslt processor will set the variable only once,
not for each pass. Thus, if the first record had a type you want to
keep, all records will be kept because the variable has already been
evaluated. Just put your "select" directly into the "test".

When working with XSLT, it helps to keep in mind that it's not a
programming language, but rather a templating language. It's not
imperative - if anything, it's functional.


Regards,
~~helix84

Compulsory reading: DSpace Mailing List Etiquette
https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette


On Fri, Sep 1, 2017 at 11:09 PM, Terry Brady <terry.br...@georgetown.edu> wrote:
> I am attempting to replace a custom extract process with a new OAI
> crosswalk.
>
> This crosswalk should only output records with a specific dc.type field.
>
> Unfortunately, my extract process fails if I attempt to skip a specific
> record.  Note that in the following code, I am generating an empty document
> with a root tag <skip-record/> to work around this issue.
>
> If you are familiar with this part of the system, could you offer any
> advice?
>
> Thanks, Terry
>
>       <xsl:variable name='type'
> select="doc:metadata/doc:element[@name='dc']/doc:element[@name='type']//doc:field[@name='value']/text()"/>
>         <xsl:choose>
>             <xsl:when test="$type != 'ETD'">
> <marc:record>
>                    .. this is a record that I want to ouput
> </marc:record>
>             </xsl:when>
>             <xsl:otherwise>
>                     <skip-record/>
>             </xsl:otherwise>
>         </xsl:choose>
>
>
>
> --
> Terry Brady
> Applications Programmer Analyst
> Georgetown University Library Information Technology
> https://github.com/terrywbrady/info
> 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 dspace-tech+unsubscr...@googlegroups.com.
> To post to this group, send email to dspace-tech@googlegroups.com.
> Visit this group at https://groups.google.com/group/dspace-tech.
> For more options, visit https://groups.google.com/d/optout.

-- 
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 dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
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