1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.vectomatic.svg.edit.client.engine;
19
20
21
22
23
24
25
26 public class IdRefTokenizerOpera extends IdRefTokenizer {
27 protected static final String START2 = "url(";
28 protected static final String END2 = ")";
29
30 public IdRefToken nextToken() {
31 if (index1 != str.length()) {
32 if (token.kind == IdRefToken.IDREF) {
33 boolean notFirst = token.value != null;
34 token.kind = IdRefToken.DATA;
35 index2 = str.indexOf(START2, index1);
36 if (index2 != -1) {
37 token.value = str.substring(index1, index2 + START2.length()) + "'#";
38 index1 = index2 + START2.length();
39 } else {
40 token.value = str.substring(index1);
41 index1 = str.length();
42 }
43 if (notFirst) {
44 token.value = "'" + token.value;
45 }
46 } else {
47 index2 = str.indexOf(END2, index1);
48 if (index2 != -1) {
49 token.value = str.substring(index1, index2);
50 int index3 = token.value.indexOf("#");
51 if (index3 != -1) {
52 token.value = token.value.substring(1 + index3);
53 }
54 if (token.value.endsWith("'")) {
55 token.value = token.value.substring(0, token.value.length() - 1);
56 }
57 if (token.value.endsWith("\"")) {
58 token.value = token.value.substring(0, token.value.length() - 1);
59 }
60 index1 = index2;
61 token.kind = IdRefToken.IDREF;
62 } else {
63 token.value = str.substring(index1);
64 index1 = str.length();
65 }
66 }
67 return token;
68 }
69 return null;
70 }
71 }