G
Gerald Aichholzer
Hello NG,
I try to apply the following template
<xsl:template match="objectgroup[@objid != '']">
<xsl:copy>
<xsl:apply-templates select="*|@*"/>
<xsl:variable name="object" select="."/>
<xsl:for-each select="//plugins/plugin">
<plugin pid="{./@pid}"
href="{//pluginobjectlist[@pid = ./@pid]/
objectgroup[@objid = $object/objid]/@href}"/>
</xsl:for-each>
</xsl:copy>
</xsl:template>
to the follwoing xml-file
<symbol>
<objectgroup objid='id1'>
<!-- some elements here -->
</objectgroup>
<plugins>
<plugin pid="plug1"/>
<plugin pid="plug2"/>
<plugin pid="plug3"/>
</plugins>
<plugins>
<pluginobjectlist pid="plug1">
<objectgroup objid="obj1" href="url-p1-o1"/>
<!-- repeats for other objects -->
</pluginobjectlist>
<pluginobjectlist pid="plug2">
<objectgroup objid="obj1" href="url-p2-o1"/>
<!-- repeats for other objects -->
</pluginobjectlist>
<!-- repeats for remaining plugins -->
</plugins>
</symbol>
and I get the following result
<symbol>
<objectgroup objid='id1'>
<!-- some elements here -->
<plugin pid="plug1" href="url-p2-o1"/>
<plugin pid="plug2" href="url-p2-o1"/>
<plugin pid="plug3" href="url-p2-o1"/>
</objectgroup>
<!-- remaining templates remove plugin-elements -->
</symbol>
I see always the same url, so something in the xsl:for-each must
be wrong - but I can't see the problem.
Please give me a hint if you have an idea.
Thanx in advance,
Gerald
I try to apply the following template
<xsl:template match="objectgroup[@objid != '']">
<xsl:copy>
<xsl:apply-templates select="*|@*"/>
<xsl:variable name="object" select="."/>
<xsl:for-each select="//plugins/plugin">
<plugin pid="{./@pid}"
href="{//pluginobjectlist[@pid = ./@pid]/
objectgroup[@objid = $object/objid]/@href}"/>
</xsl:for-each>
</xsl:copy>
</xsl:template>
to the follwoing xml-file
<symbol>
<objectgroup objid='id1'>
<!-- some elements here -->
</objectgroup>
<plugins>
<plugin pid="plug1"/>
<plugin pid="plug2"/>
<plugin pid="plug3"/>
</plugins>
<plugins>
<pluginobjectlist pid="plug1">
<objectgroup objid="obj1" href="url-p1-o1"/>
<!-- repeats for other objects -->
</pluginobjectlist>
<pluginobjectlist pid="plug2">
<objectgroup objid="obj1" href="url-p2-o1"/>
<!-- repeats for other objects -->
</pluginobjectlist>
<!-- repeats for remaining plugins -->
</plugins>
</symbol>
and I get the following result
<symbol>
<objectgroup objid='id1'>
<!-- some elements here -->
<plugin pid="plug1" href="url-p2-o1"/>
<plugin pid="plug2" href="url-p2-o1"/>
<plugin pid="plug3" href="url-p2-o1"/>
</objectgroup>
<!-- remaining templates remove plugin-elements -->
</symbol>
I see always the same url, so something in the xsl:for-each must
be wrong - but I can't see the problem.
Please give me a hint if you have an idea.
Thanx in advance,
Gerald