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:
  Reg.Exp problem with ?: not working in IE5.0  ravi_pvkumar at 14:15 on Wednesday, November 02, 2005
 

Hi,

I have written XMl Parser, which takes string as input , while matching the root element of xml string by using the function obj.match(RegExp.$STag);


Following is the expression i am using:

String.$Char = "(?: \\u0009 | \\u000A | \\u000D | " +
"[\\u0020-\\uD7FF] | [\\uE000-\\uFFFD] | " +
"[\\u10000-\\u10FFFF] )";

// White Space
String.$S = "(?: (?: \\u0020 | \\u0009 | \\u000D | \\u000A )+ )";

// Names and matches
String.$NameChar = "(?: $Letter | $Digit | \\. | \\- | _ | : | " +
"$CombiningChar | $Extender )";
String.$Name = "(?: $Letter | _ | : ) $NameChar*";

// Literals

String.$AttValue = "(?: \" (?: [^<&\"] | $Reference )* \" ) | " +
"(?: ' (?: [^<&'] | $Reference )* ' )";
String.$SystemLiteral = "(?: (?: \" [^\"]* \") | (?: ' [^']* '))";
String.$PubidLiteral = "(?: (?: \" $PubidChar* \") | " +
"(?: ' (?: (?!')$PubidChar)* '))";
String.$PubidChar = "(?: \\u0020 | \\u000D | \\u000A | [a-zA-Z0-9] | " +
"[-'()+,./:=?;!*#@$_%])";
// Character Data
//String.$CharData = "(?![^<&]*]]>[^<&]*)[^<&]*"; // :REVISIT:
String.$CharData = "[^<&]+";

String.$STag = "< ( $Name ) ( (?: $S $Attribute )* ) $S? >";
String.$Attribute = "( $Name ) $Eq ( $AttValue )";

RegExp.$STag = new RegExp( "^" + String.$STag.resolve() );

using the above expression as below:
obj.match( RegExp.$STag )

Problem :

This piece of code is working fine in IE 6.0 by returning the root element, but returning null in the case of IE 5.0.
anybody can help out in this regard. Is there any methodology to counter this problem or need to change code?
Thanks in advance
RKV









CodeToad Experts

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








Recent Forum Threads
•  Re: sorting and Linked list
•  Re: need help linked list
•  Re: Help with arrays
•  Re: Reading from a file
•  Re: Why Use Method?
•  Re: Help with a simple program
•  Re: need help with quiz
•  Re: Help with filesystem object & displaying in a table
•  Re: Genetic Algorithm Help


Recent Articles
Multiple submit buttons with form validation
Understanding Hibernate ORM for Java/J2EE
HTTP screen-scraping and caching
a javascript calculator
A simple way to JTable
Java Native Interface (JNI)
Parsing Dynamic Layouts
MagicGrid
Caching With ASP.Net
Creating CSS Buttons


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005