dnl A version of AS_COMPILER_FLAG that supports both C and C++.
dnl Based on:

dnl as-compiler-flag.m4 0.1.0
dnl autostars m4 macro for detection of compiler flags
dnl David Schleef <ds@schleef.org>
dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $

dnl TP_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
dnl Tries to compile with the given CFLAGS and CXXFLAGS.
dnl
dnl Runs ACTION-IF-ACCEPTED if the compiler for the currently selected
dnl AC_LANG can compile with the flags, and ACTION-IF-NOT-ACCEPTED otherwise.

AC_DEFUN([TP_COMPILER_FLAG],
[
  AC_MSG_CHECKING([to see if compiler understands $1])

  save_CFLAGS="$CFLAGS"
  save_CXXFLAGS="$CXXFLAGS"
  CFLAGS="$CFLAGS $1"
  CXXFLAGS="$CXXFLAGS $1"

  AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
  CFLAGS="$save_CFLAGS"
  CXXFLAGS="$save_CXXFLAGS"

  if test "X$flag_ok" = Xyes ; then
    $2
    true
  else
    $3
    true
  fi
  AC_MSG_RESULT([$flag_ok])
])

Add TP_ADD_COMPILER_FLAG, analogous to TP_ADD_LINKER_FLAG

dnl A version of AS_COMPILER_FLAG that supports both C and C++.
dnl Based on:

dnl as-compiler-flag.m4 0.1.0
dnl autostars m4 macro for detection of compiler flags
dnl David Schleef <ds@schleef.org>
dnl $Id: as-compiler-flag.m4,v 1.1 2005/06/18 18:02:46 burgerman Exp $

dnl TP_COMPILER_FLAG(CFLAGS, ACTION-IF-ACCEPTED, [ACTION-IF-NOT-ACCEPTED])
dnl Tries to compile with the given CFLAGS and CXXFLAGS.
dnl
dnl Runs ACTION-IF-ACCEPTED if the compiler for the currently selected
dnl AC_LANG can compile with the flags, and ACTION-IF-NOT-ACCEPTED otherwise.

AC_DEFUN([TP_COMPILER_FLAG],
[
  AC_MSG_CHECKING([to see if compiler understands $1])

  save_CFLAGS="$CFLAGS"
  save_CXXFLAGS="$CXXFLAGS"
  CFLAGS="$CFLAGS $1"
  CXXFLAGS="$CXXFLAGS $1"

  AC_TRY_COMPILE([ ], [], [flag_ok=yes], [flag_ok=no])
  CFLAGS="$save_CFLAGS"
  CXXFLAGS="$save_CXXFLAGS"

  if test "X$flag_ok" = Xyes ; then
    $2
    true
  else
    $3
    true
  fi
  AC_MSG_RESULT([$flag_ok])
])

dnl TP_ADD_COMPILER_FLAG(VARIABLE, CFLAGS)
dnl Append CFLAGS to VARIABLE if the compiler supports them.
AC_DEFUN([TP_ADD_COMPILER_FLAG],
[
  TP_COMPILER_FLAG([$2], [$1="[$]$1 $2"])
])


# ===========================================================================
#     http://www.gnu.org/software/autoconf-archive/ax_python_module.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_PYTHON_MODULE(modname[, fatal])
#
# DESCRIPTION
#
#   Checks for Python module.
#
#   If fatal is non-empty then absence of a module will trigger an error.
#
# LICENSE
#
#   Copyright (c) 2008 Andrew Collier
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 6

AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE])
AC_DEFUN([AX_PYTHON_MODULE],[
    if test -z $PYTHON;
    then
        PYTHON="python"
    fi
    PYTHON_NAME=`basename $PYTHON`
    AC_MSG_CHECKING($PYTHON_NAME module: $1)
	$PYTHON -c "import $1" 2>/dev/null
	if test $? -eq 0;
	then
		AC_MSG_RESULT(yes)
		eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
	else
		AC_MSG_RESULT(no)
		eval AS_TR_CPP(HAVE_PYMOD_$1)=no
		#
		if test -n "$2"
		then
			AC_MSG_ERROR(failed to find required module $1)
			exit 1
		fi
	fi
])

Fix build on systems where /usr/bin/python isn't python 2.

# ===========================================================================
#     http://www.gnu.org/software/autoconf-archive/ax_python_module.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_PYTHON_MODULE(modname[, fatal])
#
# DESCRIPTION
#
#   Checks for Python module.
#
#   If fatal is non-empty then absence of a module will trigger an error.
#
# LICENSE
#
#   Copyright (c) 2008 Andrew Collier
#
#   Copying and distribution of this file, with or without modification, are
#   permitted in any medium without royalty provided the copyright notice
#   and this notice are preserved. This file is offered as-is, without any
#   warranty.

#serial 6

AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE])
AC_DEFUN([AX_PYTHON_MODULE],[
    if test -z $PYTHON2;
    then
        PYTHON2="python"
    fi
    PYTHON_NAME=`basename $PYTHON2`
    AC_MSG_CHECKING($PYTHON_NAME module: $1)
	$PYTHON2 -c "import $1" 2>/dev/null
	if test $? -eq 0;
	then
		AC_MSG_RESULT(yes)
		eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
	else
		AC_MSG_RESULT(no)
		eval AS_TR_CPP(HAVE_PYMOD_$1)=no
		#
		if test -n "$2"
		then
			AC_MSG_ERROR(failed to find required module $1)
			exit 1
		fi
	fi
])


AC_DEFUN([AX_VPP_FIND_JDK8],
[
while true
do
  test "${JAVA_HOME+set}" = set && break

  for dir in $(find /usr/lib/jvm/* -maxdepth 0 -type d); do
    AC_MSG_CHECKING([${dir} for Java 8 compiler])
    JAVA_VERSION=$(${dir}/bin/javac -source 8 -version 2>&1)
    if test 0 -eq "$?"; then
      JAVA_VERSION=$(echo "${JAVA_VERSION}" | cut -d\  -f2)
      JAVA_HOME=${dir}
      JAVAC=${dir}/bin/javac
      JAVAH=${dir}/bin/javah
      JAR=${dir}/bin/jar
      AC_MSG_RESULT([found version $JAVA_VERSION])
      break
    else
      JAVA_VERSION=""
      AC_MSG_RESULT([no])
    fi
  done

  test "${JAVA_HOME}set" = set && AC_MSG_ERROR([Could not find Java 8 compiler])
  break
done
])

Improve Java 8 detection m4 script to deal with pre-set JAVA_HOME

AC_DEFUN([AX_VPP_FIND_JDK8],
[
while true
do
  if test "${JAVA_HOME+set}" = set ; then
    AC_MSG_CHECKING([${JAVA_HOME} for Java 8 compiler])
    JAVAC=${JAVA_HOME}/bin/javac
    JAVAH=${JAVA_HOME}/bin/javah
    JAR=${JAVA_HOME}/bin/jar
    JAVA_VERSION=$(${JAVA_HOME}/bin/javac -source 8 -version 2>&1)
    if test 0 -eq "$?"; then
      JAVA_VERSION=$(echo "${JAVA_VERSION}" | cut -d\  -f2)
      AC_MSG_RESULT([ok])
    else
      AC_MSG_RESULT([no])
      AC_MSG_ERROR([Java in ${JAVA_HOME} (path specified in JAVA_HOME) cannot compile Java 8 code])
    fi
    break
  fi

  for dir in $(find /usr/lib/jvm/* -maxdepth 0 -type d); do
    AC_MSG_CHECKING([${dir} for Java 8 compiler])
    JAVA_VERSION=$(${dir}/bin/javac -source 8 -version 2>&1)
    if test 0 -eq "$?"; then
      JAVA_VERSION=$(echo "${JAVA_VERSION}" | cut -d\  -f2)
      JAVA_HOME=${dir}
      JAVAC=${dir}/bin/javac
      JAVAH=${dir}/bin/javah
      JAR=${dir}/bin/jar
      AC_MSG_RESULT([found version $JAVA_VERSION])
      break
    else
      JAVA_VERSION=""
      AC_MSG_RESULT([no])
    fi
  done

  test "${JAVA_HOME}set" = set && AC_MSG_ERROR([Could not find Java 8 compiler])
  break
done
])


#
# Check for Bison.
#
# This macro verifies that Bison is installed.  If successful, then
# 1) YACC is set to bison -y (to emulate YACC calls)
# 2) BISON is set to bison
#
AC_DEFUN([AC_PROG_BISON],
[AC_CACHE_CHECK(,
ac_cv_has_bison,
[AC_PROG_YACC()
])
if test "$YACC" != "bison -y"; then
  AC_MSG_ERROR([bison not found but required])
else
  AC_SUBST(BISON,[bison],[location of bison])
fi
])

Make the check print something, give the cache var an llvm specific name.

#
# Check for Bison.
#
# This macro verifies that Bison is installed.  If successful, then
# 1) YACC is set to bison -y (to emulate YACC calls)
# 2) BISON is set to bison
#
AC_DEFUN([AC_PROG_BISON],
[AC_CACHE_CHECK([if we have bison],[llvm_cv_has_bison],
[AC_PROG_YACC()
])
if test "$YACC" != "bison -y"; then
  AC_MSG_ERROR([bison not found but required])
else
  AC_SUBST(BISON,[bison],[location of bison])
fi
])


# This is included from fizmo-dist and not required by libfizmo's own
# configuration. It nevertheless needs to be maintained so fizmo-dist
# will still work.
#
# The $build_prefix, $build_prefix_cflags and $build_prefix_libs are
# pre-defined by fizmo-dist.

AC_SUBST([libdrilbo_CFLAGS], "-I$build_prefix_cflags $x11_CFLAGS $libjpeg_CFLAGS $libjpeg_nonpkg_cflags $png_CFLAGS")
AC_SUBST([libdrilbo_LIBS], "-L$build_prefix_libs -ldrilbo -lpthread $x11_LIBS $libjpeg_LIBS $libjpeg_nonpkg_libs $png_LIBS")

Fix substs for distribution build.

# This is included from fizmo-dist and not required by libfizmo's own
# configuration. It nevertheless needs to be maintained so fizmo-dist
# will still work.
#
# The $build_prefix, $build_prefix_cflags and $build_prefix_libs are
# pre-defined by fizmo-dist.

AC_SUBST([libdrilbo_CFLAGS], "-I$build_prefix_cflags $libx11_CFLAGS $libjpeg_CFLAGS $libjpeg_nonpkg_cflags $libpng_CFLAGS")
AC_SUBST([libdrilbo_LIBS], "-L$build_prefix_libs -ldrilbo -lpthread $libx11_LIBS $libjpeg_LIBS $libjpeg_nonpkg_libs $libpng_LIBS")


AC_DEFUN([AC_COMPILATION_STATIC], [
        AC_ARG_WITH(static,
            AC_HELP_STRING([--with-static],[Compile les binaires en static]),
            [LDFLAGS="$LDFLAGS -static"])
])

Fix de la compilation static

AC_DEFUN([AC_COMPILATION_STATIC], [
        AC_ARG_WITH(static,
            AC_HELP_STRING([--with-static],[Compile les binaires en static]),
            [CXX="'$CXX -static'"]
            )
])


AC_DEFUN([AC_C___ATTRIBUTE__],
[
  AC_MSG_CHECKING(for __attribute__)
  AC_CACHE_VAL(ac_cv___attribute__, [
  AC_TRY_COMPILE([#include <stdlib.h>],
  [int func(int x); int foo(int x __attribute__ ((unused))) { exit(1); }],
  ac_cv___attribute__=yes, ac_cv___attribute__=no)])
  if test "$ac_cv___attribute__" = "yes"; then
    AC_DEFINE(HAVE___ATTRIBUTE__, 1, [Define to 1 if your compiler has __attribute__])
  fi
  AC_MSG_RESULT($ac_cv___attribute__)
])

Update m4 macro to provide __UNUSED__.

dnl Copyright (C) 2004-2008 Kim Woelders
dnl Copyright (C) 2008 Vincent Torri <vtorri at univ-evry dot fr>
dnl That code is public domain and can be freely used or copied.
dnl Originally snatched from somewhere...

dnl Macro for checking if the compiler supports __atribute__

dnl Usage: AC_C___ATTRIBUTE__
dnl call AC_DEFINE for HAVE___ATTRIBUTE__ and __UNUSED__
dnl if the compiler supports __attribute__, HAVE___ATTRIBUTE__ is
dnl defined to 1 and __UNUSED__ is defined to __attribute__((unused))
dnl otherwise, HAVE___ATTRIBUTE__ is not defined and __UNUSED__ is
dnl defined to nothing.

AC_DEFUN([AC_C___ATTRIBUTE__],
[

AC_MSG_CHECKING([for __attribute__])

AC_CACHE_VAL([ac_cv___attribute__],
   [AC_TRY_COMPILE(
       [
#include <stdlib.h>
       ],
       [
int func(int x);
int foo(int x __attribute__ ((unused)))
{
   exit(1);
}
       ],
       [ac_cv___attribute__="yes"],
       [ac_cv___attribute__="no"]
    )]
)

AC_MSG_RESULT($ac_cv___attribute__)

if test "x${ac_cv___attribute__}" = "xyes" ; then
   AC_DEFINE([HAVE___ATTRIBUTE__], [1], [Define to 1 if your compiler has __attribute__])
   AC_DEFINE([__UNUSED__], [__attribute__((unused))], [Macro declaring a function argument to be unused])
  else
    AC_DEFINE([__UNUSED__], [], [Macro declaring a function argument to be unused])
fi

])


PHP_ARG_ENABLE(protobuf, whether to enable Protobuf extension, [  --enable-protobuf   Enable Protobuf extension])

if test "$PHP_PROTOBUF" != "no"; then

  PHP_NEW_EXTENSION(
    protobuf,
    arena.c array.c convert.c def.c map.c message.c names.c php-upb.c protobuf.c,
    $ext_shared)

fi

Set -std=gnu99 for PHP extension compile.

PHP_ARG_ENABLE(protobuf, whether to enable Protobuf extension, [  --enable-protobuf   Enable Protobuf extension])

if test "$PHP_PROTOBUF" != "no"; then

  PHP_NEW_EXTENSION(
    protobuf,
    arena.c array.c convert.c def.c map.c message.c names.c php-upb.c protobuf.c,
    $ext_shared, , -std=gnu99)

fi


#
# When allocating RWX memory, check whether we need to use /dev/zero
# as the file descriptor or not.
#
AC_DEFUN([AC_NEED_DEV_ZERO_FOR_MMAP],
[AC_CACHE_CHECK([if /dev/zero is needed for mmap],
ac_cv_need_dev_zero_for_mmap,
[if test "$llvm_cv_os_type" == "Interix" ; then
   ac_cv_need_dev_zero_for_mmap=yes
 else
   ac_cv_need_dev_zero_for_mmap=no
 fi
])
if test "$ac_cv_need_dev_zero_for_mmap" = yes; then
  AC_DEFINE([NEED_DEV_ZERO_FOR_MMAP],[1],
   [Define if /dev/zero should be used when mapping RWX memory, or undefine if its not necessary])
fi])

Fix a Bourne Shell syntax error in a test

#
# When allocating RWX memory, check whether we need to use /dev/zero
# as the file descriptor or not.
#
AC_DEFUN([AC_NEED_DEV_ZERO_FOR_MMAP],
[AC_CACHE_CHECK([if /dev/zero is needed for mmap],
ac_cv_need_dev_zero_for_mmap,
[if test "$llvm_cv_os_type" = "Interix" ; then
   ac_cv_need_dev_zero_for_mmap=yes
 else
   ac_cv_need_dev_zero_for_mmap=no
 fi
])
if test "$ac_cv_need_dev_zero_for_mmap" = yes; then
  AC_DEFINE([NEED_DEV_ZERO_FOR_MMAP],[1],
   [Define if /dev/zero should be used when mapping RWX memory, or undefine if its not necessary])
fi])


PHP_ARG_ENABLE(maxminddb,
    [Whether to enable the MaxMind DB Reader extension],
    [  --enable-maxminddb      Enable MaxMind DB Reader extension support])

if test $PHP_MAXMINDDB != "no"; then
    PHP_CHECK_LIBRARY(maxminddb, MMDB_open)

    # Not using -Wextra as -Wunused-parameter and -Wmissing-field-initializers
    # interfere with the PHP macros
    CFLAGS="$CFLAGS -Wall -Werror -Wextra -Wno-unused-parameter -Wno-missing-field-initializers"

    PHP_ADD_LIBRARY(maxminddb, 1, MAXMINDDB_SHARED_LIBADD)
    PHP_SUBST(MAXMINDDB_SHARED_LIBADD)

    PHP_NEW_EXTENSION(maxminddb, maxminddb.c, $ext_shared)
fi

Remove -Werror and make comment match reality

PHP_ARG_ENABLE(maxminddb,
    [Whether to enable the MaxMind DB Reader extension],
    [  --enable-maxminddb      Enable MaxMind DB Reader extension support])

if test $PHP_MAXMINDDB != "no"; then
    PHP_CHECK_LIBRARY(maxminddb, MMDB_open)

    # The -Wunused-parameter and -Wmissing-field-initializers warnings
    # interfere with the PHP macros
    CFLAGS="$CFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers"

    PHP_ADD_LIBRARY(maxminddb, 1, MAXMINDDB_SHARED_LIBADD)
    PHP_SUBST(MAXMINDDB_SHARED_LIBADD)

    PHP_NEW_EXTENSION(maxminddb, maxminddb.c, $ext_shared)
fi


AC_DEFUN([AC_CHECK_JAVA],[
  AC_ARG_WITH(
    java-home,
    [  --with-java-home=DIR    Set Java home directory ],
    [
      JAVA_HOME=`echo $withval`
    ]
  )
  CPPFLAGS="$CPPFLAGS -I$JAVA_HOME/include -I$JAVA_HOME/include/linux -I$JAVA_HOME/include/win32"
  AC_CHECK_HEADERS(jni.h,,echo "ERROR: jni.h not found. JAVA_HOME is $JAVA_HOME. Use --with-java-home option to specify an other Java home directory."; exit 1;)
])

Add Java darwin directory to include path

AC_DEFUN([AC_CHECK_JAVA],[
  AC_ARG_WITH(
    java-home,
    [  --with-java-home=DIR    Set Java home directory ],
    [
      JAVA_HOME=`echo $withval`
    ]
  )
  CPPFLAGS="$CPPFLAGS -I$JAVA_HOME/include -I$JAVA_HOME/include/linux -I$JAVA_HOME/include/win32 -I$JAVA_HOME/include/darwin"
  AC_CHECK_HEADERS(jni.h,,echo "ERROR: jni.h not found. JAVA_HOME is $JAVA_HOME. Use --with-java-home option to specify an other Java home directory."; exit 1;)
])


dnl $Id$
dnl config.m4 for extension posixclocks

PHP_ARG_WITH(posixclocks, for posixclocks support,
[  --with-posixclocks             Include POSIX clock_gettime support])

if test "$PHP_POSIXCLOCKS" != "no"; then
  dnl Write more examples of tests here...

  # --with-posixclocks -> check with-path
  SEARCH_PATH="/usr/local /usr"
  SEARCH_FOR="/include/time.h"
  if test -r $PHP_POSIXCLOCKS/$SEARCH_FOR; then # path given as parameter
    POSIXCLOCKS_DIR=$PHP_POSIXCLOCKS
  else # search default path list
    AC_MSG_CHECKING([for posixclocks files in default path])
    for i in $SEARCH_PATH ; do
      if test -r $i/$SEARCH_FOR; then
        POSIXCLOCKS_DIR=$i
        AC_MSG_RESULT(found in $i)
      fi
    done
  fi

  dnl if test -z "$POSIXCLOCKS_DIR"; then
  dnl   AC_MSG_RESULT([not found])
  dnl   AC_MSG_ERROR([Please reinstall the posixclocks distribution])
  dnl fi

  dnl # --with-posixclocks -> add include path
  dnl PHP_ADD_INCLUDE($POSIXCLOCKS_DIR/include)

  dnl # --with-posixclocks -> check for lib and symbol presence
  dnl LIBNAME=posixclocks # you may want to change this
  dnl LIBSYMBOL=posixclocks # you most likely want to change this

  dnl PHP_CHECK_LIBRARY($LIBNAME,$LIBSYMBOL,
  dnl [
  dnl   PHP_ADD_LIBRARY_WITH_PATH($LIBNAME, $POSIXCLOCKS_DIR/lib, POSIXCLOCKS_SHARED_LIBADD)
  dnl   AC_DEFINE(HAVE_POSIXCLOCKSLIB,1,[ ])
  dnl ],[
  dnl   AC_MSG_ERROR([wrong posixclocks lib version or lib not found])
  dnl ],[
  dnl   -L$POSIXCLOCKS_DIR/lib -lm
  dnl ])
  dnl
  dnl PHP_SUBST(POSIXCLOCKS_SHARED_LIBADD)

  PHP_NEW_EXTENSION(posixclocks, posixclocks.c, $ext_shared)
fi

Check for time.h in unix build

dnl $Id$
dnl config.m4 for extension posixclocks

PHP_ARG_WITH(posixclocks, for posixclocks support,
[  --with-posixclocks             Include POSIX clock_gettime support])

if test "$PHP_POSIXCLOCKS" != "no"; then
  AC_CHECK_HEADERS(time.h)

  PHP_NEW_EXTENSION(posixclocks, posixclocks.c, $ext_shared)
fi


AC_DEFUN([BANSHEE_CHECK_SOUNDMENU],
[
	LIBINDICATESHARP_REQUIRED=0.4.1

	AC_ARG_ENABLE([soundmenu],
		AS_HELP_STRING([--enable-soundmenu]
                                [Enable sound menu support]),
		enable_soundmenu=$enableval, enable_soundmenu=no
	)

	if test "x$enable_soundmenu" = "xyes"; then
		has_indicatesharp=no
		PKG_CHECK_MODULES(INDICATESHARP,
			indicate-sharp-0.1 >= $LIBINDICATESHARP_REQUIRED,
			has_indicatesharp=yes, has_indicatesharp=no)
		if test "x$has_indicatesharp" = "xno"; then
			AC_MSG_ERROR([indicate-sharp was not found or is not up to date. Please install indicate-sharp of at least version $LIBINDICATESHARP_REQUIRED, or disable sound menu support by passing --disable-soundmenu])
		fi
	fi

	AM_CONDITIONAL(ENABLE_SOUNDMENU, test "x$enable_soundmenu" = "xyes")
])

Fix configure help message formatting

AC_DEFUN([BANSHEE_CHECK_SOUNDMENU],
[
	LIBINDICATESHARP_REQUIRED=0.4.1

	AC_ARG_ENABLE([soundmenu],
		AS_HELP_STRING([--enable-soundmenu], [Enable sound menu support]),
		enable_soundmenu=$enableval, enable_soundmenu=no
	)

	if test "x$enable_soundmenu" = "xyes"; then
		has_indicatesharp=no
		PKG_CHECK_MODULES(INDICATESHARP,
			indicate-sharp-0.1 >= $LIBINDICATESHARP_REQUIRED,
			has_indicatesharp=yes, has_indicatesharp=no)
		if test "x$has_indicatesharp" = "xno"; then
			AC_MSG_ERROR([indicate-sharp was not found or is not up to date. Please install indicate-sharp of at least version $LIBINDICATESHARP_REQUIRED, or disable sound menu support by passing --disable-soundmenu])
		fi
	fi

	AM_CONDITIONAL(ENABLE_SOUNDMENU, test "x$enable_soundmenu" = "xyes")
])


dnl $Id$
dnl config.m4 for gtkextra module

define(gtkextra_required_version,   2.1.1)

PHP_GTK_ARG_ENABLE(gtkextra,for gtkextra support,
[  --disable-gtkextra      Disable gtkextra support],yes)

if test "$PHP_GTK_GTKEXTRA" != "no"; then
  PKG_CHECK_MODULES(GTKEXTRA, [gtkextra-2.0 >= gtkextra_required_version],
  have_gtkextra=yes, have_gtkextra=no)
  if test "$have_gtkextra" != "yes"; then
    AC_MSG_RESULT([Unable to locate gtkextra version gtkextra_required_version or higher: not building])
  else
    AC_DEFINE(HAVE_GTKEXTRA, 1, [gtkextra support])
    PHP_EVAL_INCLINE($GTKEXTRA_CFLAGS)
    if test "$php_gtk_ext_shared" = "yes"; then
      PHP_EVAL_LIBLINE($GTKEXTRA_LIBS, GTKEXTRA_SHARED_LIBADD)
      PHP_SUBST(GTKEXTRA_SHARED_LIBADD)
    else
      PHP_EVAL_LIBLINE($GTKEXTRA_LIBS, PHP_GTK2_SHARED_LIBADD)
    fi
    PHP_GTK_EXTENSION(extra, $php_gtk_ext_shared, php_gtkextra.c, gen_gtkextra.c)
  fi
fi

Make extension not build by default

dnl $Id$
dnl config.m4 for gtkextra module

define(gtkextra_required_version,   2.1.1)

PHP_GTK_ARG_ENABLE(gtkextra,for gtkextra support,
[  --enable-gtkextra       Enable gtkextra support],no)

if test "$PHP_GTK_GTKEXTRA" != "no"; then
  PKG_CHECK_MODULES(GTKEXTRA, [gtkextra-2.0 >= gtkextra_required_version],
  have_gtkextra=yes, have_gtkextra=no)
  if test "$have_gtkextra" != "yes"; then
    AC_MSG_RESULT([Unable to locate gtkextra version gtkextra_required_version or higher: not building])
  else
    AC_DEFINE(HAVE_GTKEXTRA, 1, [gtkextra support])
    PHP_EVAL_INCLINE($GTKEXTRA_CFLAGS)
    if test "$php_gtk_ext_shared" = "yes"; then
      PHP_EVAL_LIBLINE($GTKEXTRA_LIBS, GTKEXTRA_SHARED_LIBADD)
      PHP_SUBST(GTKEXTRA_SHARED_LIBADD)
    else
      PHP_EVAL_LIBLINE($GTKEXTRA_LIBS, PHP_GTK2_SHARED_LIBADD)
    fi
    PHP_GTK_EXTENSION(extra, $php_gtk_ext_shared, php_gtkextra.c, gen_gtkextra.c)
  fi
fi


AC_DEFUN([LIBUNWIND___THREAD],
[dnl Check whether the compiler supports the __thread keyword.
if test "x$use__thread" != xno; then
  AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
		 [cat > conftest.c <<\EOF
    __thread int a = 42;
EOF
  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
    libc_cv_gcc___thread=yes
  else
    libc_cv_gcc___thread=no
  fi
  rm -f conftest*])
  if test "$libc_cv_gcc___thread" = yes; then
    AC_DEFINE(HAVE___THREAD, 1,
	[Define to 1 if __thread keyword is supported by the C compiler.])
  fi
else
  libc_cv_gcc___thread=no
fi])

Check $enable___thread instead of $use__thread.

AC_DEFUN([LIBUNWIND___THREAD],
[dnl Check whether the compiler supports the __thread keyword.
if test "x$enable___thread" != xno; then
  AC_CACHE_CHECK([for __thread], libc_cv_gcc___thread,
		 [cat > conftest.c <<\EOF
    __thread int a = 42;
EOF
  if AC_TRY_COMMAND([${CC-cc} $CFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD]); then
    libc_cv_gcc___thread=yes
  else
    libc_cv_gcc___thread=no
  fi
  rm -f conftest*])
  if test "$libc_cv_gcc___thread" = yes; then
    AC_DEFINE(HAVE___THREAD, 1,
	[Define to 1 if __thread keyword is supported by the C compiler.])
  fi
else
  libc_cv_gcc___thread=no
fi])


# Dockerfile for Stackage LTS on Centos6, with some custom dependencies.
FROM       lancelet/centos6-lts-a:M4_DOCKER_IMAGE_VERSION
MAINTAINER Jonathan Merritt <j.s.merritt@gmail.com>

## Haskell environment
ENV PATH $HOME/local/.bin:$PATH
ENV STACK_PROJECTDIR M4_STACK_PROJECTDIR
ENV STACK_WORKDIR M4_STACK_WORKDIR
ENV STACK_YAML M4_STACK_YAML
ENV STACK_SETUP M4_STACK_SETUP
ENV STACK_INSTALL M4_STACK_INSTALL

## Copy across stack.yaml
RUN mkdir -p $STACK_PROJECTDIR
RUN mkdir -p $STACK_WORKDIR
ADD stack.yaml $STACK_YAML

## Some common libraries
WORKDIR $STACK_PROJECTDIR
RUN $STACK_INSTALL \
    SHA \
    base64-bytestring \
    byteable \
    cereal \
    cmdargs \
    digest \
    dlist \
    extra \
    hslua \
    lens \
    mtl \
    cryptonite \
    happy \
    network \
    primitive \
    socks \
    stm \
    async \
    strict \
    transformers-compat \
    exceptions \
    mmorph \
    attoparsec \
    semigroups \
    haskell-src-exts

Add things to the b image

# Dockerfile for Stackage LTS on Centos6, with some custom dependencies.
FROM       lancelet/centos6-lts-a:M4_DOCKER_IMAGE_VERSION
MAINTAINER Jonathan Merritt <j.s.merritt@gmail.com>

## Haskell environment
ENV PATH $HOME/local/.bin:$PATH
ENV STACK_PROJECTDIR M4_STACK_PROJECTDIR
ENV STACK_WORKDIR M4_STACK_WORKDIR
ENV STACK_YAML M4_STACK_YAML
ENV STACK_SETUP M4_STACK_SETUP
ENV STACK_INSTALL M4_STACK_INSTALL

## Copy across stack.yaml
RUN mkdir -p $STACK_PROJECTDIR
RUN mkdir -p $STACK_WORKDIR
ADD stack.yaml $STACK_YAML

## Some common libraries
WORKDIR $STACK_PROJECTDIR
RUN $STACK_INSTALL \
    SHA \
    aeson \
    async \
    attoparsec \
    bytestring \
    base64-bytestring \
    blaze-html \
    byteable \
    cereal \
    cmdargs \
    cryptonite \
    digest \
    dlist \
    exceptions \
    extra \
    haddock-library \
    happy \
    haskell-src-exts \
    hslua \
    http-types \
    lens \
    mmorph \
    mtl \
    network \
    parsec \
    primitive \
    random \
    regex-base \
    regex-pcre-builtin \
    semigroups \
    socks \
    stm \
    strict \
    transformers-compat


dnl @synopsis smr_WITH_BUILD_PATH
dnl
dnl This macro adds a "--with-build-path" option to the configure script.
dnl This configure option provides a convenient way to add "-I" options
dnl to CPPFLAGS and "-L" options to LDFLAGS, at configure time.
dnl
dnl Invoking "./configure --with-build-path=DIR" results in
dnl "-I DIR/include" being added to CPPFLAGS if DIR/include exists,
dnl and "-L DIR/lib" being added to LDFLAGS if DIR/lib exists.
dnl
dnl Separate multiple directories using colons; e.g.
dnl "--with-build-path=DIR1:DIR2:DIR3".
dnl
dnl @version $Id: smr_WITH_BUILD_PATH.m4,v 1.2 2001-07-25 04:22:49 stever Exp $
dnl @author Steve M. Robbins <smr@debian.org>

AC_DEFUN([smr_WITH_BUILD_PATH],
[
    AC_ARG_WITH([build-path],
    [  --with-build-path=DIR   build using DIR/include and DIR/lib],
    [
	for d in `echo $withval | tr : ' '`; do
	    test -d $d/include && CPPFLAGS="$CPPFLAGS -I$d/include"
	    test -d $d/lib && LDFLAGS="$LDFLAGS -L$d/lib"
	done
    ])
])

Add an error when the build path is not found.

dnl @synopsis smr_WITH_BUILD_PATH
dnl
dnl This macro adds a "--with-build-path" option to the configure script.
dnl This configure option provides a convenient way to add "-I" options
dnl to CPPFLAGS and "-L" options to LDFLAGS, at configure time.
dnl
dnl Invoking "./configure --with-build-path=DIR" results in
dnl "-I DIR/include" being added to CPPFLAGS if DIR/include exists,
dnl and "-L DIR/lib" being added to LDFLAGS if DIR/lib exists.
dnl
dnl Separate multiple directories using colons; e.g.
dnl "--with-build-path=DIR1:DIR2:DIR3".
dnl
dnl @version $Id: smr_WITH_BUILD_PATH.m4,v 1.3 2004-04-07 14:20:09 bert Exp $
dnl @author Steve M. Robbins <smr@debian.org>

AC_DEFUN([smr_WITH_BUILD_PATH],
[
    AC_ARG_WITH([build-path],
    [  --with-build-path=DIR   build using DIR/include and DIR/lib],
    [
	for d in `echo $withval | tr : ' '`; do
            test -d $d || AC_MSG_ERROR([build path $d not found.])
	    test -d $d/include && CPPFLAGS="$CPPFLAGS -I$d/include"
	    test -d $d/lib && LDFLAGS="$LDFLAGS -L$d/lib"
	done
    ])
])


PHP_ARG_WITH(phpwkhtmltox, [for libwkhtmltox support],
[  --with-phpwkhtmltox     Include libwkhtmltox support])

if test "$PHP_PHPWKHTMLTOX" != "no"; then
    for i in /usr /usr/local /opt; do
        if test -f $i/include/wkhtmltox/pdf.h; then
            WKHTMLTOX_LIB_DIR=$i/lib
            WKHTMLTOX_INC_DIR=$i/include
            AC_MSG_RESULT([found in $i])
        fi
    done

    if test -z "$WKHTMLTOX_LIB_DIR" -o -z "$WKHTMLTOX_INC_DIR"; then
        AC_MSG_RESULT([not found])
        AC_MSG_ERROR([Please install libwkhtmltox])
    fi

    PHP_CHECK_LIBRARY(wkhtmltox, wkhtmltopdf_init,
        [
        PHP_ADD_LIBRARY_WITH_PATH(wkhtmltox, $WKHTMLTOX_LIB_DIR, PHPWKHTMLTOX_SHARED_LIBADD)
        AC_DEFINE(HAVE_PHPWKHTMLTOX, 1, [libwkhtmltox passed])
        ],
        [AC_MSG_ERROR([libwkhtmltox version 0.10 or later required])],
        [-L$WKHTMLTOX_LIB_DIR -R$WKHTMLTOX_LIB_DIR])

    PHP_SUBST(PHPWKHTMLTOX_SHARED_LIBADD)
    PHP_ADD_INCLUDE($WKHTMLTOX_INC_DIR)
    PHP_NEW_EXTENSION(phpwkhtmltox, phpwkhtmltox.c, $ext_shared)
fi

Make it possible to pass a custom base directory for libwkhtmltox.

PHP_ARG_WITH(phpwkhtmltox, [for libwkhtmltox support],
[  --with-phpwkhtmltox=[DIR]     Include libwkhtmltox support])

if test "$PHP_PHPWKHTMLTOX" != "no"; then
    for i in $PHP_PHPWKHTMLTOX /usr /usr/local /opt; do
        if test -f $i/include/wkhtmltox/pdf.h; then
            WKHTMLTOX_LIB_DIR=$i/lib
            WKHTMLTOX_INC_DIR=$i/include
            AC_MSG_RESULT([found in $i])
        fi
    done

    if test -z "$WKHTMLTOX_LIB_DIR" -o -z "$WKHTMLTOX_INC_DIR"; then
        AC_MSG_RESULT([not found])
        AC_MSG_ERROR([Please install libwkhtmltox])
    fi

    PHP_CHECK_LIBRARY(wkhtmltox, wkhtmltopdf_init,
        [
        PHP_ADD_LIBRARY_WITH_PATH(wkhtmltox, $WKHTMLTOX_LIB_DIR, PHPWKHTMLTOX_SHARED_LIBADD)
        AC_DEFINE(HAVE_PHPWKHTMLTOX, 1, [libwkhtmltox passed])
        ],
        [AC_MSG_ERROR([libwkhtmltox version 0.10 or later required])],
        [-L$WKHTMLTOX_LIB_DIR -R$WKHTMLTOX_LIB_DIR])

    PHP_SUBST(PHPWKHTMLTOX_SHARED_LIBADD)
    PHP_ADD_INCLUDE($WKHTMLTOX_INC_DIR)
    PHP_NEW_EXTENSION(phpwkhtmltox, phpwkhtmltox.c, $ext_shared)
fi


#
# urbi-sockets.m4: This file is part of build-aux.
# Copyright (C) Gostai S.A.S., 2006-2008.
#
# This software is provided "as is" without warranty of any kind,
# either expressed or implied, including but not limited to the
# implied warranties of fitness for a particular purpose.
#
# See the LICENSE file for more information.
# For comments, bug reports and feedback: http://www.urbiforge.com
#

# URBI_SOCKETS
# ------------
# Add the required library to use sockets.
AC_DEFUN([URBI_SOCKETS],
[AC_REQUIRE([URBI_WIN32])
if $windows; then
  AC_SUBST([SOCKETS_LIBS], ['-lws2_32 -lMsWSock'])
fi

SDK_LIBS+=" $SOCKETS_LIBS"
])

Use lowercase library names under windows.

#
# urbi-sockets.m4: This file is part of build-aux.
# Copyright (C) Gostai S.A.S., 2006-2008.
#
# This software is provided "as is" without warranty of any kind,
# either expressed or implied, including but not limited to the
# implied warranties of fitness for a particular purpose.
#
# See the LICENSE file for more information.
# For comments, bug reports and feedback: http://www.urbiforge.com
#

# URBI_SOCKETS
# ------------
# Add the required library to use sockets.
AC_DEFUN([URBI_SOCKETS],
[AC_REQUIRE([URBI_WIN32])
if $windows; then
  AC_SUBST([SOCKETS_LIBS], ['-lws2_32 -lmswsock'])
fi

SDK_LIBS+=" $SOCKETS_LIBS"
])


AC_DEFUN([LSC_CHECK_SCTP], [
  have_sctp=no

  AC_ARG_ENABLE(sctp,
    AS_HELP_STRING([--enable-sctp], [enable SCTP support [[default=yes]]]),,
	enable_sctp="yes")

  AC_MSG_CHECKING([whether to enable SCTP support])
  AS_IF([test "x$enable_sctp" = "xyes"], [
    AC_MSG_RESULT([yes, checking prerequisites])

    AC_CHECK_TYPE([struct sctp_sndrcvinfo], [
        save_LIBS="$LIBS"
        AC_SEARCH_LIBS([sctp_recvmsg], [sctp], [
          SCTP_LIBS="${LIBS%${save_LIBS}}"
	  have_sctp=yes
	  AC_DEFINE([HAVE_SCTP], [1], [Define this if you have libsctp])
	])
	LIBS="$save_LIBS"
	],
      AC_MSG_WARN([SCTP disabled: headers not found]),
      [#include <netinet/sctp.h>
      ])
  ], [
    AC_MSG_RESULT([no, disabled by user])
  ])

  AC_SUBST([SCTP_LIBS])

  AM_CONDITIONAL([HAVE_SCTP], [test "x$have_sctp" = "xyes"])
])

Update SCTP check from netembryo.

AC_DEFUN([LSC_CHECK_SCTP], [
  have_sctp=no

  AC_ARG_ENABLE(sctp,
    AS_HELP_STRING([--enable-sctp], [enable SCTP support [[default=yes]]]),,
	enable_sctp="yes")

  AC_MSG_CHECKING([whether to enable SCTP support])
  AS_IF([test "x$enable_sctp" = "xyes"], [
    AC_MSG_RESULT([yes, checking prerequisites])

    AC_CHECK_HEADERS([sys/socket.h])

    AC_CHECK_TYPE([struct sctp_sndrcvinfo], [
        save_LIBS="$LIBS"
        AC_SEARCH_LIBS([sctp_recvmsg], [sctp], [
          SCTP_LIBS="${LIBS%${save_LIBS}}"
	  have_sctp=yes
	  AC_DEFINE([HAVE_SCTP], [1], [Define this if you have libsctp])
	])
	LIBS="$save_LIBS"
	],
      AC_MSG_WARN([SCTP disabled: headers not found]),
      [#ifdef HAVE_SYS_SOCKET_H
       #include <sys/socket.h>
       #endif
       #include <netinet/sctp.h>
      ])
  ], [
    AC_MSG_RESULT([no, disabled by user])
  ])

  AC_SUBST([SCTP_LIBS])

  AM_CONDITIONAL([HAVE_SCTP], [test "x$have_sctp" = "xyes"])
])


AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
[changequote(<<, >>)dnl
dnl The name to #define.
define(<<AC_TYPE_NAME>>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
dnl The cache variable name.
define(<<AC_CV_NAME>>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
changequote([, ])dnl
AC_MSG_CHECKING(size of $1)
AC_CACHE_VAL(AC_CV_NAME,
[for ac_size in 4 8 1 2 16 $2 ; do # List sizes in rough order of prevalence.
  AC_TRY_COMPILE([#include "confdefs.h"
#include <sys/types.h>
$2
], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
  if test x$AC_CV_NAME != x ; then break; fi
done
])
if test x$AC_CV_NAME = x ; then
  AC_MSG_ERROR([cannot determine a size for $1])
fi
AC_MSG_RESULT($AC_CV_NAME)
AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
undefine([AC_TYPE_NAME])dnl
undefine([AC_CV_NAME])dnl
])

Fix `undefined macro: AC_TYPE_NAME` error in autotools

AC_DEFUN([AC_COMPILE_CHECK_SIZEOF],
[changequote(<<, >>)dnl
dnl The name to #define.
define(AC_TYPE_NAME, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl
dnl The cache variable name.
define(AC_CV_NAME, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
changequote([, ])dnl
AC_MSG_CHECKING(size of $1)
AC_CACHE_VAL(AC_CV_NAME,
[for ac_size in 4 8 1 2 16 $2 ; do # List sizes in rough order of prevalence.
  AC_TRY_COMPILE([#include "confdefs.h"
#include <sys/types.h>
$2
], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size)
  if test x$AC_CV_NAME != x ; then break; fi
done
])
if test x$AC_CV_NAME = x ; then
  AC_MSG_ERROR([cannot determine a size for $1])
fi
AC_MSG_RESULT($AC_CV_NAME)
AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1])
undefine([AC_TYPE_NAME])dnl
undefine([AC_CV_NAME])dnl
])


dnl
dnl AM_PATH_ACE(MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl
AC_DEFUN([AM_PATH_ACE],
[

AC_ARG_WITH([ace-include-prefix],
            [  --with-ace-include-prefix=PFX   Prefix where ACE headers are installed (optional)],
            [ACE_CPPFLAGS="-I$withval"],
            [ACE_CPPFLAGS="-I/usr/include"])
AC_ARG_WITH([ace-lib-prefix],
            [  --with-ace-lib-prefix=PFX   Prefix where ACE libs are installed (optional)],
            [ACE_LIBS="-L$withval/ace -lACE"],
            [ACE_LIBS="-L/usr/lib -lACE"])

dnl override variables if ACE_ROOT variable is set
AC_MSG_CHECKING([for ACE_ROOT environment])

if test "x$ACE_ROOT" = x ; then
   AC_MSG_RESULT([no])
else
   AC_MSG_RESULT([yes])
   ACE_CPPFLAGS="-I$ACE_ROOT"
   ACE_LIBS="-L$ACE_ROOT/ace -lACE"
fi

no_ace=""

old_CPPFLAGS=$CPPFLAGS
old_LIBS=$LIBS

AC_LANG_PUSH([C++])

CPPFLAGS=$ACE_CPPFLAGS
LIBS=$ACE_LIBS

AC_CHECK_HEADER([ace/ACE.h], [], [no_ace="yes"], [])
AC_CHECK_LIB([ACE], [main], [], [no_ace="yes"], [])

CPPFLAGS=$old_CPPFLAGS
LIBS=$old_LIBS

AC_LANG_POP([C++])

if test "x$no_ace" = x ; then
   ifelse([$2], [], [:], [$2])
else
   ACE_CPPFLAGS=""
   ACE_LIBS=""
   ifelse([$3], [], [:], [$3])
fi

AC_SUBST([ACE_CPPFLAGS])
AC_SUBST([ACE_LIBS])
])


AC_DEFUN([BANSHEE_CHECK_GTK_SHARP],
[
	GTKSHARP3_REQUIRED=2.99

	PKG_CHECK_MODULES(GLIBSHARP, glib-sharp-3.0 >= $GTKSHARP3_REQUIRED)
	PKG_CHECK_MODULES(GTKSHARP, gtk-sharp-3.0 >= GTKSHARP3_REQUIRED)

	AC_SUBST(GLIBSHARP_LIBS)
])

Fix previous commit to also AC_SUBST(GTKSHARP_LIBS)

AC_DEFUN([BANSHEE_CHECK_GTK_SHARP],
[
	GTKSHARP3_REQUIRED=2.99

	PKG_CHECK_MODULES(GLIBSHARP, glib-sharp-3.0 >= $GTKSHARP3_REQUIRED)
	PKG_CHECK_MODULES(GTKSHARP, gtk-sharp-3.0 >= GTKSHARP3_REQUIRED)

	AC_SUBST(GLIBSHARP_LIBS)
	AC_SUBST(GTKSHARP_LIBS)
])


AC_DEFUN([BANSHEE_CHECK_DAP_APPLEDEVICE],
[
	LIBGPODSHARP_REQUIRED=0.1

	AC_ARG_ENABLE(appledevice, AC_HELP_STRING([--disable-appledevice], [Disable Apple device (iPhone, iPod, iPad) DAP support]), , enable_appledevice="yes")

	if test "x$enable_appledevice" = "xyes"; then
		has_libgpod=no
		PKG_CHECK_MODULES(LIBGPODSHARP,
			libgpod-sharp >= $LIBGPODSHARP_REQUIRED,
			has_libgpod=yes, has_libgpod=no)
		if test "x$has_libgpod" = "xno"; then
			AC_MSG_ERROR([libgpod-sharp was not found or is not up to date. Please install libgpod-sharp of at least version $LIBGPODSHARP_REQUIRED, or disable Apple device support by passing --disable-appledevice])
		fi
	fi

	if test "x$enable_appledevice" = "xyes"; then
		asm="`$PKG_CONFIG --variable=Libraries libgpod-sharp`"
		LIBGPODSHARP_ASSEMBLIES="$LIBGPODSHARP_ASSEMBLIES $asm"
		[[ -r "$asm.mdb" ]] && LIBGPODSHARP_ASSEMBLIES="$LIBGPODSHARP_ASSEMBLIES $asm.mdb"
		AC_SUBST(LIBGPODSHARP_ASSEMBLIES)
	fi

	AM_CONDITIONAL(ENABLE_APPLEDEVICE, test "x$enable_appledevice" = "xyes")
])


AC_ARG_WITH(sylpheed-build-dir,
            [AS_HELP_STRING([--with-sylpheed-build-dir=DIR],
            [specify sylpheed build directory.])],
            [syldir="$withval"])
if test "x$syldir" = "x"; then
  # for local build under sylpheed/plugin/PLUGINS
  sylpheed_build_dir=`pwd`/../..
  if test -d "$sylpheed_build_dir/libsylph"; then
    if test -d "$sylpheed_build_dir/src"; then
      syldir_available="yes"
    fi
  fi
  # for Travis-CI
  if test -d "sylpheed/libsylph"; then
     if test -d "sylpheed/src"; then
     	syldir_available="yes"
	sylpheed_build_dir=`pwd`/sylpheed
     fi
  fi
else
  syldir_available="yes"
  sylpheed_build_dir=$syldir
fi
AC_SUBST(sylpheed_build_dir)
AM_CONDITIONAL([WITH_SYLPHEED], [test "$syldir_available" = "yes"])

AC_ARG_WITH(sylplugin-factory-source-dir,
            [AS_HELP_STRING([--with-sylplugin-factory-source-dir=DIR],
            [specify sylpheed-plugin-factory source directory.])],
            [sylpfdir="$withval"])
if test "x$sylpfdir" = "x"; then
  sylpfdir_available="yes"
  sylplugin_factory_source_dir=`pwd`/lib/sylplugin_factory
else
  if test -d "$sylpfdir"; then
    if test -d "$sylpfdir/src"; then
      sylpf_dir_available="yes"
      sylplugin_factory_source_dir=$sylpfdir
    fi
  fi
fi
AC_SUBST(sylplugin_factory_source_dir)
AM_CONDITIONAL([WITH_SYLPLUGIN_FACTORY], [test "$sylpfdir_available" = "yes"])


Move m4 macros from acinclude into m4 directory Use new shout.m4 macro

dnl local M4 configure macros
dnl Brendan Cully <brendan@xiph.org>
dnl $Id: xiph_path_python.m4,v 1.1 2003/06/13 19:22:16 brendan Exp $

# XIPH_PATH_PYTHON(PATH)
# Search for python in PATH, or in the path if none is given.
# Defines PYTHON_CPPFLAGS and PYTHON_LIBS if found
AC_DEFUN([XIPH_PATH_PYTHON],
  [
m4_pushdef([xpp_path], [$1])

PYTHON="no"

if test "xpp_path" != "yes"
then
  AC_MSG_CHECKING([python])
  if test -x "xpp_path"
  then
    PYTHON="xpp_path"
  fi
  AC_MSG_RESULT([$PYTHON])
else
  AC_PATH_PROGS([PYTHON], [python python2 python2.3 python2.2])
fi

m4_popdef([xpp_path])

if test "$PYTHON" != "no"
then
  # The library we're linking against
  PYTHON_LIB="_XIPH_PYTHON_CFG([$PYTHON], [LIBRARY])"

  # if LIBRARY is nonsensical, bail out
  if test $? -ne 0 -o -z "$PYTHON_LIB"
  then
    AC_MSG_WARN([Could not find library for $PYTHON])
    break
  fi
  # make library linker friendly. This is a hack, but I don't know what's better
  PYTHON_LIB=`echo "$PYTHON_LIB" | sed 's/lib//;s/\.a.*//;s/\.so.*//;s/\.dylib.*//'`

  # LDFLAGS
  PYTHON_LDFLAGS="-L[]_XIPH_PYTHON_CFG([$PYTHON], [LIBPL])"

  # Extra libraries required by python
  PYTHON_EXTRA_LIBS="_XIPH_PYTHON_CFG([$PYTHON], [LIBS])"
  PYTHON_EXTRA_LIBS="$PYTHON_EXTRA_LIBS _XIPH_PYTHON_CFG([$PYTHON], [SYSLIBS])"
  PYTHON_EXTRA_LIBS="$PYTHON_EXTRA_LIBS _XIPH_PYTHON_CFG([$PYTHON], [SHLIBS])"

  PYTHON_CPPFLAGS="-I[]_XIPH_PYTHON_CFG([$PYTHON], [INCLUDEPY])"

  # test header and library functionality
  saved_CPPFLAGS="$CPPFLAGS"
  CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS"
  AC_CHECK_HEADER([Python.h],
    [
    saved_LDFLAGS="$LDFLAGS"
    LDFLAGS="$LDFLAGS $PYTHON_LDFLAGS"
    AC_CHECK_LIB([$PYTHON_LIB], [Py_Initialize],
      [PYTHON_LIBS="-l$PYTHON_LIB $PYTHON_EXTRA_LIBS"],
      [AC_MSG_WARN([Could not link to the python library])],
      [$PYTHON_EXTRA_LIBS])
    LDFLAGS="$saved_LDFLAGS"
    ],
    [AC_MSG_WARN([Python.h doesn't appear to be usable])])
  CPPFLAGS="$saved_CPPFLAGS"
fi
  ])dnl

# _XIPH_PYTHON_CFG(PYTHONPATH, CFGVAR)
# Ask python in PYTHONPATH for the definition of CFGVAR
m4_define([_XIPH_PYTHON_CFG],
  [`$1 -c 'from distutils.sysconfig import get_config_var; print get_config_var("$2")' | sed 's/None//'`])


Add URBI_WITH_LTDL. Detect the presence of ltdl.

##
## urbi-with-ltdl.m4: This file is part of build-aux.
## Copyright (C) Gostai S.A.S., 2006-2008.
##
## This software is provided "as is" without warranty of any kind,
## either expressed or implied, including but not limited to the
## implied warranties of fitness for a particular purpose.
##
## See the LICENSE file for more information.
## For comments, bug reports and feedback: http://www.urbiforge.com
##

# URBI_WITH_LTDL
# ----------
# Look for ltdl library.
#
# Set "$ltdl" to "true" or "false".
AC_DEFUN([URBI_WITH_LTDL],
[AC_ARG_WITH([ltdl],
	     [AC_HELP_STRING([--with-ltdl=yes|no],
			     [enable ltdl support])],
	     [], [with_ltdl=yes])

case $with_ltdl in
   no) ltdl=false
       ;;
  *) ltdl=true
       ;;
esac

if $ltdl; then
  AC_SUBST([LTDL_LDADD], ['-lltdl'])
  AC_DEFINE([WITH_LTDL], [1], [Define if you have ltdl])
fi

])

AC_DEFUN([URBI_WITH_LTDL_REQUIRED],
[
   AC_REQUIRE([URBI_WITH_LTDL])

  case "$ltdl" in
    '' | 'false')
     AC_MSG_ERROR(
      [Failed to find ltdl. Please install it or check config.log])
    ;;
   esac
])


Add rules and scripts to do marker based strain tracking of P acnes

#$ -cwd
`#'$ -pe smp _THREADS_
#$ -V
#$ -S /bin/bash
`#'$ -N _SAMPLE_-mpa2-pacnes
#$ -j yes

module load bioinformatics/bowtie2/2.2.5

makefile=/users/maubar/fsbio/metaphlan/scripts/metaphlan2.rosalind.mak

make -r -f ${makefile} sample_name=_SAMPLE_`_'hf read_folder=3_hf threads=_THREADS_ strain


include(src/lib/argb/libargb_argb8888_core_orc.m4)dnl

dnl Blend (dst32, tmp64, a64, argb64)
dnl dst32[inout]: a,r,g,b => argb8888_blend()
dnl tmp64: -
dnl a64[in]: A,A,A,A
dnl argb64[in]: 0a,0r,0g,0b
define(`argb8888_blend',`
x4 convubw $2, $1
x4 mulhuw $2, $2, $3
x4 addw $2, $2, $4
x4 convwb $1, $2')dnl

.function argb8888_sp_argb8888_none_none_blend
.flags 1d
.dest 4 d uint32_t
.source 4 s uint32_t
.temp 8 sw
.temp 8 aw
.temp 8 t1
.temp 4 stmp
.temp 4 dtmp
.temp 4 t2
.temp 2 a16

loadl stmp, s
loadl dtmp, d
argb8888_alpha_get(a16, t2, stmp)
subw a16, 256, a16
mergewl t2, a16, a16
mergelq aw, t2, t2
x4 convubw sw, stmp
argb8888_blend(dtmp, t1, aw, sw)
storel d, dtmp


Add m4 file which was hidden by .gitignore

dnl Check for debug build

dnl Usage: CHECK_ENABLE_DEBUG

AC_DEFUN([CHECK_ENABLE_DEBUG],
[
    AC_ARG_ENABLE([debug],
                  [AS_HELP_STRING([--enable-debug], [Enables assertions])],
                  [debug="$enableval"],
                  [debug="no"])

    AS_IF([test "x$debug" = "xyes"],
          [],
          [AC_DEFINE([NDEBUG])])

]) dnl end CHECK_ENABLE_DEBUG


Check various flags to get pthread support.

# The following is an adaptation of AC_SEARCH_LIBS to
# check for flags required to link with pthread
# SYN_SEARCH_PTHREAD
# --------------------------------------------------------
# Search for a library defining FUNC, if it's not already available.
AC_DEFUN([SYN_SEARCH_PTHREAD],
[AC_CACHE_CHECK([for flags needed for threading], [ac_cv_search_pthread_create],
[ac_func_search_save_LIBS=$LIBS
ac_cv_search_pthread_create=no
AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_create])],
	       [ac_cv_search_pthread_create="none required"])
if test "$ac_cv_search_pthread_create" = no; then
  for ac_lib in -lpthread -Kpthread -Kthread -pthread; do
    LIBS="$ac_lib $5 $ac_func_search_save_LIBS"
    AC_LINK_IFELSE([AC_LANG_CALL([], [pthread_create])],
		   [ac_cv_search_pthread_create="$ac_lib"
break])
  done
fi
LIBS=$ac_func_search_save_LIBS])
AS_IF([test "$ac_cv_search_pthread_create" != no],
  [test "$ac_cv_search_pthread_create" = "none required" || LIBS="$ac_cv_search_pthread_create $LIBS"],
  [])dnl
])


dnl
# urbi-libtool.m4: This file is part of build-aux.
# Copyright (C) Gostai S.A.S., 2008.
dnl
# This software is provided "as is" without warranty of any kind,
# either expressed or implied, including but not limited to the
# implied warranties of fitness for a particular purpose.
dnl
# See the LICENSE file for more information.
# For comments, bug reports and feedback: http://www.urbiforge.com
dnl

AC_DEFUN([URBI_LIBTOOL],
[
if test $ac_cv_cxx_compiler_ms = yes; then
# It is perfectly possible to link with static libraries when building dlls.
# Also for some reason archive_cmds ends up empty for C++ tag.
 AC_CONFIG_COMMANDS([libtool-quirk],
     [sed -i -r -e 's/^archive_cmds=""//' \
     -e 's/^deplibs_check_method=.*/deplibs_check_method=pass_all/' libtool])
 fi
])


Add m4 macro TELISPEECH_REQUIRED that add a --with-telispeech to configure

#
# urbi-with-webots.m4: This file is part of build-aux.
# Copyright (C) 2006-2008, Gostai S.A.S.
#
# This software is provided "as is" without warranty of any kind,
# either expressed or implied, including but not limited to the
# implied warranties of fitness for a particular purpose.
#
# See the LICENSE file for more information.
# For comments, bug reports and feedback: http://www.urbiforge.com
#

# WITH_TELISPEECH
# ----------
# Look for teliSpeech.  Support --with-telispeech=PATH. Check the software
# location.
#
# Output variable TELISPEECH_PATH point to the installation location.
# Set "$telispeech" to "true" or "false".
AC_DEFUN([WITH_TELISPEECH],
[AC_ARG_WITH([telisma],
	     [AC_HELP_STRING([--with-telispeech=telispeech-path],
			     [set the path to teliSpeech [/opt/telisma/teliSpeech]])],
	     [], [with_telispeech=no])

case $with_telispeech in
   no) telispeech=false
       ;;
  yes) telispeech=true
       TELISPEECH_PATH=/opt/telisma/teliSpeech
       ;;
    *) telispeech=true
       TELISPEECH_PATH=$with_telispeech
       ;;
esac

# Checking whether Telispeech is really there.
AC_MSG_CHECKING([for teliSpeech])
if $telispeech; then
  if (test -f "$TELISPEECH_PATH/bin/libtasr_so.so"); then
    AC_MSG_RESULT([$TELISPEECH_PATH])
    telispeech=true
  else
    AC_MSG_RESULT([no, telispeech not found in $TELISPEECH_PATH])
    telispeech=false
  fi
else
  AC_MSG_RESULT([no])
  telispeech=false
fi

if $telispeech; then
  # More tools for teliSpeecj.
  AC_SUBST([TELISPEECH_CPPFLAGS], ['-I$(TELISPEECH_PATH)/include'])
  AC_SUBST([TELISPEECH_LDFLAGS],  ['-L$(TELISPEECH_PATH)/lib -ltasr_so -lTLogger_so -lxsystem_so -licudata -licuuc -lxerces-c -lsisr_so -lAcousticTool_so -laudio_processing_so -lxml2'])
fi

AM_CONDITIONAL([WITH_TELISPEECH], [$telispeech])
AC_SUBST([TELISPEECH_PATH])
])

AC_DEFUN([TELISPEECH_REQUIRED],
[
   AC_REQUIRE([WITH_TELISPEECH])

   case $telispeech in
     '' | false)
       AC_MSG_ERROR([Failed to find teliSpeech. Please install it or check config.log])
     ;;
   esac
])

## Local Variables:
## mode: autoconf
## End:


Add a new m4 file to check if -latomic is needed

# Some versions of gcc/libstdc++ require linking with -latomic if
# using the C++ atomic library.

# Copyright (c) 2015-2016 Tim Kosse <tim.kosse@filezilla-project.org>

# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.

m4_define([_CHECK_ATOMIC_testbody], [[
  #include <atomic>
  #include <cstdint>
  int main() {
    std::atomic<int64_t> a{};
    int64_t v = 5;
    int64_t r = a.fetch_add(v);
    return static_cast<int>(r);
  }
]])

AC_DEFUN([CHECK_ATOMIC], [
  AC_LANG_PUSH(C++)
  AC_MSG_CHECKING([whether std::atomic can be used without link library])
  AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_ATOMIC_testbody])],[
      AC_MSG_RESULT([yes])
    ],[
      AC_MSG_RESULT([no])
      LDFLAGS="$LDFLAGS -latomic"
      AC_MSG_CHECKING([whether std::atomic needs -latomic])
      AC_LINK_IFELSE([AC_LANG_SOURCE([_CHECK_ATOMIC_testbody])],[
          AC_MSG_RESULT([yes])
        ],[
          AC_MSG_RESULT([no])
          AC_MSG_FAILURE([cannot figure out how to use std::atomic])
        ])
    ])
  AC_LANG_POP
])


Add autoconf macro for a dependency's dependency

dnl @synopsis AX_LANG_COMPILER_MS
dnl
dnl Check whether the compiler for the current language is Microsoft.
dnl
dnl This macro is modeled after _AC_LANG_COMPILER_GNU in the GNU
dnl Autoconf implementation.
dnl
dnl @category InstalledPackages
dnl @author Braden McDaniel <braden@endoframe.com>
dnl @version 2004-11-15
dnl @license AllPermissive

AC_DEFUN([AX_LANG_COMPILER_MS],
[AC_CACHE_CHECK([whether we are using the Microsoft _AC_LANG compiler],
                [ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [[#ifndef _MSC_VER
       choke me
#endif
]])],
                   [ax_compiler_ms=yes],
                   [ax_compiler_ms=no])
ax_cv_[]_AC_LANG_ABBREV[]_compiler_ms=$ax_compiler_ms
])])


Add a PKG_CHECK_VAR implementation if not defined

m4_ifndef([PKG_CHECK_VAR], [
# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# -------------------------------------------
# Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl

_PKG_CONFIG([$1], [variable="][$3]["], [$2])
AS_VAR_COPY([$1], [pkg_cv_][$1])

AS_VAR_IF([$1], [""], [$5], [$4])dnl
])# PKG_CHECK_VAR
])


Add project local autoconf hook to link pthread

AC_DEFUN([AX_PROJECT_LOCAL_HOOK], [
    AC_CHECK_HEADERS(pthread.h)
    AC_CHECK_LIB([pthread], [pthread_create],
        [CFLAGS="${CFLAGS} -pthread"],
        [AC_MSG_ERROR([cannot link with -pthread.])]
    )
])


dnl Check for CURL Libraries
dnl CHECK_CURL(ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
dnl Sets:
dnl  CURL_CFLAGS
dnl  CURL_LIBS

CURL_CONFIG="curl-config"
CURL_CFLAGS=""
CURL_LIBS=""

AC_DEFUN([CHECK_CURL],
[dnl

AC_ARG_WITH(
    curl,
    [AC_HELP_STRING([--with-curl=PATH],[Path to the curl prefix])],
    curl_path="$withval",
    :)

dnl # Determine curl lib directory
if test -z "${curl_path}"; then
    test_paths="/usr/local /usr"
else
    test_paths="${curl_path}"
fi

AC_MSG_CHECKING([for libcurl config script])
for x in ${test_paths}; do
    if test -e "${x}/bin/${CURL_CONFIG}"; then
        with_curl="${x}/bin"
        break
    else
        with_curl=""
    fi
done
if test -n "${with_curl}"; then
    CURL_CONFIG="${with_curl}/${CURL_CONFIG}"
    AC_MSG_RESULT([${CURL_CONFIG}])
    CURL_CFLAGS="`${CURL_CONFIG} --cflags`"
    CURL_LIBS="`${CURL_CONFIG} --libs`"
    CFLAGS=$save_CFLAGS
    LDFLAGS=$save_LDFLAGS
else
    AC_MSG_RESULT([no])
fi

AC_SUBST(CURL_LIBS)
AC_SUBST(CURL_CFLAGS)

if test -z "${CURL_LIBS}"; then
  AC_MSG_NOTICE([*** curl library not found.])
  ifelse([$2], , AC_MSG_NOTICE([NOTE: curl library is required for building mlogc]), $2)
else
  AC_MSG_NOTICE([using '${CURL_LIBS}' for curl Library])
  ifelse([$1], , , $1)
fi
])


Add a new macro for configuring projects, LLVM_CONFIG_PROJECT. This macro takes care of the --with-llvmsrc and --with-llvmobj options for the project It was moved here from the project's configure.ac file because there is some tricky handling of the llvm_src variable to tell the project where the llvm source tree is (for mkinstalldirs and install-sh commands).

#
# Provide the arguments and other processing needed for an LLVM project
#
AC_DEFUN([LLVM_CONFIG_PROJECT],
  [AC_ARG_WITH([llvmsrc],
    AS_HELP_STRING([--with-llvmsrc],[Location of LLVM Source Code]),
    [llvm_src="$withval"],[llvm_src=`cd ${srcdir}/../..; pwd`])
  AC_SUBST(LLVM_SRC,$llvm_src)
  AC_ARG_WITH([llvmobj],
    AS_HELP_STRING([--with-llvmobj],[Location of LLVM Object Code]),
    [llvm_obj="$withval"],[llvm_obj=`cd ../..; pwd`])
  AC_SUBST(LLVM_OBJ,$llvm_obj)
  AC_CONFIG_COMMANDS([setup],,[llvm_src="${LLVM_SRC}"])
])


Add the libcurl check to the m4 archive.

dnl XIPH_PATH_CURL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libcurl, and define CURL_CFLAGS and CURL_LIBS
dnl
AC_DEFUN(XIPH_PATH_CURL,
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(curl,
    AC_HELP_STRING([--with-curl=PFX],[Prefix where libcurl is installed (optional)]),
    curl_prefix="$withval", curl_prefix="")
AC_ARG_WITH(curl-config,
    AC_HELP_STRING([--with-curl-config=curl-config],[Use curl-config to find libcurl]),
    CURL_CONFIG="$withval", [AC_PATH_PROGS(CURL_CONFIG, [curl-config], "")])

if test "x$curl_prefix" != "x"; then
    CURL_LIBS="-L$curl_prefix/lib -lcurl"
    CURL_CFLAGS="-I$curl_prefix/include"
elif test "x$CURL_CONFIG" != "x"; then
    if ! test -x "$CURL_CONFIG"; then
        AC_MSG_ERROR([$CURL_CONFIG cannot be executed])
    fi
    CURL_LIBS="$($CURL_CONFIG --libs)"
    CURL_CFLAGS="$($CURL_CONFIG --cflags)"
else
    if test "x$prefix" != "xNONE"; then
        CURL_LIBS="-L$prefix/lib"
        CURL_CFLAGS="-I$prefix/include"
    fi
    CURL_LIBS="$CURL_LIBS -lcurl"
fi

curl_ok="yes"

ac_curl_CFLAGS="$CFLAGS"
ac_curl_LIBS="$LIBS"
CFLAGS="$CFLAGS $CURL_CFLAGS"
LIBS="$LIBS $CURL_LIBS"
dnl
dnl Now check if the installed libcurl is sufficiently new.
dnl
AC_CHECK_HEADERS([curl/curl.h],, curl_ok="no")
AC_MSG_CHECKING(for libcurl)
if test "$curl_ok" = "yes"; then
    AC_TRY_RUN([
#include <curl/curl.h>
int main()
{
    return 0;
}
],,[curl_ok="no"])
fi
CFLAGS="$ac_curl_CFLAGS"
LIBS="$ac_curl_LIBS"

if test "$curl_ok" = "yes"; then
    AC_MSG_RESULT(yes)
    AC_DEFINE(HAVE_CURL, 1, [Define if you have libcurl.])
    ifelse([$1], , :, [$1])
else
    AC_MSG_RESULT(no)
    ifelse([$2], , :, [$2])
fi
])


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

	<xsl:template match="/">
		<feedbackform>
			<recipients>
				<recipient><xsl:text>junkspam0002@gmail.com</xsl:text></recipient>
			</recipients>
			<from><xsl:value-of select="root/name" /></from>
			<subject><xsl:text>Feedback GUI 3.0</xsl:text></subject>
			<name><xsl:value-of select="root/name" /></name>
			<message>
				<rating><xsl:value-of select="root/rating"/></rating>
				<feedback><xsl:value-of select="root/feedback" /></feedback>
			</message>
		</feedbackform>
	</xsl:template>

</xsl:stylesheet>

Add anonymous name and correct email

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>

	<xsl:template match="/">
		<feedbackform>
			<recipients>
				<recipient><xsl:text>1234@integrationpartners.nl</xsl:text></recipient>
			</recipients>
			<from>
				<xsl:choose>
					<xsl:when test="root/name=''"><xsl:text>Anonymous</xsl:text></xsl:when>
					<xsl:otherwise><xsl:value-of select="root/name" /></xsl:otherwise>
				</xsl:choose>
			</from>
			<subject><xsl:text>Feedback GUI 3.0</xsl:text></subject>
			<name>
				<xsl:choose>
					<xsl:when test="root/name=''"><xsl:text>Anonymous</xsl:text></xsl:when>
					<xsl:otherwise><xsl:value-of select="root/name" /></xsl:otherwise>
				</xsl:choose>
			</name>
			<message>
				<rating><xsl:value-of select="root/rating"/></rating>
				<feedback><xsl:value-of select="root/feedback" /></feedback>
			</message>
		</feedbackform>
	</xsl:template>

</xsl:stylesheet>


<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml" indent="yes"/>

<xsl:template match="Class">
<BirdInfo>
	<xsl:apply-templates select="*"/>
</BirdInfo>
</xsl:template>

<xsl:template match="Order">
  <xsl:element name="{@Name}">
	<xsl:apply-templates select="*"/>
  </xsl:element>
</xsl:template>

<xsl:template match="Family">
  <xsl:element name="{@Name}">
	<xsl:apply-templates select="*"/>
  </xsl:element>
</xsl:template>

<xsl:template match="Species">
	<xsl:copy-of select="."/>
</xsl:template>

</xsl:stylesheet>

Add some stuff to generate comments and PIs.

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml" indent="yes"/>

<xsl:template match="Class">
<BirdInfo>
	<xsl:apply-templates select="*"/>
</BirdInfo>
</xsl:template>

<xsl:template match="Order">
  <xsl:element name="{@Name}">
	<xsl:apply-templates select="*"/>
  </xsl:element>
</xsl:template>

<xsl:template match="Family">
  <xsl:processing-instruction name="{parent::Order/@Name}">Parent Order</xsl:processing-instruction>
  <xsl:element name="{@Name}">
	<xsl:apply-templates select="*"/>
  </xsl:element>
</xsl:template>

<xsl:template match="Species">
    <xsl:comment>This is a species...</xsl:comment>
	<xsl:copy-of select="."/>
</xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:html="http://www.w3.org/1999/xhtml"
  xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
  xmlns:tei="http://www.tei-c.org/ns/1.0"
  xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xsl xd tei html">
  <xsl:import href="fcs/result2view_v1.xsl"/>
  <xsl:output method="html" media-type="text/xhtml" indent="yes" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>

  <xsl:template name="getTitle">
    <xsl:apply-templates select=".//tei:author" mode="record-data"/>: <xsl:value-of select=".//tei:title"/>
  </xsl:template>

</xsl:stylesheet>

Change title to just some non breakable space.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:html="http://www.w3.org/1999/xhtml"
  xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
  xmlns:tei="http://www.tei-c.org/ns/1.0"
  xmlns="http://www.w3.org/1999/xhtml" exclude-result-prefixes="xsl xd tei html">
  <xsl:import href="fcs/result2view_v1.xsl"/>
  <xsl:output method="html" media-type="text/xhtml" indent="yes" encoding="UTF-8" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/>

  <xsl:template name="getTitle">
    <xsl:text> </xsl:text>
  </xsl:template>

</xsl:stylesheet>


<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:output method="xml" indent="yes"/>
  <xsl:strip-space elements="*"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="*">
    <xsl:copy>
      <!-- Sort the attributes by name. -->
      <xsl:for-each select="@*">
        <xsl:sort select="name( . )"/>
        <xsl:copy/>
      </xsl:for-each>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="text()|comment()|processing-instruction()">
    <xsl:copy/>
  </xsl:template>

</xsl:stylesheet>

Delete xml:base and dedup models output.

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:output method="xml" indent="yes"/>
  <xsl:strip-space elements="*"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="*">
    <xsl:copy>
      <!-- Sort the attributes by name and remove the xml:base attribute -->
      <xsl:for-each select="@*[name()!='xml:base']">
        <xsl:sort select="name( . )"/>
        <xsl:copy/>
      </xsl:for-each>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>

  <!-- Remove duplicate model nodes -->
  <xsl:key name="model-by-name" match="model" use="@name" />
  <xsl:template match="models">
    <models>
      <xsl:for-each select="model[count(. | key('model-by-name', @name)[1]) = 1]">
        <xsl:copy>
          <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
          <xsl:apply-templates/>
        </xsl:copy>
      </xsl:for-each>
    </models>
  </xsl:template>

  <xsl:template match="text()|comment()|processing-instruction()">
    <xsl:copy/>
  </xsl:template>

</xsl:stylesheet>


<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sf="http://soap.sforce.com/2006/04/metadata" xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xslt="http://xml.apache.org/xslt" xmlns:xalan="http://xml.apache.org/xalan" exclude-result-prefixes="sf">
  <xsl:output method="xml" indent="yes" xsl:indent-amount="2" xslt:indent-amount="2" xalan:indent-amount="2" />

  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
  </xsl:template>

  <xsl:template match="sf:Package">
    <xsl:copy>
      <xsl:apply-templates select="@*" />
      <xsl:apply-templates select="sf:installClass" />
      <xsl:apply-templates select="sf:uninstallClass" />
      <xsl:apply-templates select="sf:fullName" />
      <xsl:apply-templates select="sf:types">
        <xsl:sort select="sf:name"/>
      </xsl:apply-templates>
      <xsl:apply-templates select="sf:version" />
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>

Add support for postInstallClass and uninstallClass elements

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sf="http://soap.sforce.com/2006/04/metadata" xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xslt="http://xml.apache.org/xslt" xmlns:xalan="http://xml.apache.org/xalan" exclude-result-prefixes="sf">
  <xsl:output method="xml" indent="yes" xsl:indent-amount="2" xslt:indent-amount="2" xalan:indent-amount="2" />

  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()" />
    </xsl:copy>
  </xsl:template>

  <xsl:template match="sf:Package">
    <xsl:copy>
      <xsl:apply-templates select="@*" />
      <xsl:apply-templates select="sf:fullName" />
      <xsl:apply-templates select="sf:postInstallClass" />
      <xsl:apply-templates select="sf:types">
        <xsl:sort select="sf:name"/>
      </xsl:apply-templates>
      <xsl:apply-templates select="sf:uninstallClass" />
      <xsl:apply-templates select="sf:version" />
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>


<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:output method="xml" indent="yes"/>
  <xsl:strip-space elements="*"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="*">
    <xsl:copy>
      <!-- Sort the attributes by name and remove the xml:base attribute -->
      <xsl:for-each select="@*[name()!='xml:base']">
        <xsl:sort select="name( . )"/>
        <xsl:copy/>
      </xsl:for-each>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>

  <!-- Remove duplicate model nodes -->
  <xsl:key name="model-by-name" match="model" use="@name" />
  <xsl:template match="models">
    <models>
      <xsl:for-each select="model[count(. | key('model-by-name', @name)[1]) = 1]">
        <xsl:copy>
          <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
          <xsl:apply-templates/>
        </xsl:copy>
      </xsl:for-each>
    </models>
  </xsl:template>

  <xsl:template match="text()|comment()|processing-instruction()">
    <xsl:copy/>
  </xsl:template>

</xsl:stylesheet>

Normalize white space in attributes.

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

  <xsl:output method="xml" indent="yes"/>
  <xsl:strip-space elements="*"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="*">
    <xsl:copy>
      <!-- Sort the attributes by name and remove the xml:base attribute -->
      <xsl:for-each select="@*[name()!='xml:base']">
        <xsl:sort select="name( . )"/>
        <xsl:attribute name="{local-name()}"><xsl:value-of select="normalize-space(.)"/></xsl:attribute>
      </xsl:for-each>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>

  <!-- Remove duplicate model nodes -->
  <xsl:key name="model-by-name" match="model" use="@name" />
  <xsl:template match="models">
    <models>
      <xsl:for-each select="model[count(. | key('model-by-name', @name)[1]) = 1]">
        <xsl:copy>
          <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
          <xsl:apply-templates/>
        </xsl:copy>
      </xsl:for-each>
    </models>
  </xsl:template>

  <xsl:template match="text()|comment()|processing-instruction()">
    <xsl:copy/>
  </xsl:template>

</xsl:stylesheet>


<xsl:stylesheet version="1.0"
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
            xmlns:msxsl="urn:schemas-microsoft-com:xslt"
            exclude-result-prefixes="msxsl"
            xmlns:wix="http://schemas.microsoft.com/wix/2006/wi"
            xmlns:my="my:my">

    <xsl:output method="xml" indent="yes" />

    <xsl:strip-space elements="*"/>

    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>
    <!-- Add the service install/control entries to mybinary.exe -->
    <xsl:template match="wix:Component[wix:File[@Source='$(var.InstallFilesBins)\ddagent.exe']]">
        <xsl:copy>
            <xsl:apply-templates select="node() | @*" />
            <wix:ServiceInstall Id="ServiceInstaller" DisplayName="Datadog Agent" Description="Send metrics to Datadog" Name="DatadogAgent" ErrorControl="ignore" Start="auto" Type="ownProcess" Vital="yes" Interactive="no" Account="LocalSystem" />
            <wix:ServiceControl Id="StartService" Name="DatadogAgent" Start="install" Stop="both" Remove="uninstall" Wait="no" />
        </xsl:copy>
    </xsl:template>

</xsl:stylesheet>

Add a WMI dependency for the DatadogAgent service

<xsl:stylesheet version="1.0"
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
            xmlns:msxsl="urn:schemas-microsoft-com:xslt"
            exclude-result-prefixes="msxsl"
            xmlns:wix="http://schemas.microsoft.com/wix/2006/wi"
            xmlns:my="my:my">

    <xsl:output method="xml" indent="yes" />

    <xsl:strip-space elements="*"/>

    <xsl:template match="@*|node()">
        <xsl:copy>
            <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
    </xsl:template>
    <xsl:template match="wix:Component[wix:File[@Source='$(var.InstallFilesBins)\ddagent.exe']]">
        <xsl:copy>
            <xsl:apply-templates select="node() | @*" />
            <wix:ServiceInstall Id="ServiceInstaller" DisplayName="Datadog Agent" Description="Send metrics to Datadog" Name="DatadogAgent" ErrorControl="ignore" Start="auto" Type="ownProcess" Vital="yes" Interactive="no" Account="LocalSystem">
                <wix:ServiceDependency Id="winmgmt" />
            </wix:ServiceInstall>
            <wix:ServiceControl Id="StartService" Name="DatadogAgent" Start="install" Stop="both" Remove="uninstall" Wait="no" />
        </xsl:copy>
    </xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sf="http://soap.sforce.com/2006/04/metadata" xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xslt="http://xml.apache.org/xslt" xmlns:xalan="http://xml.apache.org/xalan" exclude-result-prefixes="sf">

<xsl:param name="whitelist" select="" />

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xsl:indent-amount="4" xslt:indent-amount="4" xalan:indent-amount="4" />

    <xsl:template match="sf:___parentelement___">
        <types>
        <xsl:for-each select="sf:___element___">
          <xsl:if test="not(contains($whitelist, concat(',', sf:___nameelement___, ',')))">
            <xsl:if test="not(contains(substring(sf:___nameelement___, 0, string-length(sf:___nameelement___) - 2), '__'))">
                <members><xsl:copy-of select="sf:___nameelement___/text()"/></members>
            </xsl:if>
          </xsl:if>
        </xsl:for-each>
        </types>
    </xsl:template>

</xsl:stylesheet>

Support blanket blacklisting via the whitelist with the ~ keyword

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sf="http://soap.sforce.com/2006/04/metadata" xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xslt="http://xml.apache.org/xslt" xmlns:xalan="http://xml.apache.org/xalan" exclude-result-prefixes="sf">

<xsl:param name="whitelist" select="" />

<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" xsl:indent-amount="4" xslt:indent-amount="4" xalan:indent-amount="4" />

    <xsl:template match="sf:___parentelement___">
        <types>
        <xsl:for-each select="sf:___element___">
          <xsl:if test="$whitelist != '~' and not(contains($whitelist, concat(',', sf:___nameelement___, ',')))">
            <xsl:if test="not(contains(substring(sf:___nameelement___, 0, string-length(sf:___nameelement___) - 2), '__'))">
                <members><xsl:copy-of select="sf:___nameelement___/text()"/></members>
            </xsl:if>
          </xsl:if>
        </xsl:for-each>
        </types>
    </xsl:template>

</xsl:stylesheet>


<?xml version="1.0"?>
<!--
  Copyright 2002-2004 The Apache Software Foundation or its licensors,
  as applicable.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<!--+
    | Replace element for the value on the project descriptor
    | xmlns:for has to be replaced for the final version
    +-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:for="http://apache.org/forrest" version="1.0">

  <xsl:import href="copyover.xsl"/>

  <xsl:variable name="config" select="//skinconfig"/>

  <xsl:template match="for:*">
    <xsl:variable name="tmp" select="local-name()"/>
    <xsl:value-of select="$config/*[local-name() = $tmp]"/>
  </xsl:template>

</xsl:stylesheet>

Allow for the extraction of child elements as well. ie.

<?xml version="1.0"?>
<!--
  Copyright 2002-2004 The Apache Software Foundation or its licensors,
  as applicable.

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<!--+
    | Replace element for the value on the project descriptor
    | xmlns:for has to be replaced for the final version
    +-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:for="http://apache.org/forrest" version="1.0">

  <xsl:import href="copyover.xsl"/>

  <xsl:variable name="config" select="//skinconfig"/>

  <xsl:template match="for:*">
    <xsl:param name="ancestorpath" select="''"/>
    <xsl:choose>
      <xsl:when test="*">
        <xsl:apply-templates>
          <xsl:with-param name="ancestorpath"
            select="concat($ancestorpath,'/',local-name())"/>
        </xsl:apply-templates>
      </xsl:when>
      <xsl:otherwise>
        <xsl:variable name="tmp"
          select="concat($ancestorpath, '/', local-name())"/>
        <xsl:value-of
          select="$config//*[concat($ancestorpath, '/', local-name()) = $tmp]"/>
      </xsl:otherwise>
    </xsl:choose>

  </xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:col="http://apache.org/cocoon/lenya/collection/1.0"
  xmlns:ci="http://apache.org/cocoon/include/1.0">

  <xsl:param name="uuid"/>
  <xsl:param name="language"/>

  <xsl:template match="col:collection">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <ci:include src="cocoon://modules/collection/metadata/{$uuid}/{$language}.xml"/>
      <xsl:apply-templates select="col:document"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="col:document">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:if test="not(*)">
        <ci:include src="cocoon://modules/collection/metadata/{@uuid}/{$language}.xml"/>
        <ci:include src="lenya-document:{@uuid}"/>
      </xsl:if>
      <xsl:copy-of select="*"/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>

Use XHTML format when expanding news documents.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
  xmlns:col="http://apache.org/cocoon/lenya/collection/1.0"
  xmlns:ci="http://apache.org/cocoon/include/1.0">

  <xsl:param name="uuid"/>
  <xsl:param name="language"/>

  <xsl:template match="col:collection">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <ci:include src="cocoon://modules/collection/metadata/{$uuid}/{$language}.xml"/>
      <xsl:apply-templates select="col:document"/>
    </xsl:copy>
  </xsl:template>

  <xsl:template match="col:document">
    <xsl:copy>
      <xsl:copy-of select="@*"/>
      <xsl:if test="not(*)">
        <ci:include src="cocoon://modules/collection/metadata/{@uuid}/{$language}.xml"/>
        <ci:include src="lenya-document:{@uuid}?format=xhtml"/>
      </xsl:if>
      <xsl:copy-of select="*"/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>

<!--
    This file copyright by Suite Solutions, released under the same licenses as
    the rest of the DITA Open Toolkit project hosted on Sourceforge.net.
    See the accompanying license.txt file for applicable licenses.

    This file is a collection of basic settings for the FO plugin.  There are many
    more settings available in other files in the toolkit.  Please see the file
    README.txt in the main plugin directory for more information.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="2.0">

  <xsl:attribute-set name="reltable"></xsl:attribute-set>

  <xsl:attribute-set name="reltable__title"></xsl:attribute-set>

  <xsl:attribute-set name="relheader"></xsl:attribute-set>

  <xsl:attribute-set name="relcolspec"></xsl:attribute-set>

  <xsl:attribute-set name="relcell"></xsl:attribute-set>

  <xsl:attribute-set name="relrow"></xsl:attribute-set>

</xsl:stylesheet>

Reformat xsl:attribute-set elements to follow DITA-OT conventions.

<?xml version="1.0" encoding="UTF-8"?>

<!--
    This file copyright by Suite Solutions, released under the same licenses as
    the rest of the DITA Open Toolkit project hosted on Sourceforge.net.
    See the accompanying license.txt file for applicable licenses.

    This file is a collection of basic settings for the FO plugin.  There are many
    more settings available in other files in the toolkit.  Please see the file
    README.txt in the main plugin directory for more information.
-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fo="http://www.w3.org/1999/XSL/Format"
  version="2.0">

  <xsl:attribute-set name="reltable">
  </xsl:attribute-set>

  <xsl:attribute-set name="reltable__title">
  </xsl:attribute-set>

  <xsl:attribute-set name="relheader">
  </xsl:attribute-set>

  <xsl:attribute-set name="relcolspec">
  </xsl:attribute-set>

  <xsl:attribute-set name="relcell">
  </xsl:attribute-set>

  <xsl:attribute-set name="relrow">
  </xsl:attribute-set>

</xsl:stylesheet>


<?xml version="1.0" encoding="Windows-1252"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:chk="http://check.sourceforge.net/ns">
    <xsl:output encoding="utf-8" indent="yes"/>

    <xsl:template match="chk:testsuites">
        <testsuites>
            <xsl:apply-templates select="chk:suite"/>
        </testsuites>
    </xsl:template>

    <xsl:template match="chk:suite">
        <xsl:for-each select="chk:test">
            <xsl:element name="testcase">
                <xsl:attribute name="classname">
                    <xsl:value-of select="chk:description"/>
                </xsl:attribute>
                <xsl:attribute name="name">
                    <xsl:value-of select="chk:id"/>
                </xsl:attribute>
            </xsl:element>
        </xsl:for-each>
    </xsl:template>

</xsl:stylesheet>

Fix bug in test results conversion script

<?xml version="1.0" encoding="Windows-1252"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:chk="http://check.sourceforge.net/ns">
    <xsl:output encoding="utf-8" indent="yes"/>

    <xsl:template match="chk:testsuites">
        <testsuites>
            <xsl:apply-templates select="chk:suite"/>
        </testsuites>
    </xsl:template>

    <xsl:template match="chk:suite">
        <testsuite>
        <properties/>
        <xsl:for-each select="chk:test">
            <xsl:element name="testcase">
                <xsl:attribute name="classname">
                    <xsl:value-of select="chk:description"/>
                </xsl:attribute>
                <xsl:attribute name="name">
                    <xsl:value-of select="chk:id"/>
                </xsl:attribute>
            </xsl:element>
        </xsl:for-each>
        </testsuite>
    </xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0">
	<xsl:output method="xml" indent="yes" />
	<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
	<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />

	<xsl:template match="/xunit/run">
		<testsuite tests="{@count}" failures="{@failures}" errors="{@errors}"
			skipped="{@skipped}" time="{@duration}" name="xUnit.js" timestamp="{@timestamp}">
			<properties>
				<xsl:for-each select="/xunit/files/file">
					<property name="file" value="{@path}" />
				</xsl:for-each>
			</properties>
			<xsl:for-each select="/xunit/facts/fact">
				<testcase time="{@duration}" classname="xunit" name="{@path}">
					<xsl:if test="@result!='Success'">
						<xsl:element name="{translate(@result,$uppercase,$lowercase)}">
							<xsl:attribute name="message">
							     <xsl:value-of select="@message" />
							</xsl:attribute>
							<xsl:value-of select="@message" />
						</xsl:element>
					</xsl:if>
				</testcase>
			</xsl:for-each>
		</testsuite>
	</xsl:template>
</xsl:stylesheet>

Update xunit test result report consumed by Jenkins

<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	version="1.0">
	<xsl:output method="xml" indent="yes" />
	<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'" />
	<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'" />

	<xsl:template match="/xunit/run">
		<testsuite tests="{@count}" failures="{@failures}" errors="{@errors}"
			skipped="{@skipped}" time="{@duration}" name="xUnit.js" timestamp="{@timestamp}">
			<properties>
				<xsl:for-each select="/xunit/files/file">
					<property name="file" value="{@path}" />
				</xsl:for-each>
			</properties>
			<xsl:for-each select="/xunit/facts/fact">
				<testcase time="{@duration}" classname="xunit.xunit" name="{@path}">
					<xsl:if test="@result!='Success'">
						<xsl:element name="{translate(@result,$uppercase,$lowercase)}">
							<xsl:attribute name="message">
							     <xsl:value-of select="@message" />
							</xsl:attribute>
							<xsl:value-of select="@message" />
						</xsl:element>
					</xsl:if>
				</testcase>
			</xsl:for-each>
		</testsuite>
	</xsl:template>
</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">

  <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
  <xsl:include href="common.xsl"/>

</xsl:stylesheet>

<!--
  vim:sw=2 ts=2 et:
-->

Stop printing build noise to stderr

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0">

  <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"/>
  <xsl:include href="common.xsl"/>

  <!-- Don't print name of each manpage generated. -->
  <xsl:param name="man.output.quietly">1</xsl:param>

</xsl:stylesheet>

<!--
  vim:sw=2 ts=2 et:
-->


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	>

	<!-- default template to include files -->
	<xsl:template match='*' mode='output-file'>
		<!-- Return the filename here for the file -->
	</xsl:template>

	<!-- default template to include files -->
	<xsl:template match='*' mode='output-mode'>
		<!-- Return 'xml,text,html' to control the output mode -->
		<xsl:text>xml</xsl:text>
	</xsl:template>

	<xsl:template match='*' mode='copy'>
		<xsl:copy>
			<xsl:apply-templates select='@*' mode='copy'/>
			<xsl:apply-templates select='node()' mode='copy'/>
		</xsl:copy>
	</xsl:template>

	<xsl:template match='@*' mode='copy'>
		<xsl:copy/>
	</xsl:template>

</xsl:stylesheet>

Sort the items when copy nodes

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	>

	<!-- default template to include files -->
	<xsl:template match='*' mode='output-file'>
		<!-- Return the filename here for the file -->
	</xsl:template>

	<!-- default template to include files -->
	<xsl:template match='*' mode='output-mode'>
		<!-- Return 'xml,text,html' to control the output mode -->
		<xsl:text>xml</xsl:text>
	</xsl:template>

	<xsl:template match='*' mode='copy'>
		<xsl:copy>
			<xsl:apply-templates select='@*' mode='copy'>
				<xsl:sort select='name()'/>
			</xsl:apply-templates>
			<xsl:apply-templates select='node()' mode='copy'>
				<xsl:sort select='@name'/>
			</xsl:apply-templates>
		</xsl:copy>
	</xsl:template>

	<xsl:template match='@*' mode='copy'>
		<xsl:copy/>
	</xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:preserve-space elements="*" />
  <!-- faq-v20x.dtd to faq-v12.dtd transformation -->

  <xsl:output doctype-public="-//APACHE//DTD FAQ V1.2//EN" doctype-system="faq-v12.dtd"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="faqs">
    <faqs>
      <xsl:attribute name="title">
        <xsl:value-of select="title"/>
      </xsl:attribute>
      <xsl:apply-templates/>
    </faqs>
  </xsl:template>

  <xsl:template match="faqs/title"/>

  <xsl:template match="faqsection">
    <part>
      <xsl:apply-templates select="node()|@*"/>
    </part>
  </xsl:template>

  <xsl:template match="a">
    <link>
      <xsl:apply-templates select="@*"/>
      <xsl:apply-templates select="node()"/>
      <xsl:apply-templates/>
    </link>
  </xsl:template>

  <!-- the obligatory copy-everything -->
  <xsl:template match="node() | @*">
    <xsl:copy>
      <xsl:apply-templates select="@*"/>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>

Fix duplate link text bug

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:preserve-space elements="*" />
  <!-- faq-v20x.dtd to faq-v12.dtd transformation -->

  <xsl:output doctype-public="-//APACHE//DTD FAQ V1.2//EN" doctype-system="faq-v12.dtd"/>

  <xsl:template match="/">
    <xsl:apply-templates/>
  </xsl:template>

  <xsl:template match="faqs">
    <faqs>
      <xsl:attribute name="title">
        <xsl:value-of select="title"/>
      </xsl:attribute>
      <xsl:apply-templates/>
    </faqs>
  </xsl:template>

  <xsl:template match="faqs/title"/>

  <xsl:template match="faqsection">
    <part>
      <xsl:apply-templates select="node()|@*"/>
    </part>
  </xsl:template>

  <xsl:template match="a">
    <link>
      <xsl:apply-templates select="@*"/>
      <xsl:apply-templates select="node()"/>
    </link>
  </xsl:template>

  <!-- the obligatory copy-everything -->
  <xsl:template match="node() | @*">
    <xsl:copy>
      <xsl:apply-templates select="@*"/>
      <xsl:apply-templates/>
    </xsl:copy>
  </xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >

  <xsl:template match="Item[@type='Citect.Ampla.Quality.Server.QualityReportingPoint']" mode="output-file">
	<xsl:value-of select="concat('Quality\', @fullName, '.xml')"/>
  </xsl:template>

  <xsl:template match="Item[@type='Citect.Ampla.Quality.Server.QualityReportingPoint']" mode="output" >
	<xsl:param name='filename'/>
    <xsl:param name="this-file">Include.Quality.ReportingPoint.xslt</xsl:param>
    <xsl:comment>Generated by: <xsl:value-of select="$this-file"/></xsl:comment>
	<xsl:apply-templates select='.' mode='copy'/>
  </xsl:template>

</xsl:stylesheet>

Update the Quality format to be JSON

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >

  <xsl:template match="Item[@type='Citect.Ampla.Quality.Server.QualityReportingPoint']" mode="output-file">
	<xsl:value-of select="concat('Quality\', @fullName, '.txt')"/>
  </xsl:template>

  <xsl:template match="Item[@type='Citect.Ampla.Quality.Server.QualityReportingPoint']" mode="output-mode">text</xsl:template>

  <xsl:template match="Item[@type='Citect.Ampla.Quality.Server.QualityReportingPoint']" mode="output" >
	<xsl:param name='filename'/>
	<xsl:apply-templates select='.' mode='json'/>
  </xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
    This processor is called at the end, to remove sfatables-specific tags.
-->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="@* | node()">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="rule-context"/>
</xsl:stylesheet>

Remove both match and target contexts after a rule is done.

<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
    This processor is called at the end, to remove sfatables-specific tags.
-->

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
        <xsl:template match="@* | node()">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>
    </xsl:template>

    <xsl:template match="match-context"/>
    <xsl:template match="target-context"/>
</xsl:stylesheet>


<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >

  <xsl:template match="Item[@type='Citect.Ampla.Downtime.Server.DowntimeReportingPoint']" mode="output-file">
	<xsl:value-of select="concat('Downtime\', @fullName, '.xml')"/>
  </xsl:template>

  <xsl:template match="Item[@type='Citect.Ampla.Downtime.Server.DowntimeReportingPoint']" mode="output" >
	<xsl:param name='filename'/>
    <xsl:param name="this-file">Include.Downtime.ReportingPoint.xslt</xsl:param>
    <xsl:comment>Generated by: <xsl:value-of select="$this-file"/></xsl:comment>
	<xsl:apply-templates select='.' mode='copy'/>
  </xsl:template>

</xsl:stylesheet>

Update the Downtime format to be JSON

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    >

  <xsl:template match="Item[@type='Citect.Ampla.Downtime.Server.DowntimeReportingPoint']" mode="output-file">
	<xsl:value-of select="concat('Downtime\', @fullName, '.txt')"/>
  </xsl:template>

  <xsl:template match="Item[@type='Citect.Ampla.Downtime.Server.DowntimeReportingPoint']" mode="output-mode">text</xsl:template>

  <xsl:template match="Item[@type='Citect.Ampla.Downtime.Server.DowntimeReportingPoint']" mode="output" >
	<xsl:param name='filename'/>
	<xsl:apply-templates select='.' mode='json'/>
  </xsl:template>

</xsl:stylesheet>


<?xml version='1.0'?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="rss">
  <document>

      <title>Example: RSS feed to document</title>

      <xsl:apply-templates select="channel/item"/>

  </document>
</xsl:template>

<xsl:template match="item">

    <title><xsl:value-of select="title" disable-output-escaping="yes"/></title>

<link href="{link}"><xsl:value-of select="link"/></link>

<xsl:value-of select="description" disable-output-escaping="yes"/>

</xsl:template>

</xsl:stylesheet>

Use the channel title for the title of the document

<?xml version='1.0'?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="rss">
  <document>

      <title><xsl:value-of select="channel/title"/></title>

      <xsl:apply-templates select="channel/item"/>

  </document>
</xsl:template>

<xsl:template match="item">

    <title><xsl:value-of select="title" disable-output-escaping="yes"/></title>

<link href="{link}"><xsl:value-of select="link"/></link>

<xsl:value-of select="description" disable-output-escaping="yes"/>

</xsl:template>

</xsl:stylesheet>


<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="div">
    <xsl:copy>
      <xsl:apply-templates select="node()"/>
    </xsl:copy>
    <xsl:text> </xsl:text>
  </xsl:template>

  <xsl:template match="p">
    <xsl:copy>
      <xsl:apply-templates select="node()"/>
    </xsl:copy>
    <xsl:text> </xsl:text>
  </xsl:template>

  <xsl:template match="h1">
    <xsl:copy>
      <xsl:apply-templates select="node()"/>
    </xsl:copy>
    <xsl:text> </xsl:text>
  </xsl:template>

  <xsl:template match="a">
    <xsl:apply-templates/>
  </xsl:template>

</xsl:stylesheet>

Add spaces after header elements.

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="div">
    <xsl:copy>
      <xsl:apply-templates select="node()"/>
    </xsl:copy>
    <xsl:text> </xsl:text>
  </xsl:template>

  <xsl:template match="p">
    <xsl:copy>
      <xsl:apply-templates select="node()"/>
    </xsl:copy>
    <xsl:text> </xsl:text>
  </xsl:template>

  <xsl:template match="h1">
    <xsl:copy>
      <xsl:apply-templates select="node()"/>
    </xsl:copy>
    <xsl:text> </xsl:text>
  </xsl:template>

  <xsl:template match="h2">
    <xsl:copy>
      <xsl:apply-templates select="node()"/>
    </xsl:copy>
    <xsl:text> </xsl:text>
  </xsl:template>

  <xsl:template match="h3">
    <xsl:copy>
      <xsl:apply-templates select="node()"/>
    </xsl:copy>
    <xsl:text> </xsl:text>
  </xsl:template>

  <xsl:template match="h4">
    <xsl:copy>
      <xsl:apply-templates select="node()"/>
    </xsl:copy>
    <xsl:text> </xsl:text>
  </xsl:template>

  <xsl:template match="h5">
    <xsl:copy>
      <xsl:apply-templates select="node()"/>
    </xsl:copy>
    <xsl:text> </xsl:text>
  </xsl:template>

  <xsl:template match="h6">
    <xsl:copy>
      <xsl:apply-templates select="node()"/>
    </xsl:copy>
    <xsl:text> </xsl:text>
  </xsl:template>

  <xsl:template match="a">
    <xsl:apply-templates/>
  </xsl:template>

</xsl:stylesheet>


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:exsl="http://exslt.org/common"
	xmlns:form="http://nick-dunn.co.uk/xslt/form-controls"
	extension-element-prefixes="exsl form">

<xsl:import href="../utilities/master.xsl"/>
<xsl:import href="../utilities/form-controls.xsl"/>

<xsl:variable name="form:event" select="/data/events/save-user"/>

<xsl:template match="data">

    <form action="" method="post">
		<xsl:call-template name="header"/>

<xsl:value-of select="$page-title" />

		<xsl:call-template name="form:validation-summary"/>
		<fieldset class="primary">
			<xsl:for-each select="/data/section-schema[@handle = 'users']/*[@location = 'main']">
				<xsl:call-template name="symphony-field" />
			</xsl:for-each>
		</fieldset>
		<fieldset class="secondary">
			<xsl:for-each select="/data/section-schema[@handle = 'users']/*[@location = 'sidebar']">
				<xsl:call-template name="symphony-field" />
			</xsl:for-each>
		</fieldset>

			<input name="action[save-user]" accesskey="s" type="submit" value="Create Entry" />

				Stephen Bau

				Logout

	</form>

</xsl:template>

</xsl:stylesheet>

Modify Users page to use the same section-schemas.xsl utility as the Projects page

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:exsl="http://exslt.org/common"
	xmlns:form="http://nick-dunn.co.uk/xslt/form-controls"
	extension-element-prefixes="exsl form">

<xsl:import href="../utilities/master.xsl"/>
<xsl:import href="../utilities/form-controls.xsl"/>
<xsl:import href="../utilities/section-schemas.xsl"/>

<!-- Define a global variable pointing to your Event -->
<xsl:variable name="event" select="/data/events/save-user"/>
<xsl:variable name="event-action" select="'save-user'"/>

<xsl:template match="data">
	<xsl:apply-templates select="section-schema[@handle='users']" mode="form"/>
</xsl:template>

</xsl:stylesheet>


<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="/home_local/usuario/docbook-xsl-ns-1.74.0/fo/docbook.xsl"/>
<xsl:param name="html.stylesheet" select="'corpstyle.css'"/>
<xsl:param name="admon.graphics" select="1"/>
<xsl:param name="paper.type" select="'A4'"/>
<xsl:attribute-set name="monospace.verbatim.properties">
    <xsl:attribute name="wrap-option">wrap</xsl:attribute>
    <xsl:attribute name="hyphenation-character">\</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="shade.verbatim" select="1"/>
<xsl:attribute-set name="shade.verbatim.style">
  <xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
  <xsl:attribute name="border-width">0.5pt</xsl:attribute>
  <xsl:attribute name="border-style">solid</xsl:attribute>
  <xsl:attribute name="border-color">#575757</xsl:attribute>
  <xsl:attribute name="padding">3pt</xsl:attribute>
</xsl:attribute-set>
</xsl:stylesheet>

Set xsl path to tools directory

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="../../tools/xsl/fo/docbook.xsl"/>
<xsl:param name="html.stylesheet" select="'corpstyle.css'"/>
<xsl:param name="admon.graphics" select="1"/>
<xsl:param name="paper.type" select="'A4'"/>
<xsl:attribute-set name="monospace.verbatim.properties">
    <xsl:attribute name="wrap-option">wrap</xsl:attribute>
    <xsl:attribute name="hyphenation-character">\</xsl:attribute>
</xsl:attribute-set>
<xsl:param name="shade.verbatim" select="1"/>
<xsl:attribute-set name="shade.verbatim.style">
  <xsl:attribute name="background-color">#E0E0E0</xsl:attribute>
  <xsl:attribute name="border-width">0.5pt</xsl:attribute>
  <xsl:attribute name="border-style">solid</xsl:attribute>
  <xsl:attribute name="border-color">#575757</xsl:attribute>
  <xsl:attribute name="padding">3pt</xsl:attribute>
</xsl:attribute-set>
</xsl:stylesheet>


<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

MCUpdater ServerPack version <xsl:value-of select="ServerPack/@version"/>

  <xsl:for-each select="ServerPack/Server">

<xsl:value-of select="@name"/> - Minecraft <xsl:value-of select="@version"/> (revision <xsl:value-of select="@revision"/>)

Mods

        Name
        Version
        URL
        MD5

      <xsl:for-each select="Module">

        <xsl:value-of select="@name"/>
        <xsl:value-of select="Meta/@version"/>
        <xsl:value-of select="Meta/@URL"/>
        <xsl:value-of select="MD5"/>

      </xsl:for-each>

  </xsl:for-each>

</xsl:template>
</xsl:stylesheet>

Update basic XSL to reflect XSD changes.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

MCUpdater ServerPack version <xsl:value-of select="ServerPack/@version"/>

  <xsl:for-each select="ServerPack/Server">

<xsl:value-of select="@name"/> - Minecraft <xsl:value-of select="@version"/> (revision <xsl:value-of select="@revision"/>)

Mods

        Name
        Version
        URL
        MD5

      <xsl:for-each select="Module">

        <xsl:value-of select="@name"/>
        <xsl:value-of select="Meta/version"/>
        <xsl:value-of select="Meta/URL"/>
        <xsl:value-of select="MD5"/>

      </xsl:for-each>

  </xsl:for-each>

</xsl:template>
</xsl:stylesheet>


<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:vsix="http://schemas.microsoft.com/developer/vsx-schema/2011">

 <xsl:output omit-xml-declaration="yes"/>

    <xsl:template match="node()|@*">
      <xsl:copy>
         <xsl:apply-templates select="node()|@*"/>
      </xsl:copy>
    </xsl:template>

    <xsl:template match="vsix:Prerequisites"/>
</xsl:stylesheet>

Add comments on what the xsl transform does

<xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:vsix="http://schemas.microsoft.com/developer/vsx-schema/2011">

 <xsl:output omit-xml-declaration="yes"/>

    <!-- Match every node and copy it to the output -->
    <xsl:template match="node()|@*">
      <xsl:copy>
         <xsl:apply-templates select="node()|@*"/>
      </xsl:copy>
    </xsl:template>

    <!-- Now override that to do nothing if it matches our element, thus
         omitting it from the output -->
    <xsl:template match="vsix:Prerequisites"/>
</xsl:stylesheet>


<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:php="http://php.net/xsl"
  version='1.0'>
<xsl:output  method="text"/>
<xsl:template match="/">
<xsl:value-of select="php:functionString('foobar', /doc/@id, 'secondArg')"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="php:function('foobar', /doc/@id)"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="php:function('nodeSet')"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="php:function('nodeSet',/doc)/i"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="php:function('aClass::aStaticFunction','static')"/>
<xsl:text>
</xsl:text>
<!-- TODO: Find out the exact logic of PHP objects conversion -->
<!--<xsl:value-of select="php:function('nonDomNode')"/>-->
</xsl:template>
</xsl:stylesheet>

Add missing namespaces to XSLT tests

<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:php="http://php.net/xsl"
  version='1.0'>
<xsl:output  method="text"/>
<xsl:template match="/">
<xsl:value-of select="php:functionString('xml\xslt_008\foobar', /doc/@id, 'secondArg')"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="php:function('xml\xslt_008\foobar', /doc/@id)"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="php:function('xml\xslt_008\nodeSet')"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="php:function('xml\xslt_008\nodeSet',/doc)/i"/>
<xsl:text>
</xsl:text>
<xsl:value-of select="php:function('xml\xslt_008\aClass::aStaticFunction','static')"/>
<xsl:text>
</xsl:text>
<!-- TODO: Find out the exact logic of PHP objects conversion -->
<!--<xsl:value-of select="php:function('xml\xslt_008\nonDomNode')"/>-->
</xsl:template>
</xsl:stylesheet>