[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fop-user
Subject:    Re: Normalizing space and special spaces
From:       Maria2009 <maria () shinoto ! de>
Date:       2009-03-31 1:11:22
Message-ID: 22796447.post () talk ! nabble ! com
[Download RAW message or body]


Hi,

just to report the solution: 

"normalize-space" does not trim space inside elements, only between
elements, so it did not work. But it is possible to count the text nodes in
elements with mixed content: 

"(text())[1]" 

e.g. for the first node in mixed content. Then it is easy to manipulate the
last or first characters in the nodes according to the elements following. 

Thanks for all ideas, 
Maria 






Maria2009 wrote:
> 
> Hi Andreas, 
> 
> Thanks again. I tried this earlier, but the outcome was not what I
> envisaged (it varied, but that may be due to some other uncertainties at
> that stage...). So I will try this route again, and when I found a
> solution, will report. 
> 
> I appreciate your help, particular since this was not really a FO question
> ;).
> 
> Cheers, 
> Maria
> 
> 
> 
> Andreas Delmelle-2 wrote:
> > 
> > On 26 Mar 2009, at 02:07, Maria2009 wrote:
> > 
> > Hi Maria
> > 
> > > <snip />
> > > If anybody has a hint of how to get create a unified original  
> > > document from
> > > these different options, I will be happy. I thought of adressing these
> > > points (spaces before and after element tags) with XPointer or  
> > > RegEx, so if
> > > there is an advice about which one to use, I will start learning this
> > > technique at first. Or anything else if necessary!
> > 
> > Just an idea, but the first thing to try:
> > If the value comes with a trailing space from the source XML, then  
> > using something like
> > 
> > <xsl:value-of select="normalize-space(.)" />
> > 
> > should remove leading/trailing spaces, and output only the significant  
> > content of the descendant text-node. For white-space-only nodes, the  
> > above will yield a zero-length string.
> > 
> > If you have no parts in the source XML where white-space/linefeeds  
> > should be preserved, you could even use the above as the default  
> > matching template for 'text()'. That is likely to be the most  
> > straightforward solution to your issue. No pre-processing of the FO  
> > needed, I think...
> > 
> > 
> > HTH!
> > 
> > Andreas
> > 
> > ...
> > 
> 
> 

-- 
View this message in context: \
http://www.nabble.com/Normalizing-space-and-special-spaces-tp22678087p22796447.html \
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic