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] RE: Delete child <section> via xsl


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Looks like you need to close the paren for the not(). Change:

<xsl:apply-templates select="*[not(name() = 'title']" />

To:

<xsl:apply-templates select="*[not(name() = 'title')]" />
                                                  ^^^
David

On 05/03/2012 03:02 PM, Joshua Wulf wrote:
> Thanks for the suggestion Rob.
> 
> When I try this I get:
> 
> XSLT-apply-templates: could not compile select expression
> '*[not(name() = 'title']'
> 
> 
> - Josh
> 
> ----- Original Message ----- From: "rob cavicchio"
> <rob.cavicchio@emc.com> To: docbook-apps@lists.oasis-open.org Sent:
> Friday, May 4, 2012 12:55:19 AM Subject: [docbook-apps] RE: Delete
> child <section> via xsl
> 
> Joshua J Wulf [mailto:jwulf@redhat.com] wrote:
> 
>> I'd like to do the following with an xsl template:
>> 
>> If a section or chapter contains an immediate child section with
>> the same title, then delete the child's<section/>  and<title/>
>> tags, but not the contents between the child<section>
>> and</section>.
> 
> 
> I think that you want to do something like the following
> (untested), though you might have to tweak the details. I'm
> guessing that the situation you are thinking of is that you have a
> chapter with only a single section in it. (This code does not
> actually test to make sure that there are no other sections within
> the chapter, but it could be made to do so.)
> 
> 
> <xsl:template match="section"> <xsl:choose> <xsl:when
> test="string(title) = string(../title)"> <xsl:apply-templates
> select="*[not(name() = 'title']" /> </xsl:when> <xsl:otherwise> 
> <!-- NORMAL SECTION PROCESSING --> </xsl:otherwise> </xsl:choose> 
> </xsl:template>
> 
> 
> ************************* Rob Cavicchio rob.cavicchio@emc.com
> 
> Principal Technical Writer & Information Architect Information
> Intelligence Group EMC Corporation
> 
> The opinions expressed here are my personal opinions. Content
> published here is not read or approved in advance by EMC and does
> not necessarily reflect the views and opinions of EMC.
> 
> ---------------------------------------------------------------------
>
> 
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail:
> docbook-apps-help@lists.oasis-open.org
> 
> 
> ---------------------------------------------------------------------
>
> 
To unsubscribe, e-mail: docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail:
> docbook-apps-help@lists.oasis-open.org
> 

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJPoutgAAoJEMHeSXG7afUhrhIH/2Kskk3QWkfXPtw+lBEFGIzv
m0H7o9Jhi/zJ1VvkNinJHQ+no0zp9wYC5D51OyDi8WWjnxgIckMX4BCy1EYVxqQD
EpzBU+2rNnW56nbXFCgJ/tmhlDFXhuJjpXuejSOb27B22T6sTUshfPSSeQQtePki
xakSeQu5H0Sp5/qgJrT28mPkTG5JGd9WgzOzu+R+8ViL8Y53xwYJuPfkdfvx9Xp9
o/lJdgeMT84fPrvzaBZifoHWc0R4C9rD6d5uhgrFuTxBPLnEQYRx4kttkSdLC2Kk
1SPBQKlkuRS7wdOdb++XH41rAXx53KIHUdx3Gk2VvtrgB/AVXWIBojIWZU83IL8=
=ZtMm
-----END PGP SIGNATURE-----


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