[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] cleaning up ill-structured html


Subject: Re: [xsl] cleaning up ill-structured html
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 23 Jan 2003 18:21:51 -0500

Ole,

While what Simon says is generally true, it's not *completely* true that XSLT can't be used to interpolate a hierarchy. See the XSL FAQ at http://www.dpawson.co.uk/xsl/sect2/flatfile.html for an approach treating your step 2 as a grouping problem, and leveraging your hierarchy that way (the trick is to use a key to associate each node with its most recently preceding break, then create a new paragraph every time you process a break with any associated nodes, pulling them into it).

It's not an obvious technique, but it's pretty easy once you grasp the principle. Ask again if you need more specific help.

Cheers,
Wendell

At 05:43 PM 1/23/2003, you wrote:
Probably best to start over with the HTML and use regular expressions, e.g., with Perl. This is not an XSL subject, the html you are starting with is not tree-structure so XSL is no help.

simon

On Thursday, January 23, 2003, at 03:54 PM, Ole Sandum wrote:

...


I can do step 1, but step 2 gives me trouble. To
formalise: how do I convert a structure structure like

<break/>+ { other+ <break/>+ }*

into

{ <p> other+ </p> }*

I fear the solution is really simple. Any ideas?


======================================================================
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
======================================================================


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords