Jump to content

Mecha-Knuckles

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by Mecha-Knuckles

  1. Here is one way; this is the xml document: <Footer> <paragraph>Here is some text.</paragraph> <bold>Here is some bold text.</bold></Footer> and this is the XSL: <xsl:template match="Footer"> <fo:block font-size="12pt" space-after="5pt"> <xsl:apply-templates select="paragraph"/> <xsl:apply-templates select="bold"/> </fo:block></xsl:template><xsl:template match="paragraph"> <p> <xsl:value-of select="."/> </p></xsl:template><xsl:template match="bold"> <p> <b> <xsl:value-of select="."/> </b> </p></xs:template> Mind you this is not very clean, and there may be some errors in there. Were you to supply us with a link to the entire XML and XSL files this could be tidied up .
  2. I tried it, yet it displays the same.
  3. I am trying to make a website in XML and display it with XSLT, yet I am experiencing trouble when I try to make a list. Here is the XML file: <?xml version="1.0" encoding="ISO-8859-1"?><?xml-stylesheet href="site.xsl" type="text/xsl"?><page> <title>Home</title> <paragraph>Welcome to my (under consruction) tricking site! There will be forums up when I can get them installed, so keep posted.</paragraph> <menu> <item> <link> <site>http://www.something.com</site> <name>Home</name> </link> </item> </menu></page> and the stylesheet: <?xml version="1.0" encoding="ISO-8859-1"?><xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform/"><xsl:template match="/"> <html> <body> <xsl:apply-templates select="page/menu"/> <xsl:apply-templates select="page/title"/> <xsl:apply-templates select="page/paragraph"/> </body> </html></xsl:template><xsl:template match="page/menu"> <ul> <xsl:apply-templates/> </ul></xsl:template><xsl:template match="page/menu/item"/> <li> <xsl:apply-templates/> </li></xsl:template><xsl:template match="link"> <a href="<xsl:value-of select="./site/>"><xsl:value-of select="./name"/></a></xsl:template><xsl:template match="page/paragraph"> <p> <xsl:value-of select="."/> </p></xsl:template></xsl:stylesheet> Everything except the list hyperlink works. It is displayed as, "www.something.com Home."
×
×
  • Create New...