Jump to content

webbenny

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by webbenny

  1. Does that help?I am afraid so far the problem is kind of underspecified, I don't know whether the list elements can contain anything other than para and note elements.
    Hmm.. Yes you're right! I was looking for a very generic expression of my problem.. The main cause is, that I've a source structure which allows some nested xml elements but the result xml doesn't allow this element inside another element. so I've to close and reopen it. Do you recommend to use for-each-group (which helped me a lot in this case!) or is there another posibility?
  2. Hi everybody! I try to transform a xml file. I've the very basic problem, that I need to close and reopen tags in xslt (ok, this maybe is not the problem even if I think it is.. :facepalm: ). My input structure is like:

    <?xml version="1.0" encoding="UTF-8"?><misc><list>	<listitem>		<para>some text..</para>	</listitem>	<listitem>		<para>Here is some more text.			<note>				<para>This is my notice in a para..</para>			</note> find even more here ;-)		</para>	</listitem></list></misc>

    ...and I wanna get a result like this because I'm not allowed to use <note> in a <para>:

    <?xml version="1.0" encoding="UTF-8"?><misc><list><listitem>  <para>some text..</para></listitem><listitem>  <para>Here is some more text.</para></listitem></list><note><para>This is my notice in a para..</para></note><list continue="true"><listitem>find even more here ;-)</listitem></list></misc>

    Here is what I'm working on..

    <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"><xsl:template match="list"><xsl:choose>  <xsl:when test="descendant::note">   <!-- here I need something like split the list? -->  </xsl:when>  <xsl:otherwise>   <xsl:element name="list">	<xsl:apply-templates/>   </xsl:element>  </xsl:otherwise></xsl:choose></xsl:template><xsl:template match="listitem"><xsl:element name="listitem"></xsl:element></xsl:template></xsl:stylesheet>

    Thanks for any approach!webbenny

    • Like 1
×
×
  • Create New...