XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Formatting XML as ascii Text

The "Ideal" solution would be to take advantage of the font 
charactoristics of the device, plug that into the processr and have it used
to word wrap at a pixel width.  (for reference I'm refering to 'legacy' 
Palm, PPC and blackberry devices using the system font).
But if thats too hard, even coming close with a charactor-count width 
would work but wouldnt produce as good results.
In particular I'm not sure how to do the tables at all with 
character-count instead of using the font metrics.
In another part of the product we solve this part by forcing tables into 
a fixed width font.  I'm not sure that the piece of code I need to shove 
this data supports fixed width intermixed with variable width.




David A. Lee
dlee@calldei.com  
http://www.calldei.com
http://www.xmlsh.org
812-482-5224



Mike Sokolov wrote:
> That's an interesting problem: I'm confused about the wrapping 
> requirement though.  Do you need to wrap at a given number of 
> characters (sounded like 40?) or a pixel (or inch) width?  Your 
> comment about the variable-width font makes it sound like you are 
> printing or displaying on screen with a particular font.  It's 
> obviously much simpler if you don't have to worry about fonts, 
> variable character widths, vagaries of printer drivers and the like.
>
> -Mike
>
> David A. Lee wrote:
>> I have a project where I need to take XML and format it as ascii text.
>> Sounds simple right ? But alas the requirements are subtle.  It seems 
>> people dont do text formatting much anymore.
>> I fondly remember the days of nroff where I could do good text 
>> formatting and achieve things like word splitting (hyphenating),
>> justification etc on text content.  In particular a challenge is to 
>> support multi column tables.  Thats right, text spanning 5 columns,
>> that needs to wrap in each column.   Oh and do that with 40 column 
>> line widths. Piece of cake.
>> Oh and its a Variable width text font ... ha !
>>
>> What I tried so far which almost works sorta, just enough to not work 
>> well enough :)
>> Translate the XML to HTML with XSLT then I downloaded one of the free 
>> "HTML to Text" tools which are prevalent on the net.
>> It sorta did work, except for the tables.   But I need something that 
>> can work in a production environment.   Open Source is prefered,
>> but if it does an excellent job then a commercial product could be 
>> justified (pun intended).
>>
>> My next attempt will to try Apache FOP.    I looked at RenderX but 
>> they dont claim text output.
>> Apache FOP claims a text output but with caveots, the claim is its 
>> not robust code with poor results.
>> Maybe they are being kind and it really works great.   I will try.
>>
>> Any other suggestions ?   I can always 'roll my own' but this project 
>> is not on the budget yet and were trying to see if we can do 
>> something with minimal work.
>> Appreciated,
>>
>> thanks,
>>
>>
>>
>>
>
> _______________________________________________________________________
>
> XML-DEV is a publicly archived, unmoderated list hosted by OASIS
> to support XML implementation and development. To minimize
> spam in the archives, you must subscribe before posting.
>
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
> subscribe: xml-dev-subscribe@lists.xml.org
> List archive: http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS