Tempore 12:22:31, die 07/06/2005 AD, hinc in
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com scripsit Lakshmi narayana
<lchintala(_at_)osi-tech(_dot_)com>:
I have one more question regarding this problem only.
If I don't have the Type attribute for the first xml, is it possible to
add the type
attribute to the nodes based on the node name like...if node name is A,
then type="AGroup".
All depends on this element:
<xsl:with-param name="Type" select="@Type"/>
Change this to:
<xsl:with-param name="Type">
<xsl:choose>
<xsl:when test="@Type"><xsl:value-of select="@Type"/></xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(local-name(),1,1)"/>
<xsl:text>Group</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
The mapping will be done by 1) the 'Type' attribute if present 2) a
constructed grouping name when the 'Type' attribute is not present.
That grouping name is constructed by these elements:
<xsl:value-of select="substring(local-name(),1,1)"/>
<xsl:text>Group</xsl:text>
This is combination of the first character of the element's name and the
word 'Group'. It works in your sample, but you'll most likely need to
modify it in order to work in your real situation.
Then after adding the node, I have to map the attributes based on the
second xml.
I'm unsure whether you're addressing the (imaginary) workflow of the xslt
algorithm or real changes in the input XML document. In the latter case,
you'll need some extension function to produce multiple ouput documents.
regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Spread the wiki (http://www.wikipedia.org)
--~------------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--