[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Translating XSD into an XSLT, experts approach nee

Subject: RE: Translating XSD into an XSLT, experts approach needed
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Thu, 26 Feb 2004 09:26:26 -0000
xslt display all xml
One suggestion is to start with a fallback rule such as


<xsl:template match="*">
[<xsl:value-of select="name()"/>]
<xsl:apply-templates/>
[/<xsl:value-of select="name()"/>]
</xsl:template>

This will highlight in the output any elements for which you haven't yet
defined a rendition.

Then I would work top-down, i.e. starting with the elements nearest the top
of the hierarchy.

Another tip is to make use of CSS. Rather than generating HTML that defines
every detail of presentation, generate HTML making liberal use of <div> and
<span> elements whose detailed presentation is controlled by CSS.

Michael Kay

# -----Original Message-----
# From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx [mailto:owner-xsl-
# list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Daniel Bryant
# Sent: 25 February 2004 22:45
# To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
# Subject: RE:  Translating XSD into an XSLT, experts approach needed
# 
# Many Thanks for all the excellent feedback. To address some of the issues
# raised I would like to clarify the scenario I have been given:
# 
# At university we use Altova's StyleSheet Designer to design an XSLT. In
# order to generate the XSLT, an XSD is loaded into the program. One window
# displays the Schema in a tree structure where elements from the Schema can
# be dragged and dropped onto a page design window and positioned to create
# the desired HTML page layout. My project was conceived to provide the user
# with a facility to quickly create an XSLT stylesheet that displays the all
# of the data in an XML document in a simple format, using a potentially
# large
# XSD as a reference (and where the manual creation of an XSLT could be too
# time consuming). Specifically:
# 
# - I am attempting to automatically generate an XSLT style sheet that will
# render all the elements in an XML document as HTML (The XML instance
# document has already been created and does not have to be generated by the
# system). The visual display format is not pre-defined, and the output does
# not have to look good, just display all the data in the XML document as
# HTML.
# - Rather than automatically generating the XSLT from an XML instance
# document (which could potentially not contain every element defined in the
# schema i.e. if an element is optional) instead use the XSD as a reference
# to
# ensure every possible element has a template associated with it.
# - The generated XSLT can then be applied to any instance document to
# display
# the data contained within as HTML.
# 
# The main question I have is if you had to preform this task (generate an
# XSLT to display all elements, using the schema as a reference), how what
# technique would you use? Would you systematically work your way through
# the
# XSD creating a template for each element, or would you first extract
# certain
# elements?
# 
# I was also looking for any comments on the viability of such a project, or
# general XSLT construction techniques or problems that you think would
# prove
# tricky for such a system.
# 
# Many thanks to Michael and Andrew for clarifying the design of an XSLT
# should be driven by the output desired. This is a something I had
# overlooked
# in my previous email.
# 
# Once again many thanks for all the help.
# 
# Daniel Bryant
# 
# 
#  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.