XSLT/XML --> XHTML
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
XSLT/XML --> XHTML
Awesome... I've just started playing around with this
What have a been missing out on!?
Things that i remember from playing with it:
(The syntax higlighter seems to be still broken...)
The following does NOT work:
The solution:
When building lists, make sure they are not empty (eg:)
If you don't want the xml version of htmlentities on your data use disable-output-escaping="yes"
Some versions of php use to transform <textarea></textarea> to <textarea/> to avoid this:
(The syntax higlighter seems to be still broken...)
The following does NOT work:
Code: Select all
<form action="<xsl:value-of select="/page/action"/>" method="post">
Code: Select all
<form action="{/page/action}" method="post"></form>
Code: Select all
<xsl:if test="count(items/item) > 0">
<ul>
<xsl:for-each select="items/item">
<li><a href="{link}"><xsl:value-of select="title"/></a></li>
</xsl:for-each>
</ul>
</xsl:if>
Code: Select all
<xsl:value-of select="attribute[@name='content']" disable-output-escaping="yes"/>
Code: Select all
<xsl:output method="html"/>
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Handy to know thankstimvw wrote:Things that i remember from playing with it:
(The syntax higlighter seems to be still broken...)
The following does NOT work:
The solution:Code: Select all
<form action="<xsl:value-of select="/page/action"/>" method="post">
When building lists, make sure they are not empty (eg:)Code: Select all
<form action="{/page/action}" method="post"></form>
If you don't want the xml version of htmlentities on your data use disable-output-escaping="yes"Code: Select all
<xsl:if test="count(items/item) > 0"> <ul> <xsl:for-each select="items/item"> <li><a href="{link}"><xsl:value-of select="title"/></a></li> </xsl:for-each> </ul> </xsl:if>
Some versions of php use to transform <textarea></textarea> to <textarea/> to avoid this:Code: Select all
<xsl:value-of select="attribute[@name='content']" disable-output-escaping="yes"/>
Code: Select all
<xsl:output method="html"/>
XML I'm sure you know. XSLT allows you to transform XML (or rather XSL) into other formats such as HTML or XHTML (or even another XML document). I've stumbled upon using it as a means of making my markup more readable and smaller in size since what I'm doing at the moment is a little obscure.shiznatix wrote:uhhhhh what is it? i don't know what a have been missing out on :p
http://www.w3schools.com/xsl/default.asp
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
You can actually just add attribute using XSLT inline in any casetimvw wrote:Things that i remember from playing with it:
(The syntax higlighter seems to be still broken...)
The following does NOT work:
The solution:Code: Select all
<form action="<xsl:value-of select="/page/action"/>" method="post">
Code: Select all
<form action="{/page/action}" method="post"></form>
Code: Select all
<form method="post">
<xsl:attribute name="action">
<xsl:value-of select="/page/action"/>
</xsl:attribute>