[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Handle-info] Template Handles



The example in the Handle Technical Manual should show how to use regular expression matching to pull out parts of the handle which can then be plugged into the handle values.

For instance, this template should turn 12345/abc@repl1-repl2 into a handle with the URL value you want:

        <template delimiter="@">
              <if value="extension" test="matches" expression="(.*)-(.*)" parameter="x">
                    <value type="URL" data= "http://www.library.wisc.edu/collections/${x[1]}/item?get=${x[2]}"; />
              </if>
        </template>

Let me know if that helps!

Robert

On Feb 20, 2014, at 1:01 PM, Evguenia Krylova <evguenia.krylova@doit.wisc.edu> wrote:

> 
> Handle server 7.3.1 introduced Template Handles. From the documentation I see how the passed in 
> parameter can be retrieved from the extension, but I don’t see how the handle attribute values can be 
> manipulated to replace place holders with the parameters passed in. I only see how to append those 
> parameter. 
> 
> For example, say I have a handle with the URL 
> 
> http://www.library.wisc.edu/collections/<repl1>/item?get=<repl2> 
> 
> where <repl1> and <repl2> are the two template values that I’d like to resolve from the parameters passed. 
> Could you provide some examples on how do a replacement like this?
> 
> Thank you,
> Ev
> 
> 
> 
> _______________________________________________
> Handle-Info mailing list
> Handle-Info@cnri.reston.va.us
> http://www.handle.net/mailman/listinfo/handle-info


_______________________________________________
Handle-Info mailing list
Handle-Info@cnri.reston.va.us
http://www.handle.net/mailman/listinfo/handle-info