order list help

Discussion in 'HTML & Website Design' started by barnes, May 28, 2007.

  1. #1
    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
     
    barnes, May 28, 2007 IP
  2. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #2
    ajsa52, May 28, 2007 IP
  3. barnes

    barnes Guest

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    do you have any code for this.plz help me..
     
    barnes, May 28, 2007 IP
  4. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #4
    Are you really using XSLT (transforming XML to HTML) ?
    If yes, you can find an example on the link from my previuos post.
     
    ajsa52, May 28, 2007 IP
  5. barnes

    barnes Guest

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    <?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">
    <xsl:eek:utput 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..
     
    barnes, May 28, 2007 IP
  6. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #6
    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.
     
    ajsa52, May 29, 2007 IP
  7. barnes

    barnes Guest

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    i want client transformation...how to load .xml .xsl with AJAX and how to make transformations on my machine
     
    barnes, May 29, 2007 IP
  8. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #8
    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.
     
    ajsa52, May 29, 2007 IP