xslt - Load data from xml -
i trying load values xml xsl... info xml:
<root> <firma id_firmy="15" role_firmy="o" kod_firmy="tomášov"> </firma> </root> this xsl:
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/tr/wd-xsl"> <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/> <xsl:template match="/"> <firma> <firstname><xsl:value-of select="@role_firmy" /></firstname> </firma> </xsl:template> i can not load values xml. have got ideas? thanks
i need output xml:
<main> <firma55> <role>o</role> </firma55> </main>
you have weird issues stylesheet:
the closing stylesheet tag missing; the xmlns:xsl namespace incorrect; the stylesheet version attribute missing.try way:
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/> <xsl:template match="/"> <main> <xsl:for-each select="root/firma"> <firma55> <role><xsl:value-of select="@role_firmy"/></role> </firma55> </xsl:for-each> </main> </xsl:template> </xsl:stylesheet> xml xslt
No comments:
Post a Comment