1

I have some XML like this:

<div id="clr-4930">Content here</div>

I need to turn it into this

<div id="clr-4930"><p>Content here</p></div>

The values of the id attributes will be different for each div. Is there a simple transform I can use to achieve this? I am using Oxygen XML editor. Thanks so much for any help!

  • Did you have a look at the [documentation](https://www.oxygenxml.com/doc/versions/19.0/ug-editor/topics/regular-expressions.html)? – Jeroen Heier Aug 24 '17 at 15:54

1 Answers1

2

You can use this as simple transformation

<xsl:template match="div">
    <xsl:copy>
        <xsl:copy-of select="@*"/>
        <p>
            <xsl:apply-templates/>
        </p>
    </xsl:copy>
</xsl:template>
Rupesh_Kr
  • 3,395
  • 2
  • 17
  • 32