Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 69 lines (65 sloc) 2.088 kb
05eedb5 @itod initial add
authored
1 // Copyright 2010 Todd Ditchendorf
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14
15 #import "TDXmlNameTest.h"
16 #import "TDXmlNameState.h"
17 #import "TDXmlNmtokenState.h"
18 #import "TDXmlToken.h"
19
20 @implementation TDXmlNameTest
21 //
22 //- (void)test {
23 // NSString *s = @"_foob?ar _foobar 2baz";
24 // PKTokenizer *t = [PKTokenizer tokenizerWithString:s];
25 //
26 // //Name ::= (Letter | '_' | ':') (NameChar)*
27 // TDXmlNameState *nameState = [[[TDXmlNameState alloc] init] autorelease];
28 //
29 // [t setTokenizerState:nameState from: '_' to: '_'];
30 // [t setTokenizerState:nameState from: ':' to: ':'];
31 // [t setTokenizerState:nameState from: 'a' to: 'z'];
32 // [t setTokenizerState:nameState from: 'A' to: 'Z'];
33 // [t setTokenizerState:nameState from:0xc0 to:0xff];
34 //
35 // TDXmlNmtokenState *nmtokenState = [[[TDXmlNmtokenState alloc] init] autorelease];
36 // [t setTokenizerState:nmtokenState from: '0' to: '9'];
37 //
38 // TDXmlToken *tok = nil;
39 //
40 // // _foob
41 // tok = (TDXmlToken *)[t nextToken];
42 // TDNotNil(tok);
43 // TDTrue(tok.isName);
44 //
45 // // '?'
46 // tok = (TDXmlToken *)[t nextToken];
47 // TDNotNil(tok);
48 // TDTrue(tok.isSymbol);
49 //
50 // // ar
51 // tok = (TDXmlToken *)[t nextToken];
52 // TDNotNil(tok);
53 // TDTrue(tok.isName);
54 //
55 // // _foobar
56 // tok = (TDXmlToken *)[t nextToken];
57 // TDNotNil(tok);
58 // TDTrue(tok.isName);
59 //
60 // // 2baz
61 // tok = (TDXmlToken *)[t nextToken];
62 // TDNotNil(tok);
63 // TDTrue(tok.isNmtoken);
64 // NSLog(@"tok: %@", tok);
65 //
66 //}
67
68 @end
Something went wrong with that request. Please try again.