I'm not a HTML/XHTML/CSS expert (in every sense of the word), I just wnat nice 1. and 1.1 and 1.1.1 when I need them without resorting to javascript or php. 1 1.1 1.1.1 1.1.1.1 like this.... any suggestions ,thanks in advance
If you are creating your HTML/XHTML with XSLT, you can use the <xsl:number> element: http://www.w3.org/TR/xslt#number
Are you really using XSLT (transforming XML to HTML) ? If yes, you can find an example on the link from my previuos post.
<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> <!ENTITY copy "©"> <!ENTITY reg "®"> <!ENTITY trade "â„¢"> <!ENTITY mdash "—"> <!ENTITY ldquo "“"> <!ENTITY rdquo "â€"> <!ENTITY pound "£"> <!ENTITY yen "Â¥"> <!ENTITY euro "€"> ]> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xslutput method="html" encoding="iso-8859-1" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"/> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/> <title>Untitled Document</title> </head> <body> <xsl:template match="title"> <fo:block> <xsl:number level="multiple" count="chapter|section|subsection" format="1.1 "/> <xsl:apply-templates/> </fo:block> </xsl:template> </body> </html> </xsl:stylesheet> how can i apply this xslt to html.how can i see output like 1 1.1 1.1.1 1.1.1.1 is there any errors in xslt..i don't know about this xslt's ...how to locate xml source..
Do you want to make transformations on server side or client side ? - For server side. You can use xsltproc command. PERL example: my $fichXml = "../xml/yourfile.xml"; my $fichXsl = "../xsl/yourfile.xsl"; print qq[<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">\n]; my $param1 = "235"; my $param2 = "abd"; print `xsltproc --param param1 "'$param1'" --param param2 "'$param2'" "$fich_xsl" "$fich_xml"`; Code (markup): - For client side you need to load .xml .xsl with AJAX and make transformation s on user's machine.
i want client transformation...how to load .xml .xsl with AJAX and how to make transformations on my machine
On this page you'll find a simple example: http://www.w3schools.com/xsl/xsl_client.asp Search on Google if you want more advanced examples: with parameters, recursive transformation, cross-browser compliant, etc.