[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: How do I create a XSLT referencing DTD's with ?,+,
On Sat, Apr 26, 2003 at 10:17:48AM -0700, K. D. <mail2dennis2@xxxxxxxxx> wrote a message of 32 lines which said: > Thank you in advance for your help. I am very > confused on how to build a XSLT stylesheet that > converts a document validated by a DTD with ?,+, and > *'s (like the enclosed example) from XML format to > publishable HTML. It seems that (correct me if I'm wrong) you are a complete beginner in XSLT. If so, I suggest that you cannot write your first stylesheet in the next minutes and you should start to read a good book about XSLT. For the DTD you mention, you will have to write a set of templates, each generating HTML. For instance (I do not list every template and this stylesheet is a fast and very crude one): <?xml version="1.0" encoding="us-ascii"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" doctype-system="http://www.w3.org/TR/xhtml/DTD/xhtml1-strict.dtd" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" indent="yes"/> <xsl:template match="/REPORT"> <html> <head> <title><xsl:value-of select="TITLE"/></title> </head> <body> <xsl:apply-templates/> </body> </html> </xsl:template> <xsl:template match="SECTION"> <!-- TODO: sections can be nested --> <h1><xsl:value-of select="TITLE"/></h1> <xsl:apply-templates/> </xsl:template> <xsl:template match="PARA"> <p><xsl:apply-templates/></p> </xsl:template> </xsl:stylesheet> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|