[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How to remove outer tag if present in XSLT
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.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|