On Tue, 2008-07-22 at 13:43 -0400, yinjin wrote:
> Hi,
>
> I'm trying to put a lot of static pages on our dspace site and got some
> trouble when I work on the sitemap and DRI.
>
> I updated the sitemap.xmap for ArtifactBrowser to add match entries:
> ===========================================================
> <map:match pattern="thes_*" type="wildcard">
> <map:act type="DSpacePropertyFileReader">
> <map:parameter name="dspace.dir" value="dspace.dir">
> <map:transfor type="Include"
> src="file://{dspace.dir}/config/thes/thes_{1}.xml">
> </map:act>
> <map:serialize type="xml">
> </map:match>
> ============================================================
> I was told "could not find the page". However, if I remove the substitution,
> for example:
> ===========================================================
> <map:match pattern="thes_A" type="wildcard">
> <map:act type="DSpacePropertyFileReader">
> <map:parameter name="dspace.dir" value="dspace.dir">
> <map:transfor type="Include"
> src="file://{dspace.dir}/config/thes/thes_A.xml">
> </map:act>
> <map:serialize type="xml">
> </map:match>
> ============================================================
> It works. However, it's annoying to repeat these from A to Z. Does anybody
> know why substitution variable doesn't work?
Yes. The reason is that the expression "{1}" used in the map:transform
element actually refers to a different variable from the one defined by
the map:match element.
The variables created in the sitemap by map:match, map:act, etc, are
organised into a stack which reflects the nesting of the XML elements in
the sitemap. The expression "{1}" refers to the first variable created
by the parent element (in this case, the map:act, not the map:match). To
access the first substitution variable created by the map:match element
(the "grandparent" element) you need to go up the stack one level:
replace your expression with "{../1}".
Conal
--
Conal Tuohy
New Zealand Electronic Text Centre
www.nzetc.org
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech