xsl-list
[Top] [All Lists]

RE: [xsl] Re: XSL to ODF/OOXML

2007-10-25 14:36:52
If I'm understanding your intentions correctly, then try reading my
response again. You'll have to go two different routes for the HTML and
the OOXML outputs, but as I said, doing an identity transform on the XML
version of the HTML (I included the stylesheet below) should handle the
XML-to-HTML issues you're talking about.

And regular expressions would be much more complicated than you're
expecting; the processor does a surprising amount of markup processing
for HTML 4.01. (I've back-burnered a small project that involves
replicating method="html" via method="text"; it's complicated.)


Why are you trying to use the exact same output for OOXML and HTML?
There's something in this process that's not being communicated here;
please, try reading my previous response again. I thought I hit the key
points of method="html" there.

~ Scott

-----Original Message-----
From: Steve [mailto:subsume(_at_)gmail(_dot_)com] 
Sent: Thursday, October 25, 2007 4:07 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Re: XSL to ODF/OOXML

Hmm... I don't think this approach will work here. I did try to just
change the output to XML and everything seemed great. The problem of
course is the html version of my site broke. I wish I could think of
some XSL solution, whereby I could pass the transformation a variable
which would change the context to XML.

As ugly as it sounds, I almost think pattern matching / search and
replacing my HTML to death to make it XML is way simpler. I could just
strip errant tags out of it entirely.

-Steve

On 10/25/07, Scott Trenda <Scott(_dot_)Trenda(_at_)oati(_dot_)net> wrote:
But you're trying to transform that HTML output again? That seems to
be
your problem here - HTML isn't XML, so you can't use XSLT to do that.
However, since you are using an intermediary in the process (the HTML
document), you can do this. Transform the original file into HTML the
same way you're doing it now, but use <xsl:output method="xml"/>, and
store it in a temporary file or variable. When you need to output the
HTML report to the browser, run it through this stylesheet:

<stylesheet version="1.0"
xmlns="http://www.w3.org/1999/XSL/Transform";>
  <template match="@*|node()">
    <copy>
      <apply-templates select="@*|node()"/>
    </copy>
  </template>
</stylesheet>

Since the root element of your XML document is <html>, the XSLT
processor will determine that it should use <xsl:output
method="html"/>
in that stylesheet. Then, after you've decided what you want to do
with
your HTML result, you can still transform the intermediate XML
document
to any other format you'd like. (ODF, OOXML, etc)

~ Scott


-----Original Message-----
From: Steve [mailto:subsume(_at_)gmail(_dot_)com]
Sent: Thursday, October 25, 2007 3:21 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Re: XSL to ODF/OOXML

I can't do method="xml" because I need the stylesheet to output html
because its an html report. Does this matter? If so, workaround?

-Steve

On 10/25/07, Scott Trenda <Scott(_dot_)Trenda(_at_)oati(_dot_)net> wrote:
Robert's right here - are you using the literal stylesheet syntax to
convert it the first time around, like this?
<html xsl:version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  ... content ...
</html>

If so, the processor is automatically choosing <xsl:output
method="html"/>, because the root element of the result document has
a
name of "html". Expand that stylesheet out to its full syntax
(<xsl:stylesheet etc.), put in <xsl:output method="xml"/>, and you
should be fine.

~ Scott


-----Original Message-----
From: Robert Koberg [mailto:rob(_at_)koberg(_dot_)com]
Sent: Thursday, October 25, 2007 2:37 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Re: XSL to ODF/OOXML

Do you have an <xsl:output method="xml"/> ?


On Thu, 2007-10-25 at 14:34 -0400, Steve wrote:
I was noticing that.

What's strange is in my xsl these link tags are closed, however,
post-transform they are open. After all, these link tags are the
result of a transform so obviously they were compliant to begin
with.

Any idea why MSXML is doing this?

On 10/25/07, Robert Koberg <rob(_at_)koberg(_dot_)com> wrote:

On Thu, 2007-10-25 at 14:06 -0400, Steve wrote:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN">
<html xmlns:msxsl="urn:schemas-microsoft-com:xslt">
    <head>
         <META http-equiv="Content-Type" content="text/html;
charset=ISO-8859-15">
          <title>Database</title>
          <script
src="../master/Global/prototype-1.6.0_rc0.js"></script>

You might need the script like <script>//</script>

          <link rel="stylesheet" media="print"
href="../master/Global/print.css">

Maybe this was a typo, but you haven't closed the link...

best,
-Rob

     </head>
<body>
        .... blah blah ....
</body>
</html>




--~------------------------------------------------------------------
XSL-List info and archive:
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




--~------------------------------------------------------------------
XSL-List info and archive:
http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--