Altova Mailing List Archives


illegal elements must go...

From: Jukka.T.Lehtinen@---------
To:
Date: 8/24/2000 1:53:00 PM
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

Disclaimer

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.