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 public class IdRefTokenizerMozilla extends IdRefTokenizer {
26 protected static final String START2 = "url(\"#";
27 protected static final String END2 = "\")";
28 private boolean hasQuotes;
29
30 public IdRefToken nextToken() {
31 if (index1 != str.length()) {
32 if (token.kind == IdRefToken.IDREF) {
33 token.kind = IdRefToken.DATA;
34 index2 = str.indexOf(START2, index1);
35 if (index2 != -1) {
36 hasQuotes = true;
37 token.value = str.substring(index1, index2 + START2.length());
38 index1 = index2 + START2.length();
39 } else {
40 index2 = str.indexOf(START, index1);
41 if (index2 != -1) {
42 hasQuotes = false;
43 token.value = str.substring(index1, index2 + START.length());
44 index1 = index2 + START.length();
45 } else {
46 token.value = str.substring(index1);
47 index1 = str.length();
48 }
49 }
50 } else {
51 if (hasQuotes) {
52 index2 = str.indexOf(END2, index1);
53 } else {
54 index2 = str.indexOf(END, index1);
55 }
56 if (index2 != -1) {
57 token.value = str.substring(index1, index2);
58 index1 = index2;
59 token.kind = IdRefToken.IDREF;
60 } else {
61 token.value = str.substring(index1);
62 index1 = str.length();
63 }
64 }
65 return token;
66 }
67 return null;
68 }
69 }