|
Subject: Re: [xsl] InnerElement attribute needs to be set for parent From: Arulraj <p_arulraj@xxxxxxxxx> Date: Sat, 10 May 2008 14:28:35 +0530 (IST) |
Hello Mukul,
Thanks for the your code.. it helps me great
Regards,
Raj
----- Original Message ----
From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx>
To:
xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Sent: Saturday, 10 May, 2008 1:54:16 PM
Subject: Re: [xsl] InnerElement attribute needs to be set for parent
You
could use the modified identity stylesheet, as shown below:
<xsl:template
match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() |
@*" />
</xsl:copy>
</xsl:template>
<xsl:template match="propertyList">
<propertyList>
<xsl:for-each select="property">
<xsl:attribute
name="{@name}">
<xsl:value-of select="@value" />
</xsl:attribute>
</xsl:for-each>
</propertyList>
</xsl:template>
PS:
Your input XML is not well formed ...
On Sat, May 10, 2008 at 12:40 PM,
Arulraj <p_arulraj@xxxxxxxxx> wrote:
> Hello,
>
> i have the following input
xml, i am using XSL for the transformation.
> <?xml version="1.0"
encoding="UTF-8"?>
> <extraList jcr:primaryType="extraList" >
>
<customerInfo jcr:primaryType="customerinfo">
> <propertyList>
>
<property name="betriebsnummer_str" value="54321"/>
> <property
name="email_str" value="test"/>
> </propertyList>
> </customerInfo>
> <info>
> <propertyList>
> <property name="yyy_str"
value="123"/>
> <property name="email_str" value="yahoo.com"/>
>
</propertyList>
> <info>
> </extraList>
>
> My expected output as follows:
>
> <extraList jcr:primaryType="extraList">
> <customerInfo
jcr:primaryType="customerinfo">
> <propertyList
betriebsnummer_str="54321" email_str="test"/>
> </customerInfo>
>
<info>
> <propertyList yyy_str="123" email_str="yahoo.com"/>
> <info>
> </extraList>
>
> How to copy the attributes from the <property> name and
value to <propertyList> with name as the attribute ?
>
> Please suggest to
solve this.
>
> Thanks
> Regards,
> Raj
--
Regards,
Mukul Gandhi
From
Chandigarh to Chennai - find friends all over India. Go to
http://in.promos.yahoo.com/groups/citygroups/
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] InnerElement attribute ne, Mukul Gandhi | Thread | [xsl] testing for numbers of nodes, Charles Muller |
| Re: [xsl] InnerElement attribute ne, Mukul Gandhi | Date | [xsl] testing for numbers of nodes, Charles Muller |
| Month |