This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: condition attribute + XSL + doctype declaration


On 20010705 12:05 (Thursday), Bob Stayton wrote:
> I solved my problem by creating a small stylesheet to first
> filter my source file to a temporary xml file with the
> elements excluded, and then process the resulting temp file
> with the standard Docbook stylesheets.
> 
> <?xml version='1.0'?>
> <xsl:stylesheet
>           xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
>           version='1.0'>
> <xsl:output method="xml"/>
> 
> <xsl:template match="*|/">
>         <xsl:copy>
>                 <xsl:copy-of select="@*"/>
>                 <xsl:apply-templates/>
>         </xsl:copy>
> </xsl:template>
> 
> <xsl:template match="*[@condition='long']">
> </xsl:template>
> 
> </xsl:stylesheet>

Thank you for your help on this Bob. It works (of course ;-)) and made 
me save lots of time :-)
It is clearly the "right answer" to this problem but some details of no
consequence still annoy me.

I had to add 
  doctype-public="-//OASIS//DTD DocBook XML V4.1.2//EN"
  doctype-system="http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd";
in <xsl:output> because the doctype declaration
<!DOCTYPE HTML PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd";>
is being lost in the process.

I first changed your proposed stylesheet with replacing "*" by "node()" 
so no nodes (like processing instructions) would be lost in the process.
But this has had no effect on the doctype declaration :-(
I've also checked http://www.w3.org/TR/xslt.html#output for more 
details without finding out if it is normal or not.
Any idea how the doctype could be kept without to modify the stylesheet
each time the doctype changes ??? Anyone ?

Another point that I don't understand is <xsl:copy-of select="@*"/>.
<xsl:copy-of select="*"/> seems to be enough.
Please could you tell me what does "@*" mean in this context ?


<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version='1.0'>

<xsl:output
	encoding="ISO-8859-1"
	method="xml"
	omit-xml-declaration="no"
	indent="yes"
	doctype-public="-//OASIS//DTD DocBook XML V4.1.2//EN"
	doctype-system="http://www.oasis-open.org/docbook/xml/4.0/docbookx.dtd";
/>

<xsl:template match="node()|/">
	<xsl:copy>
		<xsl:copy-of select="@*"/>
		<xsl:apply-templates/>
	</xsl:copy>
</xsl:template>

<xsl:template match="*[@condition='long']">
</xsl:template>

</xsl:stylesheet>


Best regards,

-- 
Marc-Aurčle DARCHE  <http://ma.darche.free.fr>
AFUL <http://www.aful.org>
Association Francophone des Utilisateurs de Linux/Logiciels Libres
French speaking Linux and Free Software Users' Association


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]