codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  `section` is an unexpected token. Expecting white space. Line 1, position 137.  TAS at 14:02 on Monday, June 22, 2009
 

Hi,

Can you help me as soon as possible....

In my xml file,

<footnote><num>3</num><p><text>Ie under the Partnership Act 1961 s 13 (see <inrf id="hlm.160.013">[160.013]</inrf>): s 14.</text></p></footnote>

I want to replace the above line as

<footnote><num>3</num><p><text>Ie under the <strfact><strf>Partnership Act 1961</strf><sec>s 13</sec></strfact> (see <inrf id="hlm.160.013">[160.013]</inrf>): s 14.</text></p></footnote>

I get the footnote element from the root and then try to find out the strFindVal. If it is, then replaced as strRepVal.

My C# coding lines:

string strFindVal = "Partnership Act 1961 s 13";
string strRepVal = "<strfact><strf>Partnership Act 1961</strf><sec>s 13</sec></strfact>";
if (xnRep.Item(k).ChildNodes[s].Name == "footnote")
{
if (xnRep.Item(k).ChildNodes[s].InnerXml.Contains(strFindVal))
xnRep.Item(k).ChildNodes[s].InnerXml = xnRep.Item(k).ChildNodes[s].InnerXml.Replace(strFindVal, strRepVal);
}

Thanks in advance.....

<Added>

Hi,

Can you help me as soon as possible....

In my xml file,

<footnote><num>3</num><p><text>Ie under the Partnership Act 1961 s 13 (see <inrf id="hlm.160.013">[160.013]</inrf>): s 14.</text></p></footnote>

I want to replace the above line as

<footnote><num>3</num><p><text>Ie under the <strfact><strf>Partnership Act 1961</strf><sec>s 13</sec></strfact> (see <inrf id="hlm.160.013">[160.013]</inrf>): s 14.</text></p></footnote>

I get the footnote element from the root and then try to find out the strFindVal. If it is, then replaced as strRepVal.

My C# coding lines:

string strFindVal = "Partnership Act 1961 s 13";
string strRepVal = "<strfact><strf>Partnership Act 1961</strf><sec>s 13</sec></strfact>";
if (xnRep.Item(k).ChildNodes[s].Name == "footnote")
{
if (xnRep.Item(k).ChildNodes[s].InnerXml.Contains(strFindVal))
xnRep.Item(k).ChildNodes[s].InnerXml = xnRep.Item(k).ChildNodes[s].InnerXml.Replace(strFindVal, strRepVal);
}

I am getting an error as 'section' is an unexpected token. Expecting white space. Line 1, position 137. Pls help me

Thanks in advance.....









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
• C++
• Re: refresh parent after closing pop up window
• Dynamic Insertion
• Date and Time function around the world???
• Significant Factors
• Perl array access
• Re: huffman encoding and decoding in C++...
• Perl One Liner: Replace {(
• Re: html including php, accessing the functions


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2009