Search the web
Sign In
New User? Sign Up
XSL-FO · discussion of XSL Formatting Objects
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
xml string node to xsl:fo   Message List  
Reply | Forward Message #7416 of 7443 |
Re: [XSL-FO] xml string node to xsl:fo

At 2007-10-15 11:09 +0000, astragh wrote:
>Hi to the forum,
>
>We currently use xsl fo for styling our xml.
>Our application takes user submitted content and adds it to our
>database where we then extract this content and transform it into an
>xml tree. This is then forwarded to our .xsl file and then produces
>the PDF.

Sounds good so far!

>We would like to allow our application to accept html tags using a
>wysiwyg module above the textarea where the client can then format
>their descriptions with various tags i.e. <b>, <i>, <ul> etc.

Fine .... but I'm guessing this process does not mandate the "proper"
use of element start and end tags (nesting, completion, etc.).

>This works ok when the user is forwarded to the next JSP page all
>formatting is saved to the database and displayed correctly, further
>calls to display this page gets the information from the database and
>again displays all information.

Right ... because HTML browsers are forgiving of discrepancies that
would otherwise be considered errors in a well-formedness check. Any
mess entered by the users is acceptable to the end processing in the
browser client.

>The problem is when we request this
>view in the PDF format XSL can't handle the html tags. Is there a way
>that I can make the request to the database during, after or before
>we process our XML tree and swap out the html tags with xsl? And
>would this work?

Do you have the opportunity in the process to run "tidy"? This is an
open tool that converts tag soup into XML, which is then suitable for XSLT:

http://tidy.sourceforge.net/

The only input to XSLT is well-formed XML and this would give it to
you. HTML of any SGML flavour (messy or not messy) is
unacceptable. XHTML is acceptable, but then you wouldn't be having
any problems because it would be well-formed.

The painful alternative is to use XSLT 2.0 (which isn't painful),
read in the HTML fragments as a text string, and to do your own
string analysis in a piecemeal fashion to reconstruct the structure
from the mess of tag soup from the user. Not at all pleasant, but doable.

>Sorry if this is a little brief I have just inherited the project and
>only starting to make some ground on the understanding. And I am a
>total newbie to this :(

Have fun!

. . . . . . . . . . Ken

--
Comprehensive in-depth XSLT2/XSL-FO1.1 classes: Austin TX,Jan-2008
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds: publicly-available developer resources and training
G. Ken Holman mailto:gkholman@...
Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
Male Cancer Awareness Jul'07 http://www.CraneSoftwrights.com/f/bc
Legal business disclaimers: http://www.CraneSoftwrights.com/legal




Mon Oct 15, 2007 1:15 pm

g_ken_holman
Offline Offline
Send Email Send Email

Forward
Message #7416 of 7443 |
Expand Messages Author Sort by Date

Hi to the forum, We currently use xsl fo for styling our xml. Our application takes user submitted content and adds it to our database where we then extract...
astragh
Offline Send Email
Oct 15, 2007
11:10 am

... Sounds good so far! ... Fine .... but I'm guessing this process does not mandate the "proper" use of element start and end tags (nesting, completion,...
G. Ken Holman
g_ken_holman
Offline Send Email
Oct 15, 2007
1:16 pm

Hi Ken, Firstly thanks so much for taking the time out to reply to my issue. ... the "proper" use of element start and end tags (nesting, completion, etc.). We...
astragh
Offline Send Email
Oct 15, 2007
2:10 pm

... Perhaps even easier Ken, http://ccil.org/~cowan/XML/tagsoup/ links a variant of tidy into Saxon, so that the html can be processed in Saxon as if it were...
Dave Pawson
dpawson2000
Offline Send Email
Oct 15, 2007
2:33 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help