Subject: Re: [xsl] Nesting a flat XML structure From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Mon, 29 Oct 2018 18:52:51 -0000 |
I tried to create a recursive template to do the work, but thats where I got stuck.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mf="http://example.com/mf" exclude-result-prefixes="#all" version="3.0">
<xsl:param name="header-prefix" as="xs:string" select="'h'"/> <xsl:param name="list-prefix" as="xs:string">bullet_level</xsl:param>
<xsl:output method="xml" indent="yes"/> <xsl:strip-space elements="*"/>
<xsl:template match="doc"> <xsl:copy> <xsl:sequence select="mf:group(*, 1)"/> </xsl:copy> </xsl:template>
<xsl:template match="p[@style = 'para']"> <p> <xsl:apply-templates/> </p> </xsl:template>
<doc> <section> <title>title text</title> <p>body text</p> <p>body text</p> <ul> <li>list text</li> <li>list text<ul> <li>list text</li> <li>list text</li> <li>list text</li> </ul> </li> </ul> <section> <title>title text</title> <p>body text</p> <p>body text</p> </section> </section> </doc>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Nesting a flat XML struct, Michael Kay mike@xxx | Thread | Re: [xsl] Nesting a flat XML struct, Graydon graydon@xxxx |
Re: [xsl] Nesting a flat XML struct, Michael Kay mike@xxx | Date | Re: [xsl] Nesting a flat XML struct, Graydon graydon@xxxx |
Month |