Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Change only One Tag in Xslt >Thread Next - Re: Change only One Tag in Xslt Re: Change only One Tag in XsltTo: NULL Date: 12/28/2007 4:27:00 AM Hi Martin,
Sorry "reset of all the tags", is a spelling mistake. Correct one is,
all other tags such as [RollNum,EmpID, ...etc] should copy as it is
into some other file.
My finall out will be:
<Employees>
:
:
<Employ>
<EmpName>..</EmpName> //Only this statement has
changed. Except no change
<RollNum>..</RollNum>
<EmpID>..</EmpID>
:
:
</Employ>
<Employ>... </Employ>
<Employ>... </Employ>
:
:
<Dept>....</ Dept >
<Dept>....</ Dept >
:
:
:
<Employees>
Good snippet you have given but still i need your help to
resolve my problem,
Here are my 3 queries:
1) in my case I have to handle like this so can you please suggest
some more good snippet in this way.
<xsl:apply-templates select="Employee"/>
//Here I have transfer only single Employee node and I want to iterate
all the nodes in single employee and check a perticular node and do
some operations. Like below.
<xsl:template match=" Employee ">
<xsl:choose>
<xsl:when test="name">
<xsl:element name="EmpName">
<xsl:value-of select="name"/>
</xsl:element>
</xsl:when>
</xsl:choose>
Copy rest of the nodes here.
</xsl:template>
1) <xsl:apply-templates select=" "/> :
a. if am using "apply-templates" statement then my output was like
below (this is like my final structure with no data). I don't know why
this happened in my prog.
<Employ> </Employ>
<Dept> </ Dept >
:
:
: etc.
2) I have read about <xsl:copy> is not using then result will be in
different way. Is this in my case because I am not using <xsl:copy> ?
3) i have got some value like this:
<xsl:template match="instance">
<!-- <xsl:copy-of select="instance"/> -->
<xsl:element name ="instance">
<xsl:value-of select="."/>
</xsl:element>
</xsl:template>
so I want to change my statements like this
If(<xsl:value-of select="."/> != "")
{
//Create Element "instance node "
<xsl:element name ="instance">
<xsl:value-of select="."/>
</xsl:element>
}
becase if <xsl:value-of select="."/> value is null even i am creating
a node with null string so i have to avoid this case.
So how can I go about in this case. If I stored "select="."" value in
a variable and I can check it. But in my prog I had many statement
like this. for all statements I would create variables ? I hope its
not good way.
Regards,
Rasheed.
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
