This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Stuck on meta-stylesheet problem


Thanks for pointing me in the right direction. The key was your reminding
me of the need to enclose strings in two sets of quotation marks to have
them interpreted correctly. I had done that with the other parameters
which worked correctly, but I had overlooked the one which was causing
a problem. I thought all would go smoothly after that, but naturally,
I've come up with a problem which seems truly strange to me.

In the first XSLT sheet ("meta stylesheet"), I have this tag which is
intended to be inserted into the second ("product stylesheet"):

<link rel="stylesheet" href="{$v_css}" type="text/css" media="screen"
style="display:none;" />

After the first transformation, this tag looks like this in the product
stylesheet:

<link rel="stylesheet" href="{$css}" type="text/css" media="screen"/>

Note that the space between the final quotation mark and the closing
backslash has disappeared. So far, so good, but after the second transformation,
this tag appears this way in the HTML document:

<link media="screen" type="text/css" href="http://my.eis.army.mil/pls/portal30/knellch.eis_CLOB.include_CSS?p_tableName=tbl_css_2&p_docName=sys_stat_edit&p_docVersion=1.0";
rel="stylesheet">

I couldn't display this in my browser (IE 6.0) because this created a
situation where I had an unclosed tag (notice that the closing backslash
has been swallowed) which didn't match the next closing tag, in this
case "</head>", and IE complained when I fed the stream of text to it
from a PL/SQL stored procedure.

I next grabbed the output from the first transformation and saved it
to a file. I took a file containing the xml data and performed the final
transformation to a third file using the XALAN parser. I inspected the
final HTML document, it too did not have the closing backslash in the
link tag, then opened it in the browser. This time, no complaint from
IE!

Now the meta stylesheet has its output method set to "xml" and the product
stylesheet has its output method set to "html". I can see where that
would permit an unclosed link tag in the final document, given the looseness
of HTML, but if I set it to "xml", then the processor (either XALAN or
the Oracle processor) converts <textarea></textarea> to <textarea />
and causes another set of problems.

I have tried replacing <link /> with <link></link>, but this is converted
to <link> in the final file. The only work-around so far is another kludge,
putting something between the opening and closing link tags. This preserves
the closing </link> tag and permits the display of the final transformation
in the browser directly from the stored procedure. The side effect is
that some unwanted text appears in my document. I have attempted to suppress
this with a style="display:none;" attribute in the <link> tag, but no
joy there.

Thanks for letting me rant, and I will gratefully receive suggestions.
-- 
Charles Knell
cknell@onebox.com - email


---- Jeni Tennison <jeni@jenitennison.com> wrote:
> Hi Charles,
> 
> > In order to get through the first transformation with my product
> stylesheet
> > parameter declarations intact, I pull this little kludge in the first
> > stylesheet:
> >
> >         <xsl:variable name="v_updateProc">$updateProc</xsl:variable>
> >         <xsl:variable name="v_canEdit"><xsl:copy-of
> > select="concat('{$','canEdit}')" /></xsl:variable>
> >         <xsl:variable name="v_script"><xsl:copy-of
> > select="concat('{$','script}')" /></xsl:variable>
> >         <xsl:variable name="v_css"><xsl:copy-of
> > select="concat('{$','css}')" /></xsl:variable>
> >         <xsl:variable name="v_class"><xsl:copy-of
> > select="concat('{$','class}')" /></xsl:variable>
> 
> Assuming you always treat these variables as strings (rather than as
> result tree fragments that you convert to node sets), these are
> exactly the same as:  

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]