Dear George,
i read some information about the whitespace and checked all whitespace options,
but i can't get the result without the whitespaces.
I tried your origin xsl to be sure, that my coding isn't the problem.
The xsl preferences (-strip) in oxygen in the xslt-szenario is (all).
This is the XML of an Word Document (only a part).
- Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:wordDocument xmlns:xd="http://www.oxygenxml.com/ns/doc/xsl"
xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:sl="http://schemas.microsoft.com/schemaLibrary/2003/core" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" w:macrosPresent="no" w:embeddedObjPresent="no" w:ocxPresent="no" xml:space="preserve">
<o:DocumentProperties/>
<w:fonts>
<w:defaultFonts w:ascii="Arial" w:fareast="Arial" w:h-ansi="Arial" w:cs="Arial"/>
<w:font w:name="Tahoma">
<w:panose-1 w:val="020B0604030504040204"/>
<w:charset w:val="00"/>
<w:family w:val="Swiss"/>
<w:pitch w:val="variable"/>
<w:sig w:usb-0="61007A87" w:usb-1="80000000" w:usb-2="00000008" w:usb-3="00000000" w:csb-0="000101FF" w:csb-1="00000000"/>
</w:font>
<w:font w:name="Verdana">
<w:panose-1 w:val="020B0604030504040204"/>
<w:charset w:val="00"/>
<w:family w:val="Swiss"/>
<w:pitch w:val="variable"/>
<w:sig w:usb-0="20000287" w:usb-1="00000000" w:usb-2="00000000" w:usb-3="00000000" w:csb-0="0000019F" w:csb-1="00000000"/>
</w:font>
</w:fonts>
<w:lists>
<w:listDef w:listDefId="100">
<w:lsid w:val="44CD38B3"/>
<w:plt w:val="Multilevel"/>
<w:tmpl w:val="27264C1A"/>
<w:lvl w:ilvl="0">
<w:start w:val="1"/>
<w:lvlText w:val="%1."/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:ind w:left="340" w:hanging="340"/>
</w:pPr>
<w:rPr>
<w:rFonts w:hint="default"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="1">
<w:start w:val="1"/>
<w:lvlText w:val="%1.%2"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:ind w:left="576" w:hanging="9"/>
</w:pPr>
<w:rPr>
<w:rFonts w:hint="default"/>
</w:rPr>
</w:lvl>
<w:lvl w:ilvl="2">
<w:start w:val="1"/>
<w:lvlText w:val="%1.%2.%3"/>
<w:lvlJc w:val="left"/>
<w:pPr>
<w:tabs>
<w:tab w:val="list" w:pos="1021"/>
</w:tabs>
<w:ind w:left="720" w:first-line="131"/>
</w:pPr>
<w:rPr>
<w:rFonts w:hint="default"/>
</w:rPr>
</w:lvl>
</w:listDef>
<w:list w:ilfo="300">
<w:ilst w:val="100"/>
</w:list>
</w:lists>
</w:wordDocument>
If I use the xslt stylesheet from you
- Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:a="a"
exclude-result-prefixes="a" version="2.0">
<xsl:output indent="yes"/>
<xsl:namespace-alias stylesheet-prefix="a" result-prefix="xsl"/>
<xsl:template match="/">
<a:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<a:template match="/">
<xsl:apply-templates/>
</a:template>
</a:stylesheet>
</xsl:template>
<xsl:template match="*">
<a:element name="{name()}" namespace="{namespace-uri()}">
<xsl:apply-templates select="@*|node()"/>
</a:element>
</xsl:template>
<xsl:template match="@*">
<a:attribute name="{name()}" namespace="{namespace-uri()}"/>
</xsl:template>
<xsl:template match="text()">
<a:text>
<xsl:value-of select="."/>
</a:text>
</xsl:template>
</xsl:stylesheet>
i get the result with many whitespaces inside
- Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
<xsl:template match="/">
<xsl:element name="w:wordDocument"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:macrosPresent"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:embeddedObjPresent"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:ocxPresent"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="xml:space" namespace="http://www.w3.org/XML/1998/namespace"/>
<xsl:text>
</xsl:text>
<xsl:element name="o:DocumentProperties"
namespace="urn:schemas-microsoft-com:office:office"/>
<xsl:text>
</xsl:text>
<xsl:element name="w:fonts"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:text>
</xsl:text>
<xsl:element name="w:defaultFonts"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:ascii"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:fareast"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:h-ansi"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:cs"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:font"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:name"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:text>
</xsl:text>
<xsl:element name="w:panose-1"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:charset"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:family"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:pitch"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:sig"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:usb-0"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:usb-1"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:usb-2"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:usb-3"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:csb-0"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:csb-1"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:font"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:name"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:text>
</xsl:text>
<xsl:element name="w:panose-1"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:charset"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:family"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:pitch"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:sig"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:usb-0"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:usb-1"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:usb-2"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:usb-3"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:csb-0"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:csb-1"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:lists"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:text>
</xsl:text>
<xsl:element name="w:listDef"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:listDefId"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:text>
</xsl:text>
<xsl:element name="w:lsid"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:plt"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:tmpl"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:lvl"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:ilvl"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:text>
</xsl:text>
<xsl:element name="w:start"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:lvlText"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:lvlJc"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:pPr"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:text>
</xsl:text>
<xsl:element name="w:ind"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:left"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:hanging"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:rPr"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:text>
</xsl:text>
<xsl:element name="w:rFonts"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:hint"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:lvl"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:ilvl"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:text>
</xsl:text>
<xsl:element name="w:start"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:lvlText"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:lvlJc"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:pPr"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:text>
</xsl:text>
<xsl:element name="w:ind"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:left"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:hanging"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:rPr"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:text>
</xsl:text>
<xsl:element name="w:rFonts"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:hint"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:lvl"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:ilvl"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:text>
</xsl:text>
<xsl:element name="w:start"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:lvlText"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:lvlJc"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:pPr"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:text>
</xsl:text>
<xsl:element name="w:tabs"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:text>
</xsl:text>
<xsl:element name="w:tab"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:pos"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:ind"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:left"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:attribute name="w:first-line"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:rPr"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:text>
</xsl:text>
<xsl:element name="w:rFonts"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:hint"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
<xsl:element name="w:list"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:ilfo"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
<xsl:text>
</xsl:text>
<xsl:element name="w:ilst"
namespace="http://schemas.microsoft.com/office/word/2003/wordml">
<xsl:attribute name="w:val"
namespace="http://schemas.microsoft.com/office/word/2003/wordml"/>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
<xsl:text>
</xsl:text>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Why did i get it? What is the difference between your and my system?
Thanks for any help.
best regards
armin