xsl-list
[Top] [All Lists]

Re: [xsl] XSL-FO and XSD Information request

2006-03-20 13:31:57
Hi Kamal,

At 02:47 AM 3/20/2006, you wrote:
OK, I was not too good at specifying what I wanted to do. I guess there are two difficult hurdles that I will need to jump. The first is having data is multiple files. I thought that maybe I could get away with something simple (such as looping through all the included xsd files) but then it occured to me that I can find (for example) a attribute group, but this attribute group may have a reference to a simple type which means either searching the file that has the attribute group or searching the imports of the file. This is doable I think by passing the document that called the template to the next template (if you follow). Unfortunately, I think that is a particularly bad idea from cocoon. That is probably a question for the cocoon mailing list.

Yes. I can confirm that the document() function doesn't do very well in Cocoon. Asking for more advice from them is a good idea. Multiple passes (pipelining) may be necessary, to aggregate the files you need together.

Second problem is pretty printing XML examples. I was going to use some annotations to store example data and use the annotations to generate the date. Now, the file searching problem aside, we also have the problem of printing this nicely, and I am not talking about simply identing. Most people don't likes reading XML that looks like this:

<element attr1="xxxx" attr2="xxxx" attr3="xxxx" attr4="xxxx" attr5="xxxx" attr6="xxxx" attr7="xxxx" attr8="xxxx" attr9="xxxxx" attr10="xxxxxxxx" attr11="xxxxx" attr12="xxxxxxx" attr13="xxxxxx" attr14="xxxxx">
...
</element>
most people would prefer:

<element attr1="xxxx" attr2="xxxx" attr3="xxxx" attr4="xxxx" attr5="xxxx"
              attr6="xxxx" attr7="xxxx" attr8="xxxx" attr9="xxxxx"
              attr10="xxxxxxxx" attr11="xxxxx" attr12="xxxxxxx"
              attr13="xxxxxx" attr14="xxxxx">
...
</element>

Any ideas how to achieve this? I have none.

XSLT is not well suited for this work, since its processing model separates the work of transformation (what XSLT does) from the representation of the results of transformation in a concrete syntax (what the serializer does). That is, from the XSLT point of view you need to program or control the serializer, not the transformation.

Cocoon could perhaps integrate a custom serializer if you wrote one, to create output of any transformation (including no transformation at all) according to your requirements. Again, they can give more advice.

I've created a system that turns content stored in XML into PDF (through
XSLT to XSL-FO and then through FOP), Word (through XSLT to WordML), HTML
(throught XSLT), JavaHelp (through XSLT), and text (through XSLT).

So, what you have in mind can be done.
I was thinking that maybe I could use something to convert the XML into PDF, word and HTML inside of cocoon. I think there is support for FOP in cocoon, what about WordML?

You'd need to write a transformation into WordML. This is not impossible, though off hand it seems to me it would be just as easy to transform into a variant of HTML that Word could read and do the right thing with.

This is a challenging set of assignments: good luck.

Cheers,
Wendell



======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
  Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--