illegal elements must go...

Subject: illegal elements must go...
From: Jukka.T.Lehtinen@xxxxxxxxx
Date: Thu, 24 Aug 2000 10:53:16 +0300
Hi all!

I have struggled couple of days with this problem (well, still new in XSLT).

I'm having parent element which can have many childrens (in source). But the
result side (in DTD) there are fewer possible elements. So, solution I'm
gonna do is to put those 'illegal' (in result side) elements childrens of
para element(s).

e.g:
 
source:
---------------------------------------------
<entry>
	<para>sometext</para>
	<jibii>sometext</jibiii>
	sometext without tags - illegal
	<zzz>illegal element in result</zzz>
	<xxx>another illegal elem</xxx>
    <jibii>this elem is good</jibii>
    <xxx>another illegal</xxx>
</entry>
---------------------------------------------

result I want:
---------------------------------------------
<entry>
	<para>sometext</para>
	<jibii>sometext</jibiii>
	<para>            <!-- this is my problem -->
	sometext without tags - illegal
	<zzz>illegal element in result</zzz>
	<xxx>another illegal elem</xxx>
	</para>           <!-- this is my problem -->
    <jibii>this elem is good</jibii>
	<para>
    <xxx>another illegal</xxx>
	</para>
</entry>
----------------------------------------------	

But, I want them so that one added para element have all forthcoming illegal
elemnts in as its children(like in example). Not so that every illegal
element has parent para element of its own. So I have to test if the element
is illegal AND if the next element is also illegal, and next... and when
next elemnt is  ok. then put </para> element before ok element. And that
PCDATA text - children of entry is also giving me some extra gray hairs.

Any good solutions ???

I ja tried quite many different solutions and there were all quite wrong, so
I'm not gonna add them there as a bad example :-).

Thanks very much in advance.

And cheers... this list rocks. 

Jukka. 


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


Current Thread