Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have problem.
Every xml tag <PropertyDescription> have 2 tags like this
<PropertyDescriptions> <PropertyDescription> <DescriptionText>.....DATA ......</DescriptionText> <DescriptionType DescriptionType="4" /> </PropertyDescription> <PropertyDescription> <DescriptionText>2 SOBNO STANOVANJE NA TABORU</DescriptionText> <DescriptionType DescriptionType="6" /> </PropertyDescription> </PropertyDescriptions>
How can I transform them in this tags:
<Title>2 SOBNO STANOVANJE NA TABORU</title>
<DATATYPE> .....DATA..... </DATATYPE>
Please help me!
Hi Boss98
You can transform those elements into the new elements just like you would if you needed the output to be HTML tags like <h1>, <div> etc.
I suppose that the above XML is what umbraco has generated for you?
Then you should be able to do something like this
<title><xsl:value-of select="$currentPage/PropertyDescriptions/DescriptionText" /></title>
Is this what you're after?
/Jan
no,Jan. I tried like this:
<xsl:template match="PropertyDescriptions/PropertyDescription"> <xsl:for-each select="."> <xsl:element name="Title{@DescriptionType}"><xsl:value-of select="DescriptionText" /> </xsl:element> </xsl:for-each></xsl:template>
and <xsl:apply-templates select="PropertyDescriptions/PropertyDescription" />
I expect this results:
<Title4>2 SOBNO STANOVANJE NA TABORU</Title4>
<Title6>.....DATA.....</Title6>
But I didn't get it. The results was:
<Title>2 SOBNO STANOVANJE NA TABORU</Title>
<Title>.....DATA.....</Title>
when I tried this:
<xsl:template match="PropertyDescriptions/PropertyDescription"> <xsl:for-each select="DescriptionType"> <xsl:element name="Title{@DescriptionType}"><xsl:value-of select="DescriptionText" /> </xsl:element> </xsl:for-each></xsl:template>
I get only this:
<Title4/><Title6>
What I doing wrong????
Can anyone know to help me?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
How to tranform xml tag with xslt
I have problem.
Every xml tag <PropertyDescription> have 2 tags like this
<PropertyDescriptions>
<PropertyDescription>
<DescriptionText>.....DATA ......</DescriptionText>
<DescriptionType DescriptionType="4" />
</PropertyDescription>
<PropertyDescription>
<DescriptionText>2 SOBNO STANOVANJE NA TABORU</DescriptionText>
<DescriptionType DescriptionType="6" />
</PropertyDescription>
</PropertyDescriptions>
How can I transform them in this tags:
<Title>2 SOBNO STANOVANJE NA TABORU</title>
<DATATYPE> .....DATA..... </DATATYPE>
Please help me!
Hi Boss98
You can transform those elements into the new elements just like you would if you needed the output to be HTML tags like <h1>, <div> etc.
I suppose that the above XML is what umbraco has generated for you?
Then you should be able to do something like this
<title><xsl:value-of select="$currentPage/PropertyDescriptions/DescriptionText" /></title>
Is this what you're after?
/Jan
no,Jan. I tried like this:
<xsl:template match="PropertyDescriptions/PropertyDescription">
<xsl:for-each select=".">
<xsl:element name="Title{@DescriptionType}"><xsl:value-of select="DescriptionText" />
</xsl:element>
</xsl:for-each></xsl:template>
and <xsl:apply-templates select="PropertyDescriptions/PropertyDescription" />
I expect this results:
<Title4>2 SOBNO STANOVANJE NA TABORU</Title4>
<Title6>.....DATA.....</Title6>
But I didn't get it. The results was:
<Title>2 SOBNO STANOVANJE NA TABORU</Title>
<Title>.....DATA.....</Title>
when I tried this:
<xsl:template match="PropertyDescriptions/PropertyDescription">
<xsl:for-each select="DescriptionType">
<xsl:element name="Title{@DescriptionType}"><xsl:value-of select="DescriptionText" />
</xsl:element>
</xsl:for-each></xsl:template>
I get only this:
<Title4/>
<Title6>
What I doing wrong????
Can anyone know to help me?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.