[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Docbook XML questions
From: Simon Anderson ####@####.#### Date: 31 Jul 2003 10:01:40 -0000 Message-Id: <1059685210.1541.17.camel@dalton> I have just started using Docbook and XML and have some questions. 1- How can I fix the syntax of complex URLs? This XML; <ulink url="http://hostap.epitest.di/cgi-bin/viewcvs.cgi/*checkout*/hostap/README?rev=HEAD&content-type=text/plain"> instructions</ulink> Causes the following error from xsltproc; <sect1 id="install-redhat"> ^ accesspoint.xml:928: error: xmlParseEntityRef: expecting ';' ap.epitest.di/cgi-bin/viewcvs.cgi/*checkout*/hostap/README?rev=HEAD&content-typ ^ unable to parse accesspoint.xml I assume that it doesn't like some of the characters inside the URL string. How can I fix this? 2- Indexing 3rd level sections and beyond are not getting a contents page entry. I have modelled the XML on some HOWTO's I grabbed from TLDP, the associated HTML for these examples _do_ have 3rd level contents entries even though the syntax used is indetical to mine. 3- Contents I am structuring my HOWTO to have each chapter as a seperate HTML page. The first two <sect1> tags in the XML are essentially identical, only the first one is appended to the index.html page (which I don't want) while the second (and subsequent) <sect1> tags do have a seperate HTML page created for them. !-- section1: intro --> <sect1 id="introduction"> <title>Introduction</title> <indexterm> <primary>accesspoint!introduction</primary> </indexterm> <!-- section2: prerequisites --> <sect1 id="prerequisites"> <title>Prerequisites</title> <indexterm> <primary>accesspoint!prerequisites</primary> </indexterm> How can I force section 1 to be created as a sperate HTML page as Sectio 2 is, rather than being appended to index.html? I am using this command to xsltproc; xsltproc --nonet -stringparam base.dir output/ ~/docbook/xsl/xhtml/chunk.xsl accesspoint.xml Also, I have been unable to assign the resultant HTML pages a filename, instead a random one is generated. How can I set a file name for a <sect1> tag? Thanks in advance, Simon. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: Docbook XML questions
From: "Martin A. Brown" ####@####.#### Date: 31 Jul 2003 13:44:06 -0000 Message-Id: <Pine.LNX.4.55.0307310830380.1624@enclitic.wonderfrog.net> : I have just started using Docbook and XML and have some questions. : : 1- How can I fix the syntax of complex URLs? : : This XML; : <ulink : url="http://hostap.epitest.di/cgi-bin/viewcvs.cgi/*checkout*/hostap/README?rev=HEAD&content-type=text/plain"> : instructions</ulink> Yes, the '&' inside the URL needs to be escaped properly so the XSLT processor will substitute the '&'. Right now, xsltproc finds the beginning of what it thinks is an entity, and finds no end. Try replacing '&' with '&'. : Causes the following error from xsltproc; : : <sect1 id="install-redhat"> : ^ : accesspoint.xml:928: error: xmlParseEntityRef: expecting ';' : ap.epitest.di/cgi-bin/viewcvs.cgi/*checkout*/hostap/README?rev=HEAD&content-typ : ^ : unable to parse accesspoint.xml : : I assume that it doesn't like some of the characters inside the URL : string. How can I fix this? The rest of your questions revolve around the output from the stylesheets, which means that you'll find a customization layer rather handy. Please read up on a customization layer here. http://www.sagehill.net/docbookxsl/CustomMethods.html#CustomizationLayer Note, for example, in my customization layer for my linux-ip docs I refer to the absolute URL of Norm Walsh's stylesheets. If your catalog file is correctly configured, the processor will map this request to the files in the local filesystem. http://cvsview.tldp.org/index.cgi/LDP/guide/docbook/linux-ip/xsl/linux-ip-chunk.xsl?rev=1.2&content-type=text/vnd.viewcvs-markup : : 2- Indexing : : 3rd level sections and beyond are not getting a contents page entry. I : have modelled the XML on some HOWTO's I grabbed from TLDP, the : associated HTML for these examples _do_ have 3rd level contents entries : even though the syntax used is indetical to mine. This one, I'm not so sure about, but I think this is the required setting: <xsl:param name="toc.section.depth" select="2"/> : 3- Contents : : I am structuring my HOWTO to have each chapter as a seperate HTML page. : The first two <sect1> tags in the XML are essentially identical, only : the first one is appended to the index.html page (which I don't want) : while the second (and subsequent) <sect1> tags do have a seperate HTML : page created for them. : : !-- section1: intro --> : : <sect1 id="introduction"> : <title>Introduction</title> : <indexterm> : <primary>accesspoint!introduction</primary> : </indexterm> : : <!-- section2: prerequisites --> : : <sect1 id="prerequisites"> : <title>Prerequisites</title> : <indexterm> : <primary>accesspoint!prerequisites</primary> : </indexterm> : : How can I force section 1 to be created as a sperate HTML page as Sectio : 2 is, rather than being appended to index.html? I think this should work. It will need to be added to your XSLT customization layer. <xsl:param name="chunk.first.sections" select="'1'"/> : I am using this command to xsltproc; : : xsltproc --nonet -stringparam base.dir output/ : ~/docbook/xsl/xhtml/chunk.xsl accesspoint.xml : : Also, I have been unable to assign the resultant HTML pages a filename, : instead a random one is generated. How can I set a file name for a : <sect1> tag? Customization layer necessity: <xsl:param name="use.id.as.filename" select="1"/> See also the plethora of documentation about DocBook XSLT and so forth: http://docbook.org/wiki/moin.cgi/DocBookDocumentation Best of luck, -Martin | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |