From owner-freebsd-questions@FreeBSD.ORG Fri Dec 11 20:49:48 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A8081065672 for ; Fri, 11 Dec 2009 20:49:48 +0000 (UTC) (envelope-from cpghost@cordula.ws) Received: from fw.farid-hajji.net (fw.farid-hajji.net [213.146.115.42]) by mx1.freebsd.org (Postfix) with ESMTP id 4C5198FC15 for ; Fri, 11 Dec 2009 20:49:46 +0000 (UTC) Received: from phenom.cordula.ws (phenom [192.168.254.60]) by fw.farid-hajji.net (Postfix) with ESMTP id D2434377D1; Fri, 11 Dec 2009 21:49:42 +0100 (CET) Date: Fri, 11 Dec 2009 21:49:42 +0100 From: cpghost To: Aryeh Friedman Message-ID: <20091211204941.GA54396@phenom.cordula.ws> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: FreeBSD Mailing List Subject: Re: OT: XML newbie X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Dec 2009 20:49:48 -0000 On Fri, Dec 11, 2009 at 01:50:40AM -0500, Aryeh Friedman wrote: > I am a relative XML newbie (i.e. our backend does spit out some XML I > wrote but it just slapped together with no knowledge of the > underlaying structure of XML)... Now I am going back and actually > learning XML... our main application is to insert XML directly into > XHTML documents and use either CSS or XSLT (don't know enough to pick > yet) to style them without resorting to javascript... I'm using xsltproc from the port textproc/libxslt to apply custom XSLT style sheets to XML files, resulting in XHTML output. Works great, and is super fast. xsltproc also understands the xmlns:exsl extensions, which means that it can generate multiple output files from a single XML input file, using the exsl:document element (very useful in the context of XHTML generation where you need to create multiple interlinked pages). > Now my question what is a good/reasonable set of command line tools > for working with/debugging/testing all this in such a way I do not > need to rely on the browser... specifically what types (and specific > ones if there is a preference) tools do I need and are there any > recommended procedures for dealing with XML from the command line.... > in the future we may want to also do Java parsing of XML but that > seems to be well handled already in the JDK (1.6) API.... thanks in > advance You can test the XML prior to applying XSLT, using something like xmllint from textproc/libxml2. xmllint is also particularly useful, if your main XML file inputs (with xi:include) other XML files (use the option --xinclude), and it can verify DTD as well. I also use www/linklint on the set of generated XHTML files to check for broken links etc..., though I guess it could be automated at the XML (DTD?) level too. Regards, -cpghost -- Cordula's Web. http://www.cordula.ws/