OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Ignoring NonDocBook tags, take 2


You can use a two steps XSLT transformation.
First run your document through a copy stylesheet that filters out a and 
b elements and then, in the second step, apply the desired DocBook 
stylesheet.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
version="1.0">
     <xsl:template match="node() | @*">
         <xsl:copy>
             <xsl:apply-templates select="node() | @*"/>
         </xsl:copy>
     </xsl:template>
     <xsl:template match="a|b">
         <xsl:apply-templates select="node()"/>
     </xsl:template>
</xsl:stylesheet>

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Bob Stayton wrote:
> Well, you can use a template such as the following:
> 
> <xsl:template match="a | b">
>   <xsl:apply-templates/>
> </xsl:template>
> 
> This matches on either element <a> or element <b>, does nothing special for
> them, and then applies templates to all of their children.
> 
> This will cover the situations where apply-templates is used on all
> children. But as my other mail inlinemediaobject mentioned, some templates
> don't use apply-templates on all children.
> 
> Bob Stayton
> Sagehill Enterprises
> DocBook Consulting
> bobs@sagehill.net
> 
> 
> ----- Original Message ----- 
> From: "Tristan Fiedler" <fiedler@cshl.edu>
> To: <docbook-apps@lists.oasis-open.org>
> Sent: Monday, November 22, 2004 3:34 PM
> Subject: [docbook-apps] Ignoring NonDocBook tags, take 2
> 
> 
> 
>>A set of non-DocBook XML tags are nested in my DocBook article.
>>
>>I am trying to modify the stylesheet with no success.
>>
>>What is the proper method to completely ignore a set of tags such as
>><a  attrib=test1>, </a>
>><b attrib=test2>, </b>
>>
>>but keep any text & valid DocBook tags with may be interspersed among
>>these nonDocBook tags?
>>
>>Cheers,
>>
>>Tristan
>>------------------------------
>>Tristan J. Fiedler
>>Postdoctoral Fellow - Stein Lab
>>Cold Spring Harbor Laboratory
>>
>>
>>
> 
> 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]