| | |
XSL elements from attributes
Please support our XML, XSLT and XPATH advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Mar 2009
Posts: 1
Reputation:
Solved Threads: 0
Given the following XML:
How could I get this result?:
Thanks in advance!
<FlowDocument>
<Run FontStyle="Italic" FontWeight="Bold">test</Run>
</FlowDocument>How could I get this result?:
<body>
<em><strong>test</strong></em>
</body>Thanks in advance!
XML, XSLT and XPATH Syntax (Toggle Plain Text)
<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"> <xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/> <xsl:template match="FlowControl"> <body> <xsl:apply-templates select="Run" /> </body> </xsl:template> <xsl:template match="Run"> <xsl:if test="@FontStyle = 'Italic'"> <xsl:text disable-output-escaping="yes"><em></xsl:text> </xsl:if> <xsl:if test="@FontWeight = 'Bold'"> <xsl:text disable-output-escaping="yes"><strong></xsl:text> </xsl:if> <xsl:value-of select="."/> <xsl:if test="@FontWeight = 'Bold'"> <xsl:text disable-output-escaping="yes"></strong></xsl:text> </xsl:if> <xsl:if test="@FontStyle = 'Italic'"> <xsl:text disable-output-escaping="yes"></em></xsl:text> </xsl:if> </xsl:template> </xsl:stylesheet>
"If it is NOT source, it is NOT software."
-- NASA
-- NASA
•
•
Join Date: Oct 2008
Posts: 95
Reputation:
Solved Threads: 5
Typo
should be
XML, XSLT and XPATH Syntax (Toggle Plain Text)
<xsl:template match="FlowControl">
XML, XSLT and XPATH Syntax (Toggle Plain Text)
<xsl:template math="FlowDocument">
![]() |
Similar Threads
- XML to XML make all elements attributes (XML, XSLT and XPATH)
- Mouse events, xml values and Javascript (RSS, Web Services and SOAP)
Other Threads in the XML, XSLT and XPATH Forum
- Previous Thread: Xslt-escape_sequence
- Next Thread: Namespaces with XPaths
| Thread Tools | Search this Thread |
api blogger blogging code delete development dynamiccreationofnvariablesinxslt error firstthreecharacterofastringrequired flipbook gdata google html include java link linspire linux microsoft news node openoffice overwrite precedence programming rss standards swf template transform variable w3c web xml xmlnotloading xmlonserver xsl xslt





