You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Spoorthi Myneni <sp...@gmail.com> on 2013/09/03 22:42:56 UTC

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

Re: html content in xml input file.

Posted by Pascal Sancho <ps...@gmail.com>.
Hi,

This is not a FOP related question, but an XML/XSLT one.

That said, unless you have a strict DTD that prevent to add alternate
namespace xml in your xml source, you don't need to put your FO
snippet in a CDATA section.

then, in your XSLT, you just need to use a xsl:copy-of rather than a
xsl:value-of[@disable-output-escaping="yes"]

2013/9/3 Spoorthi Myneni <sp...@gmail.com>:
> 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
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org



-- 
pascal

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


RE: html content in xml input file.

Posted by Simon Steiner <si...@gmail.com>.
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:spoorthi.myneni1@gmail.com] 
Sent: 03 September 2013 21:43
To: fop-users@xmlgraphics.apache.org
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