--- pxsl-tools-1.0.orig/debian/pxslcc.1 +++ pxsl-tools-1.0/debian/pxslcc.1 @@ -0,0 +1,78 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH pxsl-tools 1 "25 Jan 2008" +.\" Please adjust this date whenever revising the manpage. +.SH NAME +pxslcc \- PXSL to XML converter +.SH SYNOPSIS +.B pxslcc +.RI [ options ] " file" +.SH DESCRIPTION +This manual page documents briefly the +.B pxslcc +command. +.PP +.B PXSL +is a convenient shorthand for writing markup-heavy +.B XML +documents. It provides an alternative denotation for +.B XML +that focuses on the mark-up instead of the text, making handling +mark-up heavy +.B XML +documents easier. Also, +.B PXSL +makes use of element defaults that can act as shortcuts or even as +macros. +.PP +.B pxslcc +is a program that takes a +.B PXSL +source file and any macro definitions and generates an +.B XML +file. +.SH OPTIONS +A summary of options is included below. +For a complete description, see the README file. +.TP +\fB\-i\fP[\fINUM\fP]\fB\, \-\-indent\fP[=\fINUM\fP] +Re-indent XML using +.I NUM +spaces per nesting level. +.TP +.B \-h, \-\-header +Insert an comment into the generated XML to warn against editing the +XML file directly and to recommend editing the original PXSL source +file instead. +.TP +.B \-x, \-\-xslt +Add default element defaults for generating XSLT files. +.TP +.BI \-a FILE ", \-\-add=" FILE +Add the given defaults file. +.TP +.B \-\-export +Export (print) all of the active defaults. +.TP +.B \-\-dump +Dump internal parse format (for debugging). +.TP +.B \-\-help +Print a synopsis of command line options. +.TP +.B \-v, \-\-version +Prints out the program version. +.SH SEE ALSO +For more information, see the README file, that can be found on Debian +systems at +.B /usr/share/doc/pxsl-tools/README.gz +or visit the home page at +.BR http://community.moertel.com/ss/space/pxsl . +.SH AUTHOR +.B pxsl-tools +was written by Thomas Moertel and Bill Hubauer. +.PP +This manual page was written by Kari Pahula , +for the Debian project (but may be used by others). --- pxsl-tools-1.0.orig/debian/control +++ pxsl-tools-1.0/debian/control @@ -0,0 +1,27 @@ +Source: pxsl-tools +Section: devel +Priority: extra +Maintainer: Kari Pahula +Build-Depends: cdbs, debhelper (>= 6), ghc, libghc-mtl-dev (>= 1.0), libghc-parsec3-dev, libghc-containers-dev +Standards-Version: 3.9.2 +Homepage: http://community.moertel.com/ss/space/PXSL + +Package: pxsl-tools +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Parsimonious XML Shorthand Language + PXSL ("pixel") provides XML authors and programmers with a simple, + concise syntax that they can use to create XML documents. + . + For more advanced users, PXSL offers customizable shortcuts and + sophisticated refactoring tools like functional macros that can + markedly reduce the size and complexity of markup-dense XML + documents. + . + The short version is this: PXSL is XML turned inside-out. Instead of + tagging the structure, you tag the non-structure, which is the better + approach when most of your information is structure. + . + Also, PXSL lets users intermix PXSL and XML syntax in one + document. Users are free to use whichever syntax works best for each + portion of their documents. --- pxsl-tools-1.0.orig/debian/rules +++ pxsl-tools-1.0/debian/rules @@ -0,0 +1,26 @@ +#!/usr/bin/make -f + +DEB_INSTALL_MANPAGES_pxsl-tools=debian/pxslcc.1 + +include /usr/share/cdbs/1/rules/debhelper.mk + +# I'll have to check if running ./Setup.lhs is ok on !i386, !amd64 +# I know that runhaskell Setup.lhs fails. Let's play it safe for now. + +setup-bin: + if test ! -e Setup.lhs -a ! -e Setup.hs; then echo "No setup script found!"; exit 1; fi + for setup in Setup.lhs Setup.hs; do if test -e $$setup; then ghc -package Cabal $$setup -o setup-bin; exit 0; fi; done + +clean:: + test ! -x setup-bin || ./setup-bin clean + rm -rf dist setup-bin Setup.hi Setup.ho Setup.o .*config* + +build/pxsl-tools:: setup-bin + ./setup-bin configure --ghc --prefix=/usr -v2 + ./setup-bin build + +binary-install/pxsl-tools:: setup-bin + ./setup-bin copy --destdir=debian/pxsl-tools + +binary-post-install/pxsl-tools:: + rm -rf debian/pxsl-tools/usr/share/doc/pxsl-tools-* --- pxsl-tools-1.0.orig/debian/changelog +++ pxsl-tools-1.0/debian/changelog @@ -0,0 +1,50 @@ +pxsl-tools (1.0-5.2) unstable; urgency=low + + * Non-maintainer upload. + * Now that the release has passed, move this to unstable. + + -- Joachim Breitner Sat, 18 May 2013 23:50:19 +0200 + +pxsl-tools (1.0-5.1) experimental; urgency=low + + * Non-maintainer upload. + * Use parsec 2 (Closes: #698461) + + -- Joachim Breitner Tue, 22 Jan 2013 21:59:52 +0100 + +pxsl-tools (1.0-5) unstable; urgency=low + + * Update build deps to use ghc (Closes: #629772) + * Standards-Version 3.9.2 (no changes needed). + * Changed doc-base to use section Programming, not + Applications/Programming. + + -- Kari Pahula Tue, 09 Aug 2011 14:37:10 +0300 + +pxsl-tools (1.0-4) unstable; urgency=low + + * Have the README.html file in doc-base file's Files field + (Closes: #465091) + + -- Kari Pahula Sun, 10 Feb 2008 19:27:46 +0200 + +pxsl-tools (1.0-3) unstable; urgency=low + + * Added missing build-dep libghc6-parsec-dev. + + -- Kari Pahula Tue, 05 Feb 2008 08:56:29 +0200 + +pxsl-tools (1.0-2) unstable; urgency=low + + * Added missing build-dep libghc6-mtl-dev. + * Wrote a man page for pxslcc. + + -- Kari Pahula Fri, 25 Jan 2008 18:46:51 +0200 + +pxsl-tools (1.0-1) unstable; urgency=low + + * Initial release (Closes: #457373) + * Included examples from http://community.moertel.com/pxsl/examples/ + + -- Kari Pahula Thu, 24 Jan 2008 12:16:16 +0200 + --- pxsl-tools-1.0.orig/debian/compat +++ pxsl-tools-1.0/debian/compat @@ -0,0 +1 @@ +6 --- pxsl-tools-1.0.orig/debian/pxsl-tools.examples +++ pxsl-tools-1.0/debian/pxsl-tools.examples @@ -0,0 +1 @@ +debian/examples/* --- pxsl-tools-1.0.orig/debian/copyright +++ pxsl-tools-1.0/debian/copyright @@ -0,0 +1,35 @@ +This package was debianized by Kari Pahula on +Thu, 24 Jan 2008 10:04:59 +0200. + +It was downloaded from http://community.moertel.com/pxsl/sources/ + +Upstream Authors: + + Tom Moertel + Bill Hubauer + +Copyright: + + Copyright (C) 2003-2007 Thomas Moertel & Bill Hubauer + +License: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + +The Debian packaging is (C) 2008, Kari Pahula and +is licensed under the GPL, see above. --- pxsl-tools-1.0.orig/debian/docs +++ pxsl-tools-1.0/debian/docs @@ -0,0 +1,2 @@ +README +README.html --- pxsl-tools-1.0.orig/debian/pxsl-tools.doc-base +++ pxsl-tools-1.0/debian/pxsl-tools.doc-base @@ -0,0 +1,12 @@ +Document: pxsl-tools +Title: Debian pxsl-tools Manual +Author: Tom Moertel and Bill Hubauer +Abstract: Parsimonious XML Shorthand Language manual. +Section: Programming + +Format: text +Files: /usr/share/doc/pxsl-tools/README.gz + +Format: HTML +Index: /usr/share/doc/pxsl-tools/README.html +Files: /usr/share/doc/pxsl-tools/README.html --- pxsl-tools-1.0.orig/debian/examples/xsl-menus-w-macros.pxsl +++ pxsl-tools-1.0/debian/examples/xsl-menus-w-macros.pxsl @@ -0,0 +1,161 @@ +# Advanced example: Using macros to refactor "one-off" code. +# +# NOTE: A more in-depth write up of this refactoring can be +# found at the following link: +# +# http://www.kuro5hin.org/story/2003/6/4/12434/75716 +# +# Problem: +# +# We have numerous pieces of XSLT code that are "one-offs": Each +# one is the same as the others except for a small tweak here or +# there. Every time there is a change to the code that the one-offs +# share, we must modify each of the one-offs, a time consuming and +# error-prone chore. +# +# Goal: +# +# We would like to refactor the code so that the common portions of +# code are represented once. +# +# Solution: +# +# (1) Create a macro that captures the common code. +# (2) Parameterize the macro to accept the varying portions. +# (3) Expand the macro to generate one-offs as needed. +# +# Background on the example: +# +# In this example (taken from my real-life work) we have what +# essentially is a data structure that represents menus in a web +# site: +# +# +# Home +# About this site +# Contact us +# +# +# Then we have a function that iterates through the menu-item elements +# of a menu, generating an HTML representation of the menu as it goes. +# Each item is converted into a link to the page it represents. +# Additionally, there is the notion of a "visited item" -- the +# menu-item that represents the active page of the web site. This +# item typically requires a special presentation, e.g., that says "you +# are here": it may be rendered in boldface and not converted into a +# link (because the user is already on that page). +# +# For example, if we want a horizontal rendering of the menu, we +# might convert it into the following: +# +# +# +# Home +# | +# +# About this site +# | +# +# Contact us +# +# +# +# which might render like this in a browser: +# +# Home | About this site | CONTACT US +# +# Or, if a vertical rendering is more appropriate, we might choose the +# following HTML, which uses DIV elements instead of SPAN elements: +# +#
+#
+# Home +#
+# +#
+# Contact us +#
+#
+# +# which might render like this in a browser: +# +# Home +# About +# CONTACT US +# +# Now, how do we do it? +# +# Following the above Solution recipe, we create a macro called +# "make-menu-builder" that captures the common behavior. It takes +# the following parameters: +# +# - menu-maker: A macro that takes a BODY parameter and expands to +# an HTML representation of a menu that contains the BODY. +# +# - item-maker: A macro that takes a BODY parameter and expands to +# an HTML representation of a menu item that contains the BODY. +# +# - item-maker-sel: Same as item-maker, except this item should +# be rendered in a "selected" state because this is the active +# menu item. +# +# - item-separator: A macro that expands into the HTML that is +# to be placed in between consecutive menu items. +# +# We expand the macro twice, passing in different parameters, +# to create one-offs for rendering menus horizontally and vertically. +# +# The actual PXSL code follows. It relies upon anonymous macros, +# which are explained in the README file. It also uses a handy +# syntax shortcut to create nested elements on a single line: +# +# elem ==SHORTCUT==> elem <<>> child +# child + + +# Here is a macro which will make "menu-builders" (XSLT +# templates that build HTML menus). It is parameterized +# as described above. + +,make-menu-builder name \ + menu-maker item-maker item-maker-sel item-separator = + + func:function -name=<(,name)> + xsl:param -name=menu + xsl:param -name=target-absloc + func:result + ,menu-maker + xsl:for-each -select=$menu/menu-item + xsl:variable -name=menu-absloc -select=mcf:absloc() + xsl:variable -name=visited-item-id \ + -select=mcf:find-item($menu,$target-absloc) + xsl:variable -name=title -select=<{translate(.,' ',' ')}> + xsl:choose + xsl:when -test=generate-id()=$visited-item-id + ,item-maker-sel + xsl:value-of -select=$title + xsl:otherwise + ,item-maker + a -href={mcf:menu-link($menu-absloc)} + xsl:value-of -select=$title + xsl:if -test=<{last() > position()}> + ,item-separator + +# Now comes the code that expands the above macros to +# create horizontal-menu and vertical-menu builders. + +-- build horizontal menus +,make-menu-builder mcf:horizontal-menu \ + -menu-maker=<( , = span -class=hmenu <<>> ,BODY )> \ + -item-maker=<( , = span -class=hmenu-item <<>> ,BODY )> \ + -item-maker-sel=<( , = span -class=hmenu-item-selected <<>> ,BODY )> \ + -item-separator=<( span -class=hmenu-sep << | >> )> + +-- build vertical menus +,make-menu-builder mcf:vertical-menu \ + -menu-maker=<( , = div -class=vmenu <<>> ,BODY )> \ + -item-maker=<( , = div -class=vmenu-item <<>> ,BODY )> \ + -item-maker-sel=<( , = div -class=vmenu-item-selected <<>> ,BODY )> \ + -item-separator=<<>> --- pxsl-tools-1.0.orig/debian/examples/ant-shortcuts.edf +++ pxsl-tools-1.0/debian/examples/ant-shortcuts.edf @@ -0,0 +1,8 @@ +# PXSL element defaults for Ant buildfiles +# To use, just pass "--add=ant-shortcuts.edf" on the pxslcc command line. + +project = project name +property = property name location +target = target name +mkdir = mkdir dir +jar = jar jarfile --- pxsl-tools-1.0.orig/debian/examples/ant-buildfile.pxsl +++ pxsl-tools-1.0/debian/examples/ant-buildfile.pxsl @@ -0,0 +1,37 @@ +<<>> + +# Ant buildfile written in PXSL +# Derived from Example Buildfile in Ant manual: +# http://ant.apache.org/manual/using.html#example +# +# To convert to XML: +# $ pxslcc --add ant-shortcuts.edf ant-buildfile.pxsl > ant-buildfile.xml + + +project MyProject -default=dist -basedir=. + + description <{simple example build file}> + + -- global properties for this build + + property src -location=src + property build -location=build + property dist -location=dist + + -- targets + + target init + tstamp + mkdir ${build} + + target compile -depends=init -description=<{compile the source}> + javac -srcdir=${src} -destdir=${build} + + target dist -depends=compile -description=<{generate the distribution}> + mkdir ${dist}/lib + jar -jarfile=${dist}/lib/MyProject-${DSTAMP}.jar -basedir=${build} + + target clean -description=<{clean up}> + delete -dir=${build} + delete -dir=${dist} + --- pxsl-tools-1.0.orig/debian/examples/multi-param-attributes.pxsl +++ pxsl-tools-1.0/debian/examples/multi-param-attributes.pxsl @@ -0,0 +1,24 @@ +,command c a1 a2 a3 = + a -href=<( ,c + <> ,a1 + <> ,a2 + <> ,a3 )> + ,BODY + +,command cmd param1 param2 param3 + <> + +,command2 c a1 a2 a3 = + + a -href=<(,hrefval)> + ,BODY + + # build href value from arguments + ,hrefval = + ,c + <<&a1=>> ,a1 + <<&a2=>> ,a2 + <<&a3=>> ,a3 + +,command2 cmd param1 param2 param3 + <> --- pxsl-tools-1.0.orig/debian/examples/xsl-stylesheet-01.pxsl +++ pxsl-tools-1.0/debian/examples/xsl-stylesheet-01.pxsl @@ -0,0 +1,48 @@ +<<>> + +# This is a snippet of XSLT. To convert it into the more-common +# XML form, use the following command: +# +# pxslcc --indent xsl-stylesheet-01.pxsl > xsl-stylesheet-01.xsl + +xsl:stylesheet \ + -version=1.0 \ + -extension-element-prefixes=func \ + -xmlns:xml=http://www.w3.org/XML/1998/namespace \ + -xmlns:mcf=http://moertel.com/xsl/1.0/functions \ + -xmlns:func=http://exslt.org/functions \ + -xmlns:xsl=http://www.w3.org/1999/XSL/Transform + + func:function -name=mcf:vertical-menu + xsl:param -name=menu + xsl:param -name=target-absloc + func:result + div -class=vmenu + div -class=vmenu-items + xsl:for-each -select=$menu/* + xsl:if -test=self::menu + xsl:copy-of -select=mcf:vertical-menu(.,$target-absloc) + xsl:if -test=<{self::title or self::menu-item}> + xsl:variable -name=menu-absloc -select=mcf:absloc() + xsl:variable -name=mm-item-id \ + -select=mcf:maximal-matching-item($menu,$target-absloc) + xsl:if -test=self::title + xsl:variable -name=title \ + -select=mcf:menu-title($menu,$target-absloc) + xsl:choose + xsl:when -test=generate-id()=$mm-item-id + div -class=vmenu-title-selected + xsl:apply-templates -select=$title + xsl:otherwise + div -class=vmenu-title + a -href={mcf:menu-link($menu-absloc)} + xsl:apply-templates -select=$title + xsl:if -test=self::menu-item + xsl:choose + xsl:when -test=generate-id()=$mm-item-id + div -class=vmenu-item-selected + xsl:apply-templates + xsl:otherwise + div -class=vmenu-item + a -href={mcf:menu-link($menu-absloc)} + xsl:apply-templates --- pxsl-tools-1.0.orig/debian/examples/xsl-stylesheet-01s.pxsl +++ pxsl-tools-1.0/debian/examples/xsl-stylesheet-01s.pxsl @@ -0,0 +1,48 @@ +<<>> + +# This is a snippet of XSLT that uses pxslcc's built-in XSLT +# shortcuts. To convert it into the more-common XML form, +# use the following command: +# +# pxslcc --indent --xslt xsl-stylesheet-01s.pxsl > xsl-stylesheet-01s.xsl + +xsl:stylesheet \ + -version=1.0 \ + -extension-element-prefixes=func \ + -xmlns:xml=http://www.w3.org/XML/1998/namespace \ + -xmlns:mcf=http://moertel.com/xsl/1.0/functions \ + -xmlns:func=http://exslt.org/functions \ + -xmlns:xsl=http://www.w3.org/1999/XSL/Transform + + func:function -name=mcf:vertical-menu + param menu + param target-absloc + func:result + div -class=vmenu + div -class=vmenu-items + for-each $menu/* + if self::menu + copy-of mcf:vertical-menu(.,$target-absloc) + if <(<{self::title or self::menu-item}>)> + variable menu-absloc mcf:absloc() + variable mm-item-id \ + mcf:maximal-matching-item($menu,$target-absloc) + if self::title + variable title mcf:menu-title($menu,$target-absloc) + choose + when generate-id()=$mm-item-id + div -class=vmenu-title-selected + apply-templates $title + otherwise + div -class=vmenu-title + a -href={mcf:menu-link($menu-absloc)} + apply-templates $title + if self::menu-item + choose + when generate-id()=$mm-item-id + div -class=vmenu-item-selected + apply-templates + otherwise + div -class=vmenu-item + a -href={mcf:menu-link($menu-absloc)} + apply-templates