S
stefano
Hi, I have a file xml (p.xml) and I use XSLT to trasform p.xml to
XHTML.
this is the xml file:
....
<test label="x">
<itemList>
<testItem oknumber="2" >
....
</testItem>
</itemList>
</test>
.....
and this is the XSLT file:
.....
<xsl:template match="test">
<span>
<xsl:attribute name="class"> test </xsl:attribute>
<span>
<a>
<xsl:attribute name="name"><xsl:value-of
select="@label"/></xsl:attribute>
</a>
</span>
<xsl:call-template name="title"/>
<form>
<xsl:apply-templates/>
</form>
</span>
</xsl:template>
<xsl:template match="itemList">
<span>
<xsl:attribute name="class"> itemList </xsl:attribute>
<xsl:apply-templates/>
</span>
<input type= "button" class="but" value="verifica"
onclick="verify(this);" />
<script language="JavaScript">
function verify(t)
{
alert(t.tagName);
alert(t.parentNode.tagName);
}
</script>
</xsl:template>
....
the alert message should print:
"input"
"form"
In firefox all is ok, while in IE the second alert print "a".
The strange thing is that if the verify function is:
function verify(t)
{
alert(t.tagName);
alert(t.parentNode.tagName);
alert(t.previousSibling.parentNode.tagName);
}
the alert message in IE are:
"input"
"a"
"form"
Why?
I have problems with the DOM only in IE.Someone can help me, plese?
thanks
XHTML.
this is the xml file:
....
<test label="x">
<itemList>
<testItem oknumber="2" >
....
</testItem>
</itemList>
</test>
.....
and this is the XSLT file:
.....
<xsl:template match="test">
<span>
<xsl:attribute name="class"> test </xsl:attribute>
<span>
<a>
<xsl:attribute name="name"><xsl:value-of
select="@label"/></xsl:attribute>
</a>
</span>
<xsl:call-template name="title"/>
<form>
<xsl:apply-templates/>
</form>
</span>
</xsl:template>
<xsl:template match="itemList">
<span>
<xsl:attribute name="class"> itemList </xsl:attribute>
<xsl:apply-templates/>
</span>
<input type= "button" class="but" value="verifica"
onclick="verify(this);" />
<script language="JavaScript">
function verify(t)
{
alert(t.tagName);
alert(t.parentNode.tagName);
}
</script>
</xsl:template>
....
the alert message should print:
"input"
"form"
In firefox all is ok, while in IE the second alert print "a".
The strange thing is that if the verify function is:
function verify(t)
{
alert(t.tagName);
alert(t.parentNode.tagName);
alert(t.previousSibling.parentNode.tagName);
}
the alert message in IE are:
"input"
"a"
"form"
Why?
I have problems with the DOM only in IE.Someone can help me, plese?
thanks