From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14037 invoked by alias); 19 Sep 2002 00:16:36 -0000 Mailing-List: contact docbook-tools-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: docbook-tools-discuss-owner@sources.redhat.com Received: (qmail 14028 invoked from network); 19 Sep 2002 00:16:34 -0000 Received: from unknown (HELO snark.thyrsus.com) (66.92.53.140) by sources.redhat.com with SMTP; 19 Sep 2002 00:16:34 -0000 Received: (from esr@localhost) by snark.thyrsus.com (8.11.6/8.11.6) id g8J0DAT26975; Wed, 18 Sep 2002 20:13:10 -0400 Date: Fri, 20 Dec 2002 19:23:00 -0000 From: "Eric S. Raymond" To: Tim Waugh , docbook-tools-discuss@sources.redhat.com Subject: I've written an xml profiling tool Message-ID: <20020919001310.GA26917@thyrsus.com> Reply-To: esr@thyrsus.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline User-Agent: Mutt/1.4i Organization: Eric Conspiracy Secret Labs X-Eric-Conspiracy: There is no conspiracy X-SW-Source: 2002/txt/msg00129.txt.bz2 --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 707 I've written a little wrapper script that uses Jirka Kosek's stylesheet technique to do XML profiling. I could release it as a project, but it's so close to trivial that that seems kind of silly. Enclosed is the script and a RefEntry for it. Tim, do you want to take this into your xmlto package? Hack as you like, rename it, whatever; all I want is for something equivalent to be stock in the next Red Hat release. If you don't want it, tell me that. Then I'll go ahead and release it as a separate package. (Why the hell is conditionalization called profiling, anyway? Have I mentioned recently that XML jargon makes me nauseous?) -- Eric S. Raymond --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=xmlprofile Content-length: 1945 #!/bin/sh # # xmlprofile -- select portions of an XML document by attribute # # Trivial wrapper around Jirka Kosek's stylesheet-transform technique # for profiling XML documents. Uses xsltproc or saxon. # # Usage: xmlprofile param value file... # # by Eric S. Raymond 18 September 2002 param=$1; shift value=$1; shift files="$*" stylesheet=/usr/tmp/xmlprofile$$.xml trap "rm -f $stylesheet" 0 1 2 15 # Generate a stylesheet that know about the attribute we're passing in cat >$stylesheet < EOF # Apply the generated stylesheet using whatever XSLT engine is handy if which xsltproc >/dev/null then for file in $files do xsltproc --novalid --stringparam $param $value $stylesheet $file done elif which saxon >/dev/null then for file in $files do saxon $file $stylesheet "${param}=${value}" done else echo "xmlprofile: couldn't find an XSLT engine!" 1>&2 exit 1 fi exit 0 # End --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xmlprofile.xml" Content-length: 1799 xmlprofile 1 Sep 18 2002 xmlprofile conditionalization (profiling) for XML documents xmlprofile attribute value file DESCRIPTION This tool supports conditionally including or excluding sections from XML documents, implementing a facility similar to SGML marked sections. To use it, specify an attribute name, a value, and a list of files. Each file will be processed in turn and the results sent to standard output. For each tag pair that has a binding of the attribute in its header tag, that tag pair and enclosed contents will be present in the output if and only if the attribute value in the tag matches the required value passed in on the xmlprofile command line. A required value matches an attribute value if either (a) they are equal strings, or (b) the attribute value contains or-bars and the required value matches one of the or-bar-separated substrings. AUTHORS The generated-stylesheet technique for profiling was invented by Jirka Kosek. This implementation is by by Eric S. Raymond esr@snark.thyrsus.com. SEE ALSO --oyUTqETQ0mS9luUI-- From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14037 invoked by alias); 19 Sep 2002 00:16:36 -0000 Mailing-List: contact docbook-tools-discuss-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: docbook-tools-discuss-owner@sources.redhat.com Received: (qmail 14028 invoked from network); 19 Sep 2002 00:16:34 -0000 Received: from unknown (HELO snark.thyrsus.com) (66.92.53.140) by sources.redhat.com with SMTP; 19 Sep 2002 00:16:34 -0000 Received: (from esr@localhost) by snark.thyrsus.com (8.11.6/8.11.6) id g8J0DAT26975; Wed, 18 Sep 2002 20:13:10 -0400 Date: Wed, 18 Sep 2002 17:16:00 -0000 From: "Eric S. Raymond" To: Tim Waugh , docbook-tools-discuss@sources.redhat.com Subject: I've written an xml profiling tool Message-ID: <20020919001310.GA26917@thyrsus.com> Reply-To: esr@thyrsus.com Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline User-Agent: Mutt/1.4i Organization: Eric Conspiracy Secret Labs X-Eric-Conspiracy: There is no conspiracy X-SW-Source: 2002-q3/txt/msg00046.txt.bz2 Message-ID: <20020918171600.WaMcx8pI2DFeOMweDVh-Wp522l26GJz_lhKRLBEOl8k@z> --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 707 I've written a little wrapper script that uses Jirka Kosek's stylesheet technique to do XML profiling. I could release it as a project, but it's so close to trivial that that seems kind of silly. Enclosed is the script and a RefEntry for it. Tim, do you want to take this into your xmlto package? Hack as you like, rename it, whatever; all I want is for something equivalent to be stock in the next Red Hat release. If you don't want it, tell me that. Then I'll go ahead and release it as a separate package. (Why the hell is conditionalization called profiling, anyway? Have I mentioned recently that XML jargon makes me nauseous?) -- Eric S. Raymond --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=xmlprofile Content-length: 1945 #!/bin/sh # # xmlprofile -- select portions of an XML document by attribute # # Trivial wrapper around Jirka Kosek's stylesheet-transform technique # for profiling XML documents. Uses xsltproc or saxon. # # Usage: xmlprofile param value file... # # by Eric S. Raymond 18 September 2002 param=$1; shift value=$1; shift files="$*" stylesheet=/usr/tmp/xmlprofile$$.xml trap "rm -f $stylesheet" 0 1 2 15 # Generate a stylesheet that know about the attribute we're passing in cat >$stylesheet < EOF # Apply the generated stylesheet using whatever XSLT engine is handy if which xsltproc >/dev/null then for file in $files do xsltproc --novalid --stringparam $param $value $stylesheet $file done elif which saxon >/dev/null then for file in $files do saxon $file $stylesheet "${param}=${value}" done else echo "xmlprofile: couldn't find an XSLT engine!" 1>&2 exit 1 fi exit 0 # End --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xmlprofile.xml" Content-length: 1799 xmlprofile 1 Sep 18 2002 xmlprofile conditionalization (profiling) for XML documents xmlprofile attribute value file DESCRIPTION This tool supports conditionally including or excluding sections from XML documents, implementing a facility similar to SGML marked sections. To use it, specify an attribute name, a value, and a list of files. Each file will be processed in turn and the results sent to standard output. For each tag pair that has a binding of the attribute in its header tag, that tag pair and enclosed contents will be present in the output if and only if the attribute value in the tag matches the required value passed in on the xmlprofile command line. A required value matches an attribute value if either (a) they are equal strings, or (b) the attribute value contains or-bars and the required value matches one of the or-bar-separated substrings. AUTHORS The generated-stylesheet technique for profiling was invented by Jirka Kosek. This implementation is by by Eric S. Raymond esr@snark.thyrsus.com. SEE ALSO --oyUTqETQ0mS9luUI--