[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

Subject: Re: 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
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.

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.