Hi,
You should put formatting in the xml file.
So xml should look like
<Return_Address>
<name>xyz</name>
<street>101 avc</street>
</Return_Address>
Then apply fo formatting in xsl
<fo:block>
<fo:inline font-size="16px">
<fo:inline font-weight="bold">
<fo:inline font-family=" times new roman"><xsl:value-of
select="name"/>
</fo:inline>
</fo:inline>
</fo:inline>
</fo:block>
Thanks
From: Spoorthi Myneni [mailto:[email protected]]
Sent: 03 September 2013 21:43
To: [email protected]
Subject: html content in xml input file.
Hi All,
I am trying to generate PDF output using xml and xsl files as my input
files.
My input xml and xsl files are:
24_24177_Proof.xsl
24_24177_Recipient.xml
(I have attached them).
My xml file has a node where in I have CDATA like below:
<Return_Address>
<![CDATA[
<fo:block>
<fo:block>
<fo:inline font-size="16px">
<fo:inline font-weight="bold">
<fo:inline font-family=" times new roman">This is a smaple
text with bold.</fo:inline>
</fo:inline>
</fo:inline>
</fo:block>
<fo:block> </fo:block>
<fo:block>
<fo:inline font-size="16px">
<fo:inline font-family=" times new roman">
<fo:inline font-style="italic">This is a sample text with
Italic.</fo:inline>
</fo:inline>
</fo:inline>
</fo:block>
<fo:block> </fo:block>
<fo:block>
<fo:inline font-size="16px">
<fo:inline font-family=" times new roman">
<fo:inline text-decoration="underline">This is a sample
text with underline.</fo:inline>
</fo:inline>
</fo:inline>
</fo:block>
</fo:block>
]]>
</Return_Address>
I have run the below command and generated an fo file using the
24_24177_Proof.xsl and 24_24177_Recipient.xml file.
fop -xml "C:\Users\spoorthi\Desktop\24_24177_Reciepients.
xml" -xsl "C:\Users\spoorthi\Desktop\24_24177_Proof.XSL" -foout
"C:\Users\spoort
hi\Desktop\24_24177_Proof.fo"
and then Generated pdf file using the above created fo file using the
following command.
fop -fo "C:\Users\spoorthi\Desktop\24_24177_Proof.fo" -pd
f "C:\Users\spoorthi\Desktop\24_24177_FoOutput.pdf" -c fop.xconf
My 24_24177_FoOutput.pdf gets the formatting of the content in the xml
correctly.
But when I directly use the -xml and -xsl files as input and generate the
pdf file as ouput then the formatting of the text is not retained.
I have used the following command and the output file is 24_24177_Proof.pdf
fop -xml "C:\Users\spoorthi\Desktop\24_24177_Reciepients.
xml" -xsl "C:\Users\spoorthi\Desktop\24_24177_Proof.XSL" -pdf
"C:\Users\spoorthi
\Desktop\24_24177_Proof.pdf" -c fop.xconf
Can someone explain me on why it doesnot retain the formatting in the
second case(using xml and xsl as input and generating pdf as output)?
and I would like to know what else I need to include in order to get the
formatting in the second case.
I have attached all the files in the mail, for your reference.
I have many instances like this for which I need this to work, any advice
will be appreciated a lot.
Thank you in advance.
-Spoorthi