1 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
7 ./yaz-xmlquery -p '@and @attr 1=1016 @attr 4=2 @attr 6=3 the @attr 1=4 fish' > test.xml && xmllint -format test.xml && ./yaz-xmlquery -x test1.xml && xsltproc pqf2pqf.xsl test.xml |tee test2.xml && ./yaz-xmlquery -x test2.xml
9 ./yaz-xmlquery -p '@not @attr 1=1016 @attr 4=2 @attr 6=3 @attr 7=1 @attr 8=4 fish @attr 1=4 fish' > test.xml && xmllint -format test.xml && ./yaz-xmlquery -x test.xml && xsltproc pqf2pqf.xsl test.xml |tee test2.xml && ./yaz-xmlquery -x test2.xml
12 <!-- disable default templates -->
13 <xsl:template match="text()"/>
14 <xsl:template match="node()"/>
16 <!-- identity stylesheet templates -->
17 <!-- these parse pqf-xml input recursively and make identity operations -->
18 <xsl:template match="/query">
20 <xsl:apply-templates/>
24 <xsl:template match="rpn">
26 <xsl:attribute name="set">
27 <xsl:value-of select="@set"/>
29 <xsl:apply-templates/>
33 <xsl:template match="operator">
35 <xsl:attribute name="type">
36 <xsl:value-of select="@type"/>
38 <xsl:apply-templates/>
42 <xsl:template match="apt">
44 <xsl:apply-templates select="attr"/>
45 <xsl:apply-templates select="term"/>
49 <xsl:template match="attr">
50 <xsl:copy-of select="."/>
53 <xsl:template match="term">
54 <xsl:copy-of select="."/>
57 <!-- throw diagnostic for unsupported use attributes -->
58 <xsl:template match="attr[@type=1][@value=12]">
59 <diagnostic code="114" addinfo="{@value}"/>