Dear Mr. Shafie

I have an XSLT question where I did not find a solution by searchig the web. 
In case you can „just type down“ the solution to the question, I would be very 
happy ☺

I am loooking fort he following xslt to get rid of 2 common unsematic word 
formatings:

xslt to convert full bold paragraphs to headings: 
<p><b>xxx yyy </b></p> —> <h6 class=„BOLD">xxx yyy </h6>

xslt to convert lists that contain only one item to headings:
<ul><li>xxx yyy</li></ul> —> <h6 class=„LIST">xxx yyy</h6>
<ol><li>xxx yyy</li></ol> —> <h6 class=„LIST">xxx yyy</h6>

Thank you for your time!

Regards
Thomas Dumm



On 15/06/16 13:50, "Hussein Shafie" <huss...@xmlmind.com> wrote:

On 06/15/2016 12:14 PM, Thomas Dumm wrote:
> Dear Mr Shafie
>
> I am trying to get rid of the <div class=“role-section1“> elements that w2x 
> is creating. I did not find a paramater in the manual, so I tried with xslt 
> (not my strength). The <div class=“role-section1“> elements are not removed 
> by the following xslt. Do you have any idea what I am doing wrong?
>

No need for an XSLT stylesheet to do this. Simply pass this option to w2x:

-p edit.do.sections ""

This parameter simply replaces the stock XED script 
"w2x_install_dir/xed/sections.xed", which creates sections by nothing at 
all.




---
PS: Unrelated but your XSLT stylesheet cannot work because you forgot to 
specify the namespace and the prefix of XHTML:

<xsl:stylesheet xmlns:html="http://www.w3.org/1999/xhtml";


<xsl:template match="//html:div[@class='role-section1']">

(XED can use the default namespace as this makes scripts easier to read; 
XSLT 1.0/XPath 1.0 cannot.)



> Thank you for your help!
> Thomas Dumm
>
>
> <xsl:stylesheet version="1.0" 
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
>      <xsl:output indent="yes"/>
>      <xsl:strip-space elements="*"/>
>
>
>      <xsl:template match="@*|node()">
>          <xsl:copy>
>              <xsl:apply-templates select="@*|node()"/>
>          </xsl:copy>
>      </xsl:template>
>
>      <xsl:template match="//div[@class='role-section1']">
>          <xsl:apply-templates select="@*|node()"/>
>      </xsl:template>
>
>
> </xsl:stylesheet>





--
XMLmind Word To XML Support List
w2x-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/w2x-support

Reply via email to