XSLT
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > BizTalk Server > BizTalk Server General > XSLT




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    XSLT  
Nikki


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-18-05 10:52 PM

How can I use an XSLT call template to merge parent/child nodes; i.e.

IN:
<root>
<parent1>
<child>john</child>
</parent1>

<parent1>
<child>mary</child>
</parent1>

<parent2>
<child>jane</child>
</parent2>
</root>

GOAL:
<root>
<parent1>
<child>john</child>
<child>mary</child>
</parent1>
<parent2>
<child>jane</child>
</parent2>
</root>

your help is greatly appreciated.

THANKS!!





[ Post a follow-up to this message ]



    RE: XSLT  
Alexandre Roba


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-18-05 10:52 PM

Hi Nikki,

Don't know if that was what you requested.

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs">
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
<xsl:template match="/root">
<root>
<xsl:attribute
name="xsi:noNamespaceSchemaLocation">//pdm/Users/arobadol/MYDOCU~1/ALTOVA~1/
Root.xsd</xsl:attribute>
<parent1>
<xsl:for-each select="parent1">
<xsl:for-each select="child">
<child>
<xsl:value-of select="."/>
</child>
</xsl:for-each>
</xsl:for-each>
</parent1>
<parent2>
<xsl:for-each select="parent2">
<xsl:for-each select="child">
<child>
<xsl:value-of select="."/>
</child>
</xsl:for-each>
</xsl:for-each>
</parent2>
</root>
</xsl:template>
</xsl:stylesheet>

Regards,

Alexandre Roba


"Nikki" wrote:

> How can I use an XSLT call template to merge parent/child nodes; i.e.
>
> IN:
> <root>
>     <parent1>
>          <child>john</child>
>      </parent1>
>
>     <parent1>
>          <child>mary</child>
>      </parent1>
>
>     <parent2>
>          <child>jane</child>
>      </parent2>
> </root>
>
> GOAL:
> <root>
>     <parent1>
>          <child>john</child>
>          <child>mary</child>
>      </parent1>
>     <parent2>
>          <child>jane</child>
>      </parent2>
> </root>
>
> your help is greatly appreciated.
>
> THANKS!!





[ Post a follow-up to this message ]



    RE: XSLT  
Nikki


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-18-05 10:52 PM

Alexandre,

thanks for the response. what's the systanx if the number of parent/child is
unknown?

"Alexandre Roba" wrote:
[vbcol=seagreen]
> Hi Nikki,
>
> Don't know if that was what you requested.
>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs">
> <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
> <xsl:template match="/root">
> <root>
> <xsl:attribute
> name="xsi:noNamespaceSchemaLocation">//pdm/Users/arobadol/MYDOCU~1/ALTOVA~
1/Root.xsd</xsl:attribute>
> <parent1>
> <xsl:for-each select="parent1">
> <xsl:for-each select="child">
> <child>
> <xsl:value-of select="."/>
> </child>
> </xsl:for-each>
> </xsl:for-each>
> </parent1>
> <parent2>
> <xsl:for-each select="parent2">
> <xsl:for-each select="child">
> <child>
> <xsl:value-of select="."/>
> </child>
> </xsl:for-each>
> </xsl:for-each>
> </parent2>
> </root>
> </xsl:template>
> </xsl:stylesheet>
>
> Regards,
>
> Alexandre Roba
>
>
> "Nikki" wrote:
> 





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 04:53 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register