Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Change only One Tag in Xslt

From: Rasheed <sk.rasheedfarhan@-----.--->
To: 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.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent