<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Translation of a vbscript-code to jscript</title><link>https://www.infopathdev.com:443/forums/thread/70474.aspx</link><pubDate>Wed, 21 Sep 2011 10:00:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:70474</guid><dc:creator>dchrist1</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/70474.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=70474</wfw:commentRss><description>&lt;p&gt;Hey everybody,&lt;/p&gt;&lt;p&gt;first of all. I&amp;#39;m a german guy and if I have some mistakes in my sentences: Sorry for that. I have the following code from an existing form:&lt;/p&gt;&lt;p&gt;Sub XDocument_OnLoad(eventObj)&lt;br /&gt;strPath = XDocument.URI
&lt;br /&gt;strFileName = Right (strPath, Len(strPath) - InStrRev(strPath, &amp;quot;/&amp;quot;))
&lt;br /&gt;strFileName = Left(strFileName, Len(strFileName) - 4)

&lt;br /&gt;&lt;br /&gt;dim oInfo
set oInfo = XDocument.DOM.selectSingleNode(&amp;quot;/my:meineFelder/my:ID&amp;quot;)
&lt;br /&gt;oInfo.text = strFileName

&lt;br /&gt;End Sub&lt;/p&gt;&lt;p&gt;&amp;nbsp;And now I must change the code language to jscript and I already tried to do that:&lt;/p&gt;&lt;p&gt;function XDocument::OnLoad(eventObj)&lt;br /&gt;{
	&lt;br /&gt;var strPath = XDocument.URI;
	&lt;br /&gt;var strFileName&amp;nbsp; = ...&lt;br /&gt;strFileName =...&lt;br /&gt;&lt;br /&gt;var oInfo = XDocument.DOM.selectSingleNode(&amp;quot;/my:meineFelder/my:ID&amp;quot;);
&lt;br /&gt;	oInfo.text = strPath;&lt;br /&gt;} &lt;/p&gt;&lt;p&gt;As you can see on my attempt, I don&amp;#39;t know how to translate the lines &amp;quot;strFileName = ...&amp;quot;. Could someone of you maybe help me?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;best regards&lt;br /&gt;Daniel &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>