This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [docbook-apps] How to embed XML transforms into Docbook


On Sun, 2005-01-02 at 06:00 -0800, Jim Kring wrote:
> 
> > 
> > > 
> > > I have created an XSL file that defines a transform of the 
> > > XML file's content into a valid Docbook entity.
> > 
> > Why not run that first, then include them as docbook content?
> > 
> 
> Yes, that is an option.  But I am trying to avoid that processing step.  I
> am getting my feet wet with Docbook (and XML) and I am using the WYSIWYG XML
> Editor from XMLmind running in Windows. 

I've never yet found a wysiwyg XML editor that didn't make me cross :-)

>  My build process for transforming
> to HTML/PDF is quite manual (invoking the Transform function of XMLmind).

I've used quite long batch files using Saxon XSLT and XEP for the PDF
production, Once you've worked out the stream, its easier to commit it
to a batch file :-)


> 
> > > Can I use an ENTITY declaration (or
> > > another mechanism) in my Docbook file that would embed the 
> > > transformed content of the XML file by referencing the XML
> > > and the XSL file? I would like to do this dynamically,
> > > without having to create a file containing the transformed
> > > XML.
> > 
> > OK, I don't follow the logic of that, unless its re-use, but 
> > if that's the need;
> > nonDBFile1.xml
> > xslt takes it to DBFile1.xml
> 
> Well, what I was hoping to find is some mechanism like the following, which
> would allow me to perform the transform on the fly (without actually
> creating DBFile1, on disk):
> 
> <!ENTITY DBFile1 SYSTEM "nonDBFile1.xml" TRANSFORMEDBY "nonDBtoDB.xslt">
> 
> I know that the above is not correct usage of the ENTITY declaration, I am
> just trying to give an idea of a theoretical solution.

It sounds like you are way outside of XSLT territory :-) You might
have more luck running cocoon or similar, i.e. calling the transforms
from some supporting environment, perhaps java.

I'd question if that is worth the effort though.
Do you need the source (included) XML for some other purpose?


> I agree that this is a good solution.  But, at the moment my processing
> chain is manual due to my lack of automated command-line tools (again, I am
> using a WYSIWYG editor and Transform tool in Windows).



java  -Xms150M -Xmx150M -cp .;f:\myjava\saxon652.jar;\myjava\xerces.jar
com.icl.saxon.StyleSheet -x org.apache.xerces.parsers.SAXParser -l -o %3
%1  %2 "saxon.extensions=1" %4 %5 %6


rem %1 is xml
rem %2 is xsl file
rem %3 is output file
rem %4... are params
rem This for saxon at same release as oct 99 rec

This needs saxon653.jar in \myjava
xerces.jar in \myjava


if its in a file sax.bat, use it

>sax input.xml stylesheet.xsl output.html




> 
> What I was trying to say, is that nonDBFile1.xml has no knowledge of the
> fact that it is going to be transformed to DBFile1.xml, for use in a
> docbook.  So, if there was a possible solution, by declaring the (xslt)
> stylesheet inside of nonDBFile1.xml, this was not a preferred solution.
I don't think there is...

HTH DaveP




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]