Hi Murali,

You're mixing a couple of things up. For any input to be processed with an XSLT stylesheet, it must first of all by XML (that is: "well-formed" XML). If it it isn't well-formed, it cannot be processed (regardless of the application: any application that says it works with XML will only do so if it is well-formed).

Your input doesn't comply to the well-formed rules. The opening tag is not closed. The entities are not declared (it doesn't matter that they are inside a text block in some XSLT file, that is useless and won't make a source file compliant). One way to make the entities declared is by adding an html doctype. The best match, in your case, seems XHTML Transitional. Once you've declared it, you'll see that your "XML" (html) has some other oddities that make it invalid (i.e., a <table> tag inside a <p> tag, the <html> tag not closed, the <head> tag missing a <title> tag).

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>

If you would choose something else than XHTML (i.e., one of the older html variants), it is a lot harder to also make the document XML well-formed.

Once you get the source straightened out, you can try to process it with an XSLT processor (and possibly also an XSL-FO processor after that).

If you do not have the possibility to alter the source, then there are tools around that make an educated guess at what the errant designer of the HTML might have wanted and transforms it into XHTML on the fly. These tools (I forgot the name at the moment) try to mimic the behavior of popular browsers in interpreting any input and always outputting something (but this is of course a path that may very well lead to unpleasant surprises).

If you have question regarding XSLT or XSL-FO I can advice you to try the excellent XSLT list at http://www.mulberrytech.com/xsl/xsl-list/. This list is more appropriate for Apache FOP related questions.

HTH,
Cheers,
-- Abel Braaksma



Murali Krishna wrote:
Hi,
I am trying to to transform HtML to FO file using xalan but while transforming i am getting this following exception:- Exception in thread "main" java.lang.RuntimeException: The entity "nbsp" was referenced, but not declared. Actually the HTML file is generated by an editor .and contains lots and lots of &nbsp; In the XSL file , &lt;!ENTITY nbsp; "&amp;#160;"&gt; is already declared within the <xsl:text> tags .So, what should I do now.Please help! HTML and xsl files are attached with this mail. Thanks in anticipation, Murali Krishna


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

Reply via email to