Re: [Hypercontent-users] Strip text from content on render
Brought to you by:
alexvigdor
From: Alex V. <al...@bi...> - 2007-09-13 16:11:33
|
Carl, You might try using a mode to avoid the overlapping scope of those attribute templates, e.g. <xsl:apply-templates select="/cms:wrapper/cms:source/page/bodytext/ @title" mode="title"/> and wherever you declare the template <xsl:template match="@title" mode="title"> Or if you're only stripping border="0" out of elements from a WYSIWYG editor, you could try adding a mode to Adam's template <xsl:template match="@*" mode="html"> <!--Copy attribute if it's not border--> <xsl:if test="name() != 'border'"> <xsl:copy /> </xsl:if> </xsl:template> I'm not sure if that will work with your XSL, though, depends if you're using the same boilerplate templates I'm used to! Alex On Sep 13, 2007, at 11:34 AM, Carl P Barrow wrote: > Adam, > > The did work, but it stopped the bellow working, not sure why. Any > ideas? > > <xsl:template name="bodytitle"> > <xsl:apply-templates select="/cms:wrapper/cms:source/page/ > bodytext/@title"/> > </xsl:template> > > > <xsl:choose> > <xsl:when test="($sourceItem/@location='/index.xml')"></xsl:when> > <xsl:otherwise> > <h1> > <xsl:call-template name="bodytitle"/> > </h1> > </xsl:otherwise> > </xsl:choose> > > Thanks > Carl > > ************************************* > > Carl Barrow > Systems Integrator > e-Services > The University of Hull > Cottingham Road > Hull > HU6 7RX > Ext. 6838 > > ************************************* > > > > > -----Original Message----- > From: Adam Carl [mailto:ac...@co...] > Sent: Thu 9/13/2007 14:51 > To: Carl P Barrow; hyp...@li... > Subject: Re: [Hypercontent-users] Strip text from content on render > > Carl, > > Something like this should ignore any border attributes. > > <xsl:template match="@*"> > <!--Copy attribute if it's not border--> > <xsl:if test="name() != 'border'"> > <xsl:copy /> > </xsl:if> > </xsl:template> > > Adam > > > On 9/13/07 7:25 AM, "Carl P Barrow" <C.P...@hu...> wrote: > > > All, > > > > Does anyone know of a good/easy way to strip out certain text > from the content > > on render. They want to strip out all instances of border=0 from > the content, > > which can't be done in reality but I thought it might be possible > in XSL. > > > > Cheers > > Carl > > > > ************************************* > > > > Carl Barrow > > Systems Integrator > > e-Services > > The University of Hull > > Cottingham Road > > Hull > > HU6 7RX > > Ext. 6838 > > > > ************************************* > > > > > > > > > > > ********************************************************************** > ******** > > *********** > > To view the terms under which this email is distributed, please > go to > > http://www.hull.ac.uk/legal/email_disclaimer.html > > > ********************************************************************** > ******** > > *********** > > > > > ---------------------------------------------------------------------- > --- > > This SF.net email is sponsored by: Microsoft > > Defy all challenges. Microsoft(R) Visual Studio 2005. > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > > _______________________________________________ > > Hypercontent-users mailing list > > Hyp...@li... > > https://lists.sourceforge.net/lists/listinfo/hypercontent-users > > > > > ********************************************************************** > ******************* > To view the terms under which this email is distributed, please go > to http://www.hull.ac.uk/legal/email_disclaimer.html > ********************************************************************** > *******************--------------------------------------------------- > ---------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Hypercontent-users mailing list > Hyp...@li... > https://lists.sourceforge.net/lists/listinfo/hypercontent-users |