[xsl] Transforming a Loose Structure

Subject: [xsl] Transforming a Loose Structure
From: Jeff Sese <jsese@xxxxxxxxxxxx>
Date: Wed, 21 Mar 2007 13:34:47 +0800

I'm trying to transform one xml to another xml, however the elements used for text formatting is much stricter in the output than that of the source. For example:


<p>Some text <i>some italic text with <b>bold faced</b> and and in <ul>underline</ul></i>.</p>

<i> - for italics
<b> - for bold face
<ul> - for underline
<sup> - superior
<inf> - inferior
<sc> - small-caps

These element can contain each other from the source with no restrictions. However, the output requires that:

<i> - can contain <b>, <ul>, <sup>, <inf>, <sc>
<b> - can contain <i>, <ul>, <sup>, <inf>, <sc>
<ul> - can only contain <i>, <b>
<sup> - can only contain <i>, <b>
<inf> - can only contain <i>, <b>
<sc> - can only contain <i>, <b>

With these restrictions an underlined text in small caps, superior in small caps or underline, inferior in small caps or underline will not have correct counter part from the output, but i think i'll have to default them in someway. But my problem is when the <sup>, <inf>, <ul> or <sc> is inside a <i> or <b>, how can i make my output so that will conform to the restrictions?

*Jeff Sese*

Current Thread