This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(: list all files in the directory of your query file in BaseX :) | |
let $dir := file:parent(static-base-uri()) | |
for $file in file:list($dir) | |
return $dir || $file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(: find out the current working directory in BaseX :) | |
file:parent('.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
@Name : .xsl | |
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | |
@version : 000 | |
@creaDate : 2014/ | |
@modifDate | |
@vXslt: 2.0 | |
@autor : Emmanuel Château emchateau@laposte.net |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- Split content as attribute value --> | |
<xsl:template match="element[@id]"> | |
<xsl:variable name="att-values" select="tokenize(@id, ', ')"/> | |
<xsl:for-each select="tokenize(., '; ')"> | |
<xsl:variable name="pos" select="position()"/> | |
<xsl:if test="position() gt 1"><xsl:text>; </xsl:text></xsl:if> | |
<a href="#{$att-values[$pos]}"> | |
<xsl:value-of select="."/> | |
</a> | |
</xsl:for-each> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div> | |
<h2>{$heading} - {count($actions/generate)}</h2> | |
<p>Actions are processes that generate a new item from an existing item.</p> | |
<div> | |
{$partial("action1.xml","action",$actions/generate )} | |
</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requirements: | |
# - pen drive formatted in FAT | |
# - boot.img.gz downloaded from: http://ftp.debian.org/debian/dists/Debian6.0.2/main/installer-amd64/current/images/hd-media/ | |
# - netinstall iso image http://cdimage.debian.org/debian-cd/6.0.2.1/amd64/iso-cd/ | |
# - pen drive is on /dev/disk1 -> check with "diskutil list" | |
diskutil unmountDisk /dev/disk1 | |
gzip -dc boot.img.gz >/dev/disk1 | |
diskutil eject /dev/disk1 | |
# mount pen drive again | |
# add iso image to the pen drive |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title></title> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0"; | |
(:~ | |
: This function tokenize a string and returns each text item in a <text/> element | |
:) | |
let $string := "test,test,test,test,test" | |
return | |
for $text in tokenize($string,',') | |
return | |
<text>{concat('add some text: ', $text)}</text> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0" ; | |
(:~ | |
: This function returns a deep copy of the elements and all sub-elements | |
: Identity transform | |
: copies the input directly to the output without modification | |
: @source http://en.wikipedia.org/wiki/Identity_transform | |
:) | |
declare function local:copy($element as element()) as element() { | |
element {node-name($element)}{ | |
$element/@*, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0"; | |
(:~ | |
: This function returns a deep copy of the elements and all sub-elements | |
: (identity transform with typeswitch) | |
: copies the input to the output without modification | |
: @source http://en.wikibooks.org/wiki/XQuery/Typeswitch_Transformations | |
:) | |
declare function local:copy($input as item()*) as item()* { | |
for $node in $input | |
return typeswitch($node) |
OlderNewer