Although format is surely not to reside in data files, the XML Rec.
provides for character-level structural preservation, by means of the
special xml:space attribute. If the text is preformatted, your DTD should
declare this attribute as FIXED with the value "preserve" in the elements
in which this is desired (<ColorCode>, in your example).
This means, however, that you have to be extra careful and process the
spaces yourself in the stylesheets. For example, with spaces preserved, you
have not
> <ColorCode>
>         <Code>Red</code>
>         <Code>Blue</code>
>         <Code>Green</code>
> <ColorCode>
but
> <ColorCode><Code>Red</code>
><Code>Blue</code>
><Code>Green</code></ColorCode>
unless you want the extra spaces and the initial and ending line-feeds
included.
Preformatted text is not easy to process, and the XML file easily gets
unreadable without the indenting.
Cheers.
=============================================
Marcelo Jaccoud Amaral
Petrobrás (http://www.petrobras.com.br)
mailto:[EMAIL PROTECTED]
=============================================
There are only 10 kinds of people in the world: those who understand binary
and those who don't.



                                                                                
                               
                      Toufic Nehme                                              
                               
                      <[EMAIL PROTECTED]        Para:     [EMAIL PROTECTED]     
                          
                      adair.ca>                cc:                              
                               
                                               Assunto:  Re: preserve space     
                               
                      31/01/2003 10:30                                          
                               
                      Favor responder a                                         
                               
                      fop-user                                                  
                               
                                                                                
                               
                                                                                
                               




Roberto, I absolutely agree with you. But I don't have any control
over the xml file's structure.
I have this requirement on my desk and the guy who
wrote it out, does not have any idea about xml.
I tried to convince him, but it's very difficult to negociate
in a big organization.

Thank you anyway for the advice, and thanks to all who
gave a hint !!



"Calero, Roberto" wrote:

>
>
> "I need to output the text as it is formatted in the xml file."
> WRONG!!! The particular structure of the data in an XML file does not
> have anything to do with "format". To consider it as "format" is a
> misconception.
>
> Just my 2 cents...
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 31, 2003 3:47 PM
> To: [EMAIL PROTECTED]
> Subject: RE: preserve space
>
> Though I am not a Guru in this field, I suggest a small change in the
> xml structure
> as well as in the xsl.
> There may be other solutions. Decide which one would ease your
> building XML.
>
> XML:
> <ColorCode>
>         <Code>Red</code>
>         <Code>Blue</code>
>         <Code>Green</code>
> <ColorCode>
>
> XSL:
> <xsl:for-each select="ColorCode">
>         <fo:block>
>                 <xsl:value-of select="Code"/>
>         </fo:block>
> <xsl:for-each>
>
> -----Original Message-----
> From: Toufic Nehme [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 31, 2003 1:29 AM
> To: [EMAIL PROTECTED]
> Subject: preserve space
>
> Hi everyone,
> I have an element with formatted text inside an xml file.
> When I generate my pdf, all spaces, LF and CR are skipped
> in the fo:block.
> I need to output the text as it is formatted in the xml file.
> I tried with <xsl:preserve-space elements="ColorCode"/>
> in the xsl file, with space-treatment="preserve" in the
> fo:block also, but that didn't resolve the problem.
>
> exemple:
> <ColorCode>
>  Red
>  Green
>  Blue
> </ColorCode>
> my pdf shows:
>   Red Green Blue
> i need to see:
> Red
> Green
> Blue
>
> I would appreciate any help.
> Thanks.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED] For
> additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to