|
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
|
|
|
|
|
|
|
|