Re: [xsl] XSL:FO Identify Transforms

Subject: Re: [xsl] XSL:FO Identify Transforms
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Mon, 19 Sep 2011 16:09:22 -0400
Hi Chris,

On 9/19/2011 8:25 AM, Chris Booth wrote:
So does this mean I need to know the structure of the XML at block
level?

If I understand your requirement correctly, yes it does. (It's not really an XSL-FO identity transformation, is it? It's an XSL-FO to generate a formatted version that shows tags or some other "literal" representation of markup structure.)


Admittedly this is a challenge for arbitrary XML inputs, but there are heuristic approaches you could consider, such as "any element that has no non-whitespace text node siblings is a block" or "any element of a type that has no non-whitespace siblings anywhere is a block", or "any element of a type that has non-whitespace siblings anywhere is inline, and all other elements are blocks".

(I am sure that intrepid XSL-Listers would help you write code to derive any of these if that's what was needed. Me, I need to take a nap.)

A poor-man's solution could be to treat all elements as blocks.

Or, you could flow everything into a single "preformatted" block, which would respect the whitespace in your XML source including line feeds (and then see to it that it's preserved as you parse and process).

It all depends on how you want your output to look.

I am hoping for a dynamic XSL:FO version that will allow the XML to
"published" with node names and values. It does not need to be in a
pretty format, a simple single string would be adequate although not
appealing.

Cheers, Wendell

--
======================================================================
Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
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
======================================================================

Current Thread