xsl-list
[Top] [All Lists]

RE: RE: XML/XSLT to HTML output

2002-09-18 10:16:13
                The business issue is that the Customer Service
Representative will click a link that points to the XML document(which
contains the data for the report) and the XML document points to my XSL
stylesheet(s) which render the XML document and display the output in the
browser.  The output in the browser shows the marked-up XML document
correctly and looks like an HTML document.  The Customer Service
Representative wants to be able to save this file and email it.  When you
try to save the file, it saves it as an XML document so of course they lose
all the markup.  I use XML-Spy as an XML editor, and when I apply my XSL
transformation to the XML document, it shows it as an html document and
keeps my html tags and so it can be saved as an html document.  But when
transformed in the browser, the file cannot be saved as an html document,
and so the report is useless to the Customer Service Representative as an
xml document.  Is this a browser issue?  What is the purpose of the
<xsl:output method="html"/> when I.E. 6.0 is used, since it seems to ignore
this anyway.  Im also aware this is an implicit stylesheet tag and even if I
left it out, it should default to html anyway.  
                Here is a tested example (Not my report):
                Here is the stylesheet:
                <?xml version="1.0" encoding="UTF-8"?>
                <xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

                        <xsl:template match="poem">
                                <html>
                                        <body>
                                                <xsl:apply-templates/>
                                        </body>
                                </html>
                        </xsl:template>
                        <xsl:template match="title">
                                <h1>
                                        <xsl:apply-templates/>
                                </h1>
                        </xsl:template>
                </xsl:stylesheet>

                Here is the xml document:
                <?xml version="1.0" encoding="UTF-8"?>
                <?xml-stylesheet type="text/xsl" href="C:\Documents and
Settings\a10037\My Documents\TESTER.xsl"?>
                <poem>
                        <title>this is a test</title>
                </poem>

                Here is the transformed output result using XML-Spy:(This is
what Im trying to get with the browser)
                <html>
                        <body>
                                <h1>this is a test</h1>
                        </body>
                </html>

                This result is what I want to see in the browser.  But using
the same stylesheet & xml document, this is the browser result:
                <?xml version="1.0" encoding="UTF-8"?>
                <?xml-stylesheet type="text/xsl" href="C:\Documents and
Settings\a10037\My Documents\TESTER.xsl"?>
                <poem>
                        <title>this is a test</title>
                </poem>

                Notice I lose all my html markup....Is there a solution to
this???

                Michael D. Croft
                I.T.  Developer
                Amica Insurance
                (800) 24.AMICA ext. 4918
                (401) 334.1634 fax
                mcroft(_at_)Amica(_dot_)com

                                -----Original Message-----
                                From:   Kirk Allen Evans
[mailto:kaevans(_at_)xmlandasp(_dot_)net]
                                Sent:   Wednesday, September 18, 2002 11:41
AM
                                To:     
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
                                Subject:        RE: [xsl] RE: 

                                The source is actually the XML file, so it
is showing you the correct
                                listing.  However, you can download a
utility add-on for IE that will
                                allow you to look at the output of the
transformation [1].  The utility
                                is called "Internet Explorer Tools for
Validating XML and Viewing XSLT
                                Output."

                                [1]
        
http://msdn.microsoft.com/downloads/sample.asp?url=/msdn-files/027/000/5
                                43/msdncompositedoc.xml&frame=true


                                Kirk Allen Evans
                                http://www.xmlandasp.net
                                Author, "XML And ASP.NET", New Riders
Publishing
        
http://www.amazon.com/exec/obidos/ASIN/073571200X

                                > -----Original Message-----
                                > From:
owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com [mailto:owner-xsl-
                                > list(_at_)lists(_dot_)mulberrytech(_dot_)com] 
On Behalf Of
CROFT, MICHAEL
                                > Sent: Wednesday, September 18, 2002 11:14
AM
                                > To: 
'xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com'
                                > Subject: [xsl] RE:
                                > 
                                >               When the browser renders the
XML document using my XSLT
                                > stylesheet, the report displays
successfully in the browser, and then
                                you
                                > select view source on the browser, it only
displays the XML document.
                                It
                                > is
                                > not outputting my html tags.  It is a .xml
file, not a .html file.
                                > 
                                >               Mike
                                > 
                                >
-----Original Message-----
                                >                               From:
David Carlisle
                                > [mailto:davidc(_at_)nag(_dot_)co(_dot_)uk]
                                >                               Sent:
Wednesday, September 18, 2002
                                10:26
                                > AM
                                >                               To:
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
                                >                               Subject:
                                > 
                                > 
                                >                               >       Does
anyone know how to have the
                                I.E
                                > 6.0 browser output a
                                >                               > rendered
XML document using XSLT as an
                                > HTML document.
                                > 
                                >                               that's what
it does. (What do you mean
                                by
                                > "output" though in
                                >                               the case of
a browser?)
                                > 
                                >                               >
                                >
xmlns:fo="http://www.w3.org/1999/XSL/Format";>
                                >                               you don't
appear to need to declare the
                                FO
                                > namespace in this stylesheet
                                > 
                                > 
                                >                               This isn't
needed as it will already be
                                the
                                > default as the top level
                                >                               element is
html.
                                >
<xsl:output
                                method="html"/>
                                > 
                                > 
                                >                               David
                                > 
                                > 
                                >
_____________________________________________________________________
                                >                               This message
has been checked for all
                                known
                                > viruses by Star Internet
                                >                               delivered
through the MessageLabs Virus
                                > Scanning Service. For further
                                >                               information
visit
                                > http://www.star.net.uk/stats.asp or
alternatively call
                                >                               Star
Internet for details on the Virus
                                > Scanning Service.
                                > 
                                >                                XSL-List
info and archive:
                                > http://www.mulberrytech.com/xsl/xsl-list
                                > 
                                > 
                                >
**********************************************************************
                                > This email and any files transmitted with
it are confidential and
                                > intended solely for the use of the
individual or entity to whom they
                                > are addressed. If you have received this
email in error please notify
                                > the sender and 
postmaster(_at_)amica(_dot_)com(_dot_)
                                >
**********************************************************************
                                > 
                                > 
                                > 
                                >  XSL-List info and archive:
http://www.mulberrytech.com/xsl/xsl-list
                                > 




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

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



<Prev in Thread] Current Thread [Next in Thread>