Subject: Re: [xsl] Elements within "as-is" environment misaligning From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Tue, 11 Dec 2007 16:21:22 -0500 |
I hope that helps, Wendell
Hi-
I am experiencing problems when transforming sections of "as-is" code. I have an element which contains a sample of programming code within it. Within the code sample I have some additional elements I call <codeFocus> which will highlight that part of the code when it is formatted. During the XSL-FO transform, the alignment around these <codeFocus> elements gets messed up. The first one seems fine but then the 2nd one has an extra blank line that appears before it starts and the start tag is shifted over to the right (so it is no longer "as-is").
I am using a Saxon parser and version 1.0. I use Antenna House for the FO formatting but the problem occurs before the doc is formatted.
My XML input: <code>Dim obConnection As New ADODB.Connection Dim obRecordset As New ADODB.Recordset
<codeFocus>obConnection.Provider = "SAS.IOMProvider.1"</codeFocus> <codeFocus>obConnection.Properties("Prompt") = adPromptAlways</codeFocus> obConnection.Open
obRecordset.Open "sasuser.MyData", obConnection, adOpenDynamic, adLockOptimistic, adCmdTableDirect ' Operate on obRecordset. </code>
My FO output (note the blank line between the 2 fo:inline and how the 2nd one indents in now): <fo:block font-family="'Courier Standard', 'monospace', 'Arial Unicode MS' " font-size="8.5pt" font-stretch="90%" line-height="12pt" start-indent="93pt+15pt" linefeed-treatment="preserve" white-space-treatment="preserve" white-space-collapse="false" wrap-option="no-wrap" space-before="6pt" space-after="0pt">Dim obConnection As New ADODB.Connection Dim obRecordset As New ADODB.Recordset
<fo:inline background-color="rgb(235, 235, 235)" padding-left="2pt" padding-right="2pt">obConnection.Provider = "SAS.IOMProvider.1"</fo:inline>
<fo:inline background-color="rgb(235, 235, 235)" padding-left="2pt" padding-right="2pt">obConnection.Properties("Prompt") = adPromptAlways</fo:inline> obConnection.Open
obRecordset.Open "sasuser.MyData", obConnection, adOpenDynamic, adLockOptimistic, adCmdTableDirect ' Operate on obRecordset. </fo:block>
I did notice that if I type a letter before the 2nd <codeFocus> element, it works fine and doesn't insert the extra line or shift over.
I even tried defining my xsl:template on a line by itself as not to get any carriage returns: <xsl:template match="codeFocus"><fo:inline background-color="rgb(235, 235, 235)" padding-left="2pt" padding-right="2pt"><xsl:apply-templates/></fo:inline></xsl:template>
Does anyone have any ideas to prevent this from happening?
Any suggestions appreciated, Cindy Hunt
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Elements within "as-is" e, Michael Kay | Thread | RE: [xsl] Elements within "as-is" e, Cindy Hunt |
RE: [xsl] Elements within "as-is" e, Michael Kay | Date | Re: [xsl] Merging an dynamic set of, Martin Heiden |
Month |