Subject: Re: [xsl] How to remove outer tag if present in XSLT From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Fri, 17 Mar 2023 20:43:52 -0000 |
On 3/17/2023 9:19 PM, Matt Van Voorhies mvanvoorhies@xxxxxxxxxxx wrote: > > bbbbbbDimitre - this works great for removing the outer tag -- so long > as it's any outer tag. > > bbbbbbHow would I limit this to just <p> tags?? > > bbbbbbSo for example, > > bbbbbb<arbitrary-outer-tag> > bbbbbb<div> > bbbbbbbbbbbb<p>content<p> > bbbbbbbbbbbb<div>text</div > bbbbbbbbbbbb<b>more text</b> > bbbbbb</div> > bbbbbb<arbitrary-outer-tag> > > bbbbbbWould remain unchanged? > > B <xsl:template > match="arbitrary-outer-tag-thats-valid/*[1][not(following-sibling::*)]"> I think you can change B *[1] to B *[1][self::p] in that match template, if you want to ensure that the only child element is a "p" element.
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] How to remove outer tag i, Matt Van Voorhies mv | Thread | Re: [xsl] How to remove outer tag i, Peter Flynn peter@xx |
Re: [xsl] How to remove outer tag i, Matt Van Voorhies mv | Date | Re: [xsl] How to remove outer tag i, Peter Flynn peter@xx |
Month |