[XLST] FF neemt de html-tags niet mee, IE wel

Pagina: 1
Acties:

Acties:
  • 0 Henk 'm!

  • Tantuss
  • Registratie: November 2001
  • Laatst online: 05-03-2021
Op een vreemde manier neemt FF de html tags niet en laat deze niet zien wat ik verwacht.
IE doet dit wel goed.

Hier staat de demo:
http://www.streetfighters.eu/jw/srcTest/
(hoop dat jullie niet te moeilijk doen over 't feit dat 't Russisch is ;-) )

Is dit een probleem van de parsing methode:
appendChild(resultDocument);
(http://www.streetfighters.eu/jw/srcTest/add_parser.js)
Of is dit een probleem van de stylesheet:
(http://www.streetfighters.eu/jw/srcTest/uchenik.xsl)

XML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?xml version="1.0" encoding="windows-1251"?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.w3.org/TR/REC-html40">
<xsl:output method="html" encoding="windows-1251"/>

<xsl:template match="/">
    <h1><xsl:apply-templates select="//tema"/></h1>
    <xsl:apply-templates select="//text"/>
    <xsl:apply-templates select="//control"/>
</xsl:template>

<xsl:template match="podtema">             
                    <div><xsl:attribute name="class">
                         <xsl:value-of select="name()"/>
                    </xsl:attribute>
                    <xsl:value-of select="."/></div>
</xsl:template>

<xsl:template match="rech|control|spisok">             
                    <div><xsl:attribute name="class">
                         <xsl:value-of select="name()"/>
                    </xsl:attribute>
                    <xsl:value-of select="."/></div>
</xsl:template>

<xsl:template match="illustracii">
 <p><img src="{@file}" alt=""/></p>
</xsl:template>

</xsl:stylesheet>

Iemand een idee om dit op te lossen?

[ Voor 0% gewijzigd door Woy op 09-03-2009 12:00 ]


Acties:
  • 0 Henk 'm!

  • Woy
  • Registratie: April 2000
  • Niet online

Woy

Moderator Devschuur®
Ik heb je xslt even in [code=xml][/code] gezet, dan is het ieder geval een stuk beter leesbaar

“Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.”


Acties:
  • 0 Henk 'm!

  • crisp
  • Registratie: Februari 2000
  • Laatst online: 15:25

crisp

Devver

Pixelated

Lijkt mij een namespace issue...

Intentionally left blank


Acties:
  • 0 Henk 'm!

  • Tantuss
  • Registratie: November 2001
  • Laatst online: 05-03-2021
Het is opgelost..

Dit schijnt het probleem te zijn geweest:
XML:
1
2
3
4
5
6
<?xml version="1.0" encoding="windows-1251"?>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.w3.org/TR/REC-html40">
<xsl:output method="html" encoding="windows-1251"/> 


Nu heb ik het verandert naar:
XML:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">                                             
  <html>
        <style type="text/css">
body {font-family: verdana;}
h1 {font-size: 20px;
    margin:20px;}
h2 {font-size: 16px;
    margin:20px;
    margin-top: 40px;}  
p  {text-align: left;
    font-size: 14px;
    margin-left:40px;}
.rech{font-size: 14px;}
.control{font-size: 14px;}
.podtema{font-size: 14px;
         font-style: italic;
         font-weight: bold;
         margin:20px;
         margin-bottom:10px;}
.dejstvie{font-style: italic;
          font-size: 14px;}
.punkt{font-size: 14px;}
   </style>
  <body>
    <h1><xsl:apply-templates select="//tema"/></h1>
    <xsl:apply-templates select="//text"/>
    <xsl:apply-templates select="//control"/>
  </body>
  </html>
</xsl:template>

<xsl:template match="podtema">             
                    <div><xsl:attribute name="class">
                         <xsl:value-of select="name()"/>
                    </xsl:attribute>
                    <xsl:value-of select="."/></div>
</xsl:template>

<xsl:template match="rech|control|spisok">             
                    <div><xsl:attribute name="class">
                         <xsl:value-of select="name()"/>
                    </xsl:attribute>
                    <xsl:value-of select="."/></div>
</xsl:template>

<xsl:template match="illustracii">
 <p><img src="{@file}" alt=""/></p>
</xsl:template>


</xsl:stylesheet>


Dan werkt het wel goed.

Of dit geeft een probleem:
<xsl:output method="html" encoding="windows-1251"/>

Of het niet gebruiken van <html><body> geeft een probleem.
Vreemde is alleen dat je dus nu 2x html en body hebt. Maar goed, als het werkt maakt het mij niet zoveel uit ;)

[ Voor 58% gewijzigd door Tantuss op 09-03-2009 13:41 ]


Acties:
  • 0 Henk 'm!

  • crisp
  • Registratie: Februari 2000
  • Laatst online: 15:25

crisp

Devver

Pixelated

like I said: namespace ;)
html en body zou ik weghalen uit je XML, en de CSS extern houden; je insert het namelijk als een fragment in een reeds compleet document

Intentionally left blank