C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




xml and xsl


Posted Date: 29 Aug 2008      Total Responses: 3

Posted By: sudheshna        Member Level: Bronze     Points: 1


it is regarding xsl and xml. i want to chk in xsl if xml file missing then i have to catch and diplay some message. no dot net here...it is only xsl and xml. for ex
<xsl: variable name="doc1" value="xml1.xml">...this will work if xml file exists...if there is no xml file then it will raise an error which i have to handle....if you this please let me know. thanks in advance.




Responses

Author: Santhosh    09 Oct 2008Member Level: BronzeRating:     Points: 4
Yes you can do this by using the following:

<xsl:when test="FileUtils:exists($filename)">
<xsl:message>Yes,File Exists</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:message>File Not Found</xsl:message>
</xsl:otherwise>

$filename will be the variable that holds your file path.



Author: sudheshna     09 Oct 2008Member Level: BronzeRating:     Points: 3
Hi,

I appreciate for the response. I tried with the code u provided and i faced the error as :-Reference to undeclared namespace prefix: 'FileUtils'.
do u have any idea on the namespace to be added. Thanks in advance.


Author: Santhosh    10 Oct 2008Member Level: BronzeRating:     Points: 3
Hi,

I missed out to mention the namespace for using exists method. I tried with this namespace and it worked for me. use the following namespace:

xmlns:FileUtils="java:org.cdlib.xtf.xslt.FileUtils"



Post Reply
You must Sign In to post a response.
Next : insert values in xml
Previous : XmlSerializer
Return to Discussion Forum
Post New Message
Category: XML

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

Help Desk

Contact Us    Privacy Policy    Terms Of Use