You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by tt...@charter.net on 2002/01/26 03:32:32 UTC

Clueless Newbie is lost!

Folks,
I am writing a textbook on HTML, and want to
include a chapter on XML.  I am trying to get the
following code (DocBook) to generate a PDF file. 
 After a LONG struggle I managed to 
xsltproc to use my XML and get the HTML to
render...but the PDF eludes me.  Can y'all see
anything wrong with the following code?

When it is generated, 
by someone who knows what he is doing,
the block quote stuff just
disappears...the cite stuff renders
just fine???

What I am trying to do is simply show my
student/readers how XML can be used.
I have spent over 70 hours trying different
software to no avail.  Ideas welcome!
What I really need is a reliable tool-chain
to take XML and generate HTML, PDF,
and maybe one other format that I could
capture and show the students.  

Can anyone help?????

Thanks in advance!

tim

<?xml version="1.0"?>
<!DOCTYPE article  SYSTEM "./docbookx.dtd">
<article>
<title>There and Back Again</title>
<artheader>
<author>
<firstname>Bilbo</firstname>
<surname>Baggins</surname>
</author>
<pubdate>Long Ago</pubdate>
</artheader>
<para>
<abbrev>LOTR</abbrev> stands for Lord of the Rings.
In this paragaraph we could discuss
the intricate details of the construction
of a most proper hole in the ground.
</para>
<bridgehead>Now, a wonderful quote!</bridgehead>
<para>
<blockquote>
There were many paths that lead up into those
mountains, and many passes over them.  But most
of the paths were cheats and deceptions and
lead nowhere or to bad ends; and most of the
passes were infested by evil things and
dreadful danger.
<citation>Page 64 of
<citetitle>The Hobbit</citetitle>
by J. R. R. Tolkin</citation>
</blockquote>
</para>
</article>



---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Generating output from XML was Re: Clueless Newbie is lost!

Posted by ewitness - Ben Fowler <bf...@ewitness.co.uk>.
>Thierry,
>I guess I am so new to this that I don't
>know what you mean by formatting?  I thought
>that XML was formatless (if that is a word), in that
>the DTD and the style sheets did all the formatting?

Not the DTD (which is optional for XML), and provides
constraints for an xml file.

Yes, a stylesheet is needed for formatting (though in fact
a style sheet can do any transformation).

I wouldn't describe XML as formatless. XML, I would say,
is format agnostic, in that it can exist without
any presentational elements or attributes at all, or it
can have full formatting information as an .fo file
does.

The usual elementary XML book recommendation is the chick
book, which is reviewed here
<URL: http://training.gbdirect.co.uk/book_reviews/learning_xml_review.html >,
you want to have a glance through the whole of it, because
the author seemed to run out of steam (or pages) at around
the point that he got to the areas we are discussing; but
the early chapters are so good, that you may not feel that
this is a problem.

If you check through some of the current discussions on the
XML list, you will see that the ability to write XML,
like the ability to write in plain text, depends on having
something worth saying, and knowing how to say it. It is
not a magic bullet.

Ben.

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Clueless Newbie is lost!

Posted by Matt Savino <ma...@synergizethis.com>.
The general path is to convert XML->FO via XSLT, then run FOP on the FO
file. FO is XML, but it contains much more than just the data, so it
ends up looking more like HTML. See the FOP examples.

Hope I'm interpreting the problem right!

-Matt

ttg@charter.net wrote:
> 
> Thierry,
> I guess I am so new to this that I don't
> know what you mean by formatting?  I thought
> that XML was formatless (if that is a word), in that
> the DTD and the style sheets did all the formatting?
> This is just about the most simple example I could
> come up with that would render *something* in
> HTML.  (Besides the quote is special to me.)
> I couldn't get a PDF version to work with any
> fop tool...most of the tools didn't work either.
> That is the problem.  I would like to use the
> same code to generate HTML, PDF, and maybe
> another type of output that I could capture for the
> book, and show the student/readers the beauty of
> XML, write it once display it on many platforms.
> 
> tim
> 1/29/02 5:42:10 AM, Thierry Gounelle <th...@cgey.com>
> wrote:
> 
> >Hi tim,
> >I don't see any formating code in your post, just an xml source file.
> >Could you be more precise.
> >
> >thierry
> >
> >ttg@charter.net wrote:
> >
> >> Folks,
> >> I am writing a textbook on HTML, and want to
> >> include a chapter on XML.  I am trying to get the
> >> following code (DocBook) to generate a PDF file.
> >>  After a LONG struggle I managed to
> >> xsltproc to use my XML and get the HTML to
> >> render...but the PDF eludes me.  Can y'all see
> >> anything wrong with the following code?
> >>
> >> When it is generated,
> >> by someone who knows what he is doing,
> >> the block quote stuff just
> >> disappears...the cite stuff renders
> >> just fine???
> >>
> >> What I am trying to do is simply show my
> >> student/readers how XML can be used.
> >> I have spent over 70 hours trying different
> >> software to no avail.  Ideas welcome!
> >> What I really need is a reliable tool-chain
> >> to take XML and generate HTML, PDF,
> >> and maybe one other format that I could
> >> capture and show the students.
> >>
> >> Can anyone help?????
> >>
> >> Thanks in advance!
> >>
> >> tim
> >>
> >> <?xml version="1.0"?>
> >> <!DOCTYPE article  SYSTEM "./docbookx.dtd">
> >> <article>
> >> <title>There and Back Again</title>
> >> <artheader>
> >> <author>
> >> <firstname>Bilbo</firstname>
> >> <surname>Baggins</surname>
> >> </author>
> >> <pubdate>Long Ago</pubdate>
> >> </artheader>
> >> <para>
> >> <abbrev>LOTR</abbrev> stands for Lord of the Rings.
> >> In this paragaraph we could discuss
> >> the intricate details of the construction
> >> of a most proper hole in the ground.
> >> </para>
> >> <bridgehead>Now, a wonderful quote!</bridgehead>
> >> <para>
> >> <blockquote>
> >> There were many paths that lead up into those
> >> mountains, and many passes over them.  But most
> >> of the paths were cheats and deceptions and
> >> lead nowhere or to bad ends; and most of the
> >> passes were infested by evil things and
> >> dreadful danger.
> >> <citation>Page 64 of
> >> <citetitle>The Hobbit</citetitle>
> >> by J. R. R. Tolkin</citation>
> >> </blockquote>
> >> </para>
> >> </article>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> >> For additional commands, email: fop-dev-help@xml.apache.org
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> >For additional commands, email: fop-dev-help@xml.apache.org
> >
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Clueless Newbie is lost!

Posted by tt...@charter.net.
Thierry,
I guess I am so new to this that I don't
know what you mean by formatting?  I thought
that XML was formatless (if that is a word), in that
the DTD and the style sheets did all the formatting?
This is just about the most simple example I could
come up with that would render *something* in
HTML.  (Besides the quote is special to me.) 
I couldn't get a PDF version to work with any
fop tool...most of the tools didn't work either.
That is the problem.  I would like to use the
same code to generate HTML, PDF, and maybe
another type of output that I could capture for the
book, and show the student/readers the beauty of
XML, write it once display it on many platforms.

tim
1/29/02 5:42:10 AM, Thierry Gounelle <th...@cgey.com> 
wrote:

>Hi tim,
>I don't see any formating code in your post, just an xml source file.
>Could you be more precise.
>
>thierry
>
>ttg@charter.net wrote:
>
>> Folks,
>> I am writing a textbook on HTML, and want to
>> include a chapter on XML.  I am trying to get the
>> following code (DocBook) to generate a PDF file.
>>  After a LONG struggle I managed to
>> xsltproc to use my XML and get the HTML to
>> render...but the PDF eludes me.  Can y'all see
>> anything wrong with the following code?
>>
>> When it is generated,
>> by someone who knows what he is doing,
>> the block quote stuff just
>> disappears...the cite stuff renders
>> just fine???
>>
>> What I am trying to do is simply show my
>> student/readers how XML can be used.
>> I have spent over 70 hours trying different
>> software to no avail.  Ideas welcome!
>> What I really need is a reliable tool-chain
>> to take XML and generate HTML, PDF,
>> and maybe one other format that I could
>> capture and show the students.
>>
>> Can anyone help?????
>>
>> Thanks in advance!
>>
>> tim
>>
>> <?xml version="1.0"?>
>> <!DOCTYPE article  SYSTEM "./docbookx.dtd">
>> <article>
>> <title>There and Back Again</title>
>> <artheader>
>> <author>
>> <firstname>Bilbo</firstname>
>> <surname>Baggins</surname>
>> </author>
>> <pubdate>Long Ago</pubdate>
>> </artheader>
>> <para>
>> <abbrev>LOTR</abbrev> stands for Lord of the Rings.
>> In this paragaraph we could discuss
>> the intricate details of the construction
>> of a most proper hole in the ground.
>> </para>
>> <bridgehead>Now, a wonderful quote!</bridgehead>
>> <para>
>> <blockquote>
>> There were many paths that lead up into those
>> mountains, and many passes over them.  But most
>> of the paths were cheats and deceptions and
>> lead nowhere or to bad ends; and most of the
>> passes were infested by evil things and
>> dreadful danger.
>> <citation>Page 64 of
>> <citetitle>The Hobbit</citetitle>
>> by J. R. R. Tolkin</citation>
>> </blockquote>
>> </para>
>> </article>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
>> For additional commands, email: fop-dev-help@xml.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
>For additional commands, email: fop-dev-help@xml.apache.org
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: Clueless Newbie is lost!

Posted by Thierry Gounelle <th...@cgey.com>.
Hi tim,
I don't see any formating code in your post, just an xml source file.
Could you be more precise.

thierry

ttg@charter.net wrote:

> Folks,
> I am writing a textbook on HTML, and want to
> include a chapter on XML.  I am trying to get the
> following code (DocBook) to generate a PDF file.
>  After a LONG struggle I managed to
> xsltproc to use my XML and get the HTML to
> render...but the PDF eludes me.  Can y'all see
> anything wrong with the following code?
>
> When it is generated,
> by someone who knows what he is doing,
> the block quote stuff just
> disappears...the cite stuff renders
> just fine???
>
> What I am trying to do is simply show my
> student/readers how XML can be used.
> I have spent over 70 hours trying different
> software to no avail.  Ideas welcome!
> What I really need is a reliable tool-chain
> to take XML and generate HTML, PDF,
> and maybe one other format that I could
> capture and show the students.
>
> Can anyone help?????
>
> Thanks in advance!
>
> tim
>
> <?xml version="1.0"?>
> <!DOCTYPE article  SYSTEM "./docbookx.dtd">
> <article>
> <title>There and Back Again</title>
> <artheader>
> <author>
> <firstname>Bilbo</firstname>
> <surname>Baggins</surname>
> </author>
> <pubdate>Long Ago</pubdate>
> </artheader>
> <para>
> <abbrev>LOTR</abbrev> stands for Lord of the Rings.
> In this paragaraph we could discuss
> the intricate details of the construction
> of a most proper hole in the ground.
> </para>
> <bridgehead>Now, a wonderful quote!</bridgehead>
> <para>
> <blockquote>
> There were many paths that lead up into those
> mountains, and many passes over them.  But most
> of the paths were cheats and deceptions and
> lead nowhere or to bad ends; and most of the
> passes were infested by evil things and
> dreadful danger.
> <citation>Page 64 of
> <citetitle>The Hobbit</citetitle>
> by J. R. R. Tolkin</citation>
> </blockquote>
> </para>
> </article>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


DocBook XML->FO, getting started was Re: Clueless Newbie is lost!

Posted by ewitness - Ben Fowler <bf...@ewitness.co.uk>.
Assuming you really are a 'Newbie', you will profit
from reading the famous 'Choosing good subject lines'
post, archived here
<URL: http://www.perl.com/CPAN-local/authors/Dean_Roehrich/subjects.post >,
and won't be offended by my pointing you to it.

Assuming you really are Clueless (which is an insult
on my side of the Atlantic), I guess that you have perused
Phil Greenspun's site on technical book authoring, and
someone other than yourself has determined that the World
needs yet another book on HTML.
<URL: http://philip.greenspun.com/wtr/dead-trees/story.html >

>Folks,
>I am writing a textbook on HTML, and want to
>include a chapter on XML.

People who are 'switched on', and ready to write sites
based on their information content should already be
using  XML, in the form of the W3C XHTML. Indeed, you
might be able to find evidence that HTML 4.0 is entering
'End Of Life'. I hope that this chapter was the first
chapter of your forthcoming book.
<URL: 
http://www2.widener.edu/Wolfgram-Memorial-Library/webevaluation/inform.htm >


>  I am trying to get the
>following code (DocBook) to generate a PDF file.
>  After a LONG struggle I managed to
>xsltproc to use my XML and get the HTML to
>render...but the PDF eludes me.  Can y'all see
>anything wrong with the following code?
>
>When it is generated,
>by someone who knows what he is doing,
>the block quote stuff just
>disappears...the cite stuff renders
>just fine???
>
>What I am trying to do is simply show my
>student/readers how XML can be used.
>I have spent over 70 hours trying different
>software to no avail.  Ideas welcome!
>What I really need is a reliable tool-chain
>to take XML and generate HTML, PDF,
>and maybe one other format that I could
>capture and show the students.

I can't answer precisely the question on the tool
chain. In the case of SGML, the identical operation is
typically done by jade
<URL: http://openjade.sourceforge.net/doc/index.htm >

(Note: It is a couple of years since I last looked at
jade, and it has moved on a fair bit. It is possible
jade might in fact do what you want, but I doubt it).

I believe that cocoon
<URL: http://xml.apache.org/cocoon/index.html >
will simultanenously produce (amongst other things)
PDF, HTML and RTF - this is probably what you want.
Furthermore, cocoon runs inside the apache web server,
which ties in with the topic of your book

>Can anyone help?????
>
>Thanks in advance!
>
>tim
>
><?xml version="1.0"?>
>    ... [ snip ]

I am using the docbook that came with the Duck book,
which is version 315. This is possibly too old for
serious work.

When I attempted to validate your document, I got this
(one) error.

	XML-Validity: Your XML is a well-formed document, but it
	conflicts with the DTD:

	Element 'blockquote' (<blockquote> There were many paths
	that lead up into those mountains, aŠ)   didn't contain the
	element 'beginpage', which it should have done.

	DTD constraint: <!ELEMENT blockquote (title?, attribution?,
	(calloutlist | glosslist | itemizedlist | orderedlist |
	segmentedlist | simplelist | variablelist | caution |
	important | note | tip | warning | literallayout |
	programlisting | programlistingco | screen | screenco |
	screenshot | synopsis | cmdsynopsis | funcsynopsis |
	formalpara | para | simpara | address | blockquote | graphic
	| graphicco | informalequation | informalexample |
	informaltable | equation | example | figure | table | msgset
	| procedure | sidebar | qandaset | anchor | bridgehead |
	comment | highlights | abstract | authorblurb | epigraph |
	indexterm | beginpage)+)>

This error might not be present on your system

The Duck book CD has a file called 'docbook.xsl' in the
folder 'DOCBOOK:style:xsl:docbook:fo:docbook.xsl' and
this is the one that I used. It is right next to the
::html:docbook.xsl that you used to get the html.

I processed your document with MacXSLT to get a .fo file.
<URL: http://catcode.com/macxslt/ >, and then processed
the resulting .fo file with MacFOP, which is a Mac FOP
executable that is not (nor will ever be) ready for
public performance. There were some major things to fix,
of which the most obvious was the fact that the xsl produced
      page-master-name
but FOP wanted
      master-name

and in fact I was not able to get a clean rendition of
your document, but I think that I could do so if it
were important.

MacXSLT is based on xalan exempli gratia
<URL: http://www.xml.com/pub/r/183 >, and unless you are
using a Mac, in which case you could also use MAcXSLT, I
suggest you get an XSLT processor for your platform,
based on xalan.

This may not be quite enough to get you started, in which
please post again.

BTW, there was nothing wrong with your question, and you get
extra credit for having enlisted the help of your local expert,
but your below average Subject line probably meant that
those who know about docbook -> FO probably read no further.

Ben.

P.S. Rather than publish a new book on HTML, why not reprint
some exisiting ones, such as Raggett, Boumphrey or Lie & Bos

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org