# HG changeset patch # User Ruslan Ermilov # Date 1342790090 0 # Node ID b2db67ca29cc63cb5f39d8419db3d78bd35a5da8 # Parent e0544f2c4a705c3e287fd14cedac172c31c8ba25 Made a link to original relative. diff -r e0544f2c4a70 -r b2db67ca29cc GNUmakefile --- a/GNUmakefile Fri Jul 20 13:03:52 2012 +0000 +++ b/GNUmakefile Fri Jul 20 13:14:50 2012 +0000 @@ -23,10 +23,10 @@ define XSLT xmllint --noout --valid $2 xsltproc -o $3 \ - $(shell f=`echo $2 | sed 's;^xml/[^/]*/;xml/en/;'`; \ - [ -f $$f ] && echo --stringparam ORIGIN "../$$f") \ - $(shell echo $4 \ - | sed -e "s/\([^= ]*\)=\([^= ]*\)/--param \1 \"'\2'\"/g") \ + $(shell f=`echo $2 | sed 's,^xml/,,;s,[^/]*/,en/,'`; \ + [ -f xml/$$f ] && echo --stringparam ORIGIN "$$f") \ + $(shell p="$4"; [ -n "$$p" ] && \ + echo --stringparam $${p%%=*} $${p#*=}) \ $1 $2 endef diff -r e0544f2c4a70 -r b2db67ca29cc xsls/body.xsls --- a/xsls/body.xsls Fri Jul 20 13:03:52 2012 +0000 +++ b/xsls/body.xsls Fri Jul 20 13:14:50 2012 +0000 @@ -39,8 +39,10 @@ - X:if "$ORIGIN and document($ORIGIN)/*/@rev and - (not(@rev) or @rev != document($ORIGIN)/*/@rev)" { + X:if "$ORIGIN and document(concat($XML, '/', $ORIGIN))/*/@rev and + (not(@rev) or + @rev != document(concat($XML, '/', $ORIGIN))/*/@rev)" + { X:if "@lang = 'he'" { X:attribute "class" { X:text{ltr} } } diff -r e0544f2c4a70 -r b2db67ca29cc xsls/link.xsls --- a/xsls/link.xsls Fri Jul 20 13:03:52 2012 +0000 +++ b/xsls/link.xsls Fri Jul 20 13:14:50 2012 +0000 @@ -8,7 +8,13 @@ X:template = "img" { !!; } X:template = "origin" { - !!; + + X:attribute "href" { + !root(path = "$ORIGIN") + !{ concat(substring-before($ORIGIN, '.xml'), '.html') } + } + !!; + } X:template = "link[@url]" {