Dot '.' in XML-Tags / Transforming w. XSLT
I've got an xml which shoule be transformed using XSLT but there are "." in the Tag and in cause of that it doesn't work. But the . is allowed in XML-Tags. Can anybody give me a hint on transforming such a file: XML:
<root.element>
<test.ele开发者_如何转开发ment>Hello World</test.element>
</root.element>
XSLT:
<xsl:template match="/">
<test><xsl:value-of select="root.element/test.element"/></test>
</xsl:template>
xsltproc (libxslt) transforms it properly. But you may try to push it in predicate:
<xsl:value-of select="node()[name()='test.element']"/>
It should work. Tried it with the MS XSLT parser and it works okay.
I did wonder if the problem is in the XPath expression as the dot character has special meaning in XPath, but seems okay.
What is the exact error?
精彩评论