src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/parser/state/attributeDeclBody.java

Mon, 02 Oct 2017 14:20:23 +0100

author
aefimov
date
Mon, 02 Oct 2017 14:20:23 +0100
changeset 1445
06086cb6c349
parent 397
b99d7e355d4b
child 1546
dc8316632248
permissions
-rw-r--r--

8159240: XSOM parser incorrectly processes type names with whitespaces
Reviewed-by: coffeys

ohair@286 1 /*
aefimov@1445 2 * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved.
ohair@286 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
ohair@286 4 *
ohair@286 5 * This code is free software; you can redistribute it and/or modify it
ohair@286 6 * under the terms of the GNU General Public License version 2 only, as
ohair@286 7 * published by the Free Software Foundation. Oracle designates this
ohair@286 8 * particular file as subject to the "Classpath" exception as provided
ohair@286 9 * by Oracle in the LICENSE file that accompanied this code.
ohair@286 10 *
ohair@286 11 * This code is distributed in the hope that it will be useful, but WITHOUT
ohair@286 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ohair@286 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
ohair@286 14 * version 2 for more details (a copy is included in the LICENSE file that
ohair@286 15 * accompanied this code).
ohair@286 16 *
ohair@286 17 * You should have received a copy of the GNU General Public License version
ohair@286 18 * 2 along with this work; if not, write to the Free Software Foundation,
ohair@286 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
ohair@286 20 *
ohair@286 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
ohair@286 22 * or visit www.oracle.com if you need additional information or have any
ohair@286 23 * questions.
ohair@286 24 */
ohair@286 25
ohair@286 26 /* this file is generated by RelaxNGCC */
ohair@286 27 package com.sun.xml.internal.xsom.impl.parser.state;
aefimov@1445 28
aefimov@1445 29 import com.sun.xml.internal.bind.WhiteSpaceProcessor;
aefimov@1445 30 import com.sun.xml.internal.xsom.impl.*;
aefimov@1445 31 import com.sun.xml.internal.xsom.impl.parser.*;
aefimov@1445 32 import com.sun.xml.internal.xsom.parser.*;
aefimov@1445 33
aefimov@1445 34 import org.xml.sax.Attributes;
aefimov@1445 35 import org.xml.sax.Locator;
ohair@286 36 import org.xml.sax.SAXException;
ohair@286 37
ohair@286 38 class attributeDeclBody extends NGCCHandler {
ohair@286 39 private String name;
ohair@286 40 private ForeignAttributesImpl fa;
ohair@286 41 private AnnotationImpl annotation;
ohair@286 42 private Locator locator;
ohair@286 43 private boolean isLocal;
ohair@286 44 private String defaultValue;
ohair@286 45 private UName typeName;
ohair@286 46 private String fixedValue;
ohair@286 47 protected final NGCCRuntimeEx $runtime;
ohair@286 48 private int $_ngcc_current_state;
ohair@286 49 protected String $uri;
ohair@286 50 protected String $localName;
ohair@286 51 protected String $qname;
ohair@286 52
ohair@286 53 public final NGCCRuntime getRuntime() {
ohair@286 54 return($runtime);
ohair@286 55 }
ohair@286 56
ohair@286 57 public attributeDeclBody(NGCCHandler parent, NGCCEventSource source, NGCCRuntimeEx runtime, int cookie, Locator _locator, boolean _isLocal, String _defaultValue, String _fixedValue) {
ohair@286 58 super(source, parent, cookie);
ohair@286 59 $runtime = runtime;
ohair@286 60 this.locator = _locator;
ohair@286 61 this.isLocal = _isLocal;
ohair@286 62 this.defaultValue = _defaultValue;
ohair@286 63 this.fixedValue = _fixedValue;
ohair@286 64 $_ngcc_current_state = 13;
ohair@286 65 }
ohair@286 66
ohair@286 67 public attributeDeclBody(NGCCRuntimeEx runtime, Locator _locator, boolean _isLocal, String _defaultValue, String _fixedValue) {
ohair@286 68 this(null, runtime, runtime, -1, _locator, _isLocal, _defaultValue, _fixedValue);
ohair@286 69 }
ohair@286 70
ohair@286 71 private void action0()throws SAXException {
ohair@286 72
ohair@286 73 type = new DelayedRef.SimpleType(
ohair@286 74 $runtime, locator, $runtime.currentSchema, typeName );
ohair@286 75
ohair@286 76 }
ohair@286 77
ohair@286 78 private void action1()throws SAXException {
ohair@286 79 formSpecified = true;
ohair@286 80 }
ohair@286 81
ohair@286 82 public void enterElement(String $__uri, String $__local, String $__qname, Attributes $attrs) throws SAXException {
ohair@286 83 int $ai;
ohair@286 84 $uri = $__uri;
ohair@286 85 $localName = $__local;
ohair@286 86 $qname = $__qname;
ohair@286 87 switch($_ngcc_current_state) {
mkos@397 88 case 0:
mkos@397 89 {
mkos@397 90 revertToParentFromEnterElement(makeResult(), super._cookie, $__uri, $__local, $__qname, $attrs);
mkos@397 91 }
mkos@397 92 break;
mkos@397 93 case 12:
mkos@397 94 {
mkos@397 95 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
mkos@397 96 $runtime.consumeAttribute($ai);
mkos@397 97 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
mkos@397 98 }
mkos@397 99 else {
mkos@397 100 unexpectedEnterElement($__qname);
mkos@397 101 }
mkos@397 102 }
mkos@397 103 break;
ohair@286 104 case 7:
ohair@286 105 {
ohair@286 106 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation"))) {
mkos@397 107 NGCCHandler h = new annotation(this, super._source, $runtime, 388, null,AnnotationContext.ATTRIBUTE_DECL);
ohair@286 108 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
ohair@286 109 }
ohair@286 110 else {
ohair@286 111 $_ngcc_current_state = 1;
ohair@286 112 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
ohair@286 113 }
ohair@286 114 }
ohair@286 115 break;
mkos@397 116 case 9:
ohair@286 117 {
mkos@397 118 if((($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")) || ((($ai = $runtime.getAttributeIndex("","type"))>=0 && (($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType")) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("annotation")))) || ($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))))) {
mkos@397 119 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
mkos@397 120 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
mkos@397 121 }
mkos@397 122 else {
mkos@397 123 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
mkos@397 124 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
mkos@397 125 }
ohair@286 126 }
ohair@286 127 break;
ohair@286 128 case 13:
ohair@286 129 {
ohair@286 130 if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
ohair@286 131 $runtime.consumeAttribute($ai);
ohair@286 132 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
ohair@286 133 }
ohair@286 134 else {
ohair@286 135 $_ngcc_current_state = 12;
ohair@286 136 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
ohair@286 137 }
ohair@286 138 }
ohair@286 139 break;
ohair@286 140 case 1:
ohair@286 141 {
ohair@286 142 if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
ohair@286 143 $runtime.consumeAttribute($ai);
ohair@286 144 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
ohair@286 145 }
ohair@286 146 else {
ohair@286 147 if(($__uri.equals("http://www.w3.org/2001/XMLSchema") && $__local.equals("simpleType"))) {
mkos@397 148 NGCCHandler h = new simpleType(this, super._source, $runtime, 379);
ohair@286 149 spawnChildFromEnterElement(h, $__uri, $__local, $__qname, $attrs);
ohair@286 150 }
ohair@286 151 else {
ohair@286 152 $_ngcc_current_state = 0;
ohair@286 153 $runtime.sendEnterElement(super._cookie, $__uri, $__local, $__qname, $attrs);
ohair@286 154 }
ohair@286 155 }
ohair@286 156 }
ohair@286 157 break;
ohair@286 158 default:
ohair@286 159 {
ohair@286 160 unexpectedEnterElement($__qname);
ohair@286 161 }
ohair@286 162 break;
ohair@286 163 }
ohair@286 164 }
ohair@286 165
ohair@286 166 public void leaveElement(String $__uri, String $__local, String $__qname) throws SAXException {
ohair@286 167 int $ai;
ohair@286 168 $uri = $__uri;
ohair@286 169 $localName = $__local;
ohair@286 170 $qname = $__qname;
ohair@286 171 switch($_ngcc_current_state) {
mkos@397 172 case 0:
mkos@397 173 {
mkos@397 174 revertToParentFromLeaveElement(makeResult(), super._cookie, $__uri, $__local, $__qname);
mkos@397 175 }
mkos@397 176 break;
mkos@397 177 case 12:
mkos@397 178 {
mkos@397 179 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
mkos@397 180 $runtime.consumeAttribute($ai);
mkos@397 181 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
mkos@397 182 }
mkos@397 183 else {
mkos@397 184 unexpectedLeaveElement($__qname);
mkos@397 185 }
mkos@397 186 }
mkos@397 187 break;
ohair@286 188 case 7:
ohair@286 189 {
ohair@286 190 $_ngcc_current_state = 1;
ohair@286 191 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 192 }
ohair@286 193 break;
mkos@397 194 case 9:
ohair@286 195 {
mkos@397 196 if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
mkos@397 197 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
mkos@397 198 spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
mkos@397 199 }
mkos@397 200 else {
mkos@397 201 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
mkos@397 202 spawnChildFromLeaveElement(h, $__uri, $__local, $__qname);
mkos@397 203 }
ohair@286 204 }
ohair@286 205 break;
ohair@286 206 case 13:
ohair@286 207 {
ohair@286 208 if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
ohair@286 209 $runtime.consumeAttribute($ai);
ohair@286 210 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 211 }
ohair@286 212 else {
ohair@286 213 $_ngcc_current_state = 12;
ohair@286 214 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 215 }
ohair@286 216 }
ohair@286 217 break;
ohair@286 218 case 1:
ohair@286 219 {
ohair@286 220 if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
ohair@286 221 $runtime.consumeAttribute($ai);
ohair@286 222 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 223 }
ohair@286 224 else {
ohair@286 225 $_ngcc_current_state = 0;
ohair@286 226 $runtime.sendLeaveElement(super._cookie, $__uri, $__local, $__qname);
ohair@286 227 }
ohair@286 228 }
ohair@286 229 break;
ohair@286 230 default:
ohair@286 231 {
ohair@286 232 unexpectedLeaveElement($__qname);
ohair@286 233 }
ohair@286 234 break;
ohair@286 235 }
ohair@286 236 }
ohair@286 237
ohair@286 238 public void enterAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
ohair@286 239 int $ai;
ohair@286 240 $uri = $__uri;
ohair@286 241 $localName = $__local;
ohair@286 242 $qname = $__qname;
ohair@286 243 switch($_ngcc_current_state) {
mkos@397 244 case 0:
mkos@397 245 {
mkos@397 246 revertToParentFromEnterAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
mkos@397 247 }
mkos@397 248 break;
mkos@397 249 case 12:
mkos@397 250 {
mkos@397 251 if(($__uri.equals("") && $__local.equals("name"))) {
mkos@397 252 $_ngcc_current_state = 11;
mkos@397 253 }
mkos@397 254 else {
mkos@397 255 unexpectedEnterAttribute($__qname);
mkos@397 256 }
mkos@397 257 }
mkos@397 258 break;
ohair@286 259 case 7:
ohair@286 260 {
ohair@286 261 $_ngcc_current_state = 1;
ohair@286 262 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 263 }
ohair@286 264 break;
mkos@397 265 case 9:
ohair@286 266 {
mkos@397 267 if(($__uri.equals("") && $__local.equals("type"))) {
mkos@397 268 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
mkos@397 269 spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
mkos@397 270 }
mkos@397 271 else {
mkos@397 272 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
mkos@397 273 spawnChildFromEnterAttribute(h, $__uri, $__local, $__qname);
mkos@397 274 }
ohair@286 275 }
ohair@286 276 break;
ohair@286 277 case 13:
ohair@286 278 {
ohair@286 279 if(($__uri.equals("") && $__local.equals("form"))) {
ohair@286 280 $_ngcc_current_state = 15;
ohair@286 281 }
ohair@286 282 else {
ohair@286 283 $_ngcc_current_state = 12;
ohair@286 284 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 285 }
ohair@286 286 }
ohair@286 287 break;
ohair@286 288 case 1:
ohair@286 289 {
ohair@286 290 if(($__uri.equals("") && $__local.equals("type"))) {
ohair@286 291 $_ngcc_current_state = 5;
ohair@286 292 }
ohair@286 293 else {
ohair@286 294 $_ngcc_current_state = 0;
ohair@286 295 $runtime.sendEnterAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 296 }
ohair@286 297 }
ohair@286 298 break;
ohair@286 299 default:
ohair@286 300 {
ohair@286 301 unexpectedEnterAttribute($__qname);
ohair@286 302 }
ohair@286 303 break;
ohair@286 304 }
ohair@286 305 }
ohair@286 306
ohair@286 307 public void leaveAttribute(String $__uri, String $__local, String $__qname) throws SAXException {
ohair@286 308 int $ai;
ohair@286 309 $uri = $__uri;
ohair@286 310 $localName = $__local;
ohair@286 311 $qname = $__qname;
ohair@286 312 switch($_ngcc_current_state) {
mkos@397 313 case 0:
ohair@286 314 {
mkos@397 315 revertToParentFromLeaveAttribute(makeResult(), super._cookie, $__uri, $__local, $__qname);
mkos@397 316 }
mkos@397 317 break;
mkos@397 318 case 14:
mkos@397 319 {
mkos@397 320 if(($__uri.equals("") && $__local.equals("form"))) {
mkos@397 321 $_ngcc_current_state = 12;
ohair@286 322 }
ohair@286 323 else {
ohair@286 324 unexpectedLeaveAttribute($__qname);
ohair@286 325 }
ohair@286 326 }
ohair@286 327 break;
ohair@286 328 case 7:
ohair@286 329 {
ohair@286 330 $_ngcc_current_state = 1;
ohair@286 331 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 332 }
ohair@286 333 break;
mkos@397 334 case 10:
ohair@286 335 {
mkos@397 336 if(($__uri.equals("") && $__local.equals("name"))) {
mkos@397 337 $_ngcc_current_state = 9;
mkos@397 338 }
mkos@397 339 else {
mkos@397 340 unexpectedLeaveAttribute($__qname);
mkos@397 341 }
mkos@397 342 }
mkos@397 343 break;
mkos@397 344 case 9:
mkos@397 345 {
mkos@397 346 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
mkos@397 347 spawnChildFromLeaveAttribute(h, $__uri, $__local, $__qname);
ohair@286 348 }
ohair@286 349 break;
ohair@286 350 case 13:
ohair@286 351 {
ohair@286 352 $_ngcc_current_state = 12;
ohair@286 353 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 354 }
ohair@286 355 break;
mkos@397 356 case 1:
ohair@286 357 {
mkos@397 358 $_ngcc_current_state = 0;
mkos@397 359 $runtime.sendLeaveAttribute(super._cookie, $__uri, $__local, $__qname);
ohair@286 360 }
ohair@286 361 break;
ohair@286 362 case 4:
ohair@286 363 {
ohair@286 364 if(($__uri.equals("") && $__local.equals("type"))) {
ohair@286 365 $_ngcc_current_state = 0;
ohair@286 366 }
ohair@286 367 else {
ohair@286 368 unexpectedLeaveAttribute($__qname);
ohair@286 369 }
ohair@286 370 }
ohair@286 371 break;
ohair@286 372 default:
ohair@286 373 {
ohair@286 374 unexpectedLeaveAttribute($__qname);
ohair@286 375 }
ohair@286 376 break;
ohair@286 377 }
ohair@286 378 }
ohair@286 379
ohair@286 380 public void text(String $value) throws SAXException {
ohair@286 381 int $ai;
ohair@286 382 switch($_ngcc_current_state) {
mkos@397 383 case 0:
mkos@397 384 {
mkos@397 385 revertToParentFromText(makeResult(), super._cookie, $value);
mkos@397 386 }
mkos@397 387 break;
mkos@397 388 case 12:
mkos@397 389 {
mkos@397 390 if(($ai = $runtime.getAttributeIndex("","name"))>=0) {
mkos@397 391 $runtime.consumeAttribute($ai);
mkos@397 392 $runtime.sendText(super._cookie, $value);
mkos@397 393 }
mkos@397 394 }
mkos@397 395 break;
ohair@286 396 case 7:
ohair@286 397 {
ohair@286 398 $_ngcc_current_state = 1;
ohair@286 399 $runtime.sendText(super._cookie, $value);
ohair@286 400 }
ohair@286 401 break;
mkos@397 402 case 9:
ohair@286 403 {
mkos@397 404 if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
mkos@397 405 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
mkos@397 406 spawnChildFromText(h, $value);
mkos@397 407 }
mkos@397 408 else {
mkos@397 409 NGCCHandler h = new foreignAttributes(this, super._source, $runtime, 390, fa);
mkos@397 410 spawnChildFromText(h, $value);
mkos@397 411 }
ohair@286 412 }
ohair@286 413 break;
ohair@286 414 case 13:
ohair@286 415 {
ohair@286 416 if(($ai = $runtime.getAttributeIndex("","form"))>=0) {
ohair@286 417 $runtime.consumeAttribute($ai);
ohair@286 418 $runtime.sendText(super._cookie, $value);
ohair@286 419 }
ohair@286 420 else {
ohair@286 421 $_ngcc_current_state = 12;
ohair@286 422 $runtime.sendText(super._cookie, $value);
ohair@286 423 }
ohair@286 424 }
ohair@286 425 break;
mkos@397 426 case 15:
ohair@286 427 {
mkos@397 428 if($value.equals("unqualified")) {
mkos@397 429 NGCCHandler h = new qualification(this, super._source, $runtime, 395);
ohair@286 430 spawnChildFromText(h, $value);
ohair@286 431 }
ohair@286 432 else {
mkos@397 433 if($value.equals("qualified")) {
mkos@397 434 NGCCHandler h = new qualification(this, super._source, $runtime, 395);
mkos@397 435 spawnChildFromText(h, $value);
mkos@397 436 }
ohair@286 437 }
ohair@286 438 }
ohair@286 439 break;
ohair@286 440 case 1:
ohair@286 441 {
ohair@286 442 if(($ai = $runtime.getAttributeIndex("","type"))>=0) {
ohair@286 443 $runtime.consumeAttribute($ai);
ohair@286 444 $runtime.sendText(super._cookie, $value);
ohair@286 445 }
ohair@286 446 else {
ohair@286 447 $_ngcc_current_state = 0;
ohair@286 448 $runtime.sendText(super._cookie, $value);
ohair@286 449 }
ohair@286 450 }
ohair@286 451 break;
mkos@397 452 case 11:
ohair@286 453 {
aefimov@1445 454 name = WhiteSpaceProcessor.collapse($value);
mkos@397 455 $_ngcc_current_state = 10;
mkos@397 456 }
mkos@397 457 break;
mkos@397 458 case 5:
mkos@397 459 {
mkos@397 460 NGCCHandler h = new qname(this, super._source, $runtime, 381);
mkos@397 461 spawnChildFromText(h, $value);
ohair@286 462 }
ohair@286 463 break;
ohair@286 464 }
ohair@286 465 }
ohair@286 466
ohair@286 467 public void onChildCompleted(Object $__result__, int $__cookie__, boolean $__needAttCheck__)throws SAXException {
ohair@286 468 switch($__cookie__) {
mkos@397 469 case 388:
ohair@286 470 {
ohair@286 471 annotation = ((AnnotationImpl)$__result__);
ohair@286 472 $_ngcc_current_state = 1;
ohair@286 473 }
ohair@286 474 break;
mkos@397 475 case 379:
mkos@397 476 {
mkos@397 477 type = ((SimpleTypeImpl)$__result__);
mkos@397 478 $_ngcc_current_state = 0;
mkos@397 479 }
mkos@397 480 break;
mkos@397 481 case 390:
mkos@397 482 {
mkos@397 483 fa = ((ForeignAttributesImpl)$__result__);
mkos@397 484 $_ngcc_current_state = 7;
mkos@397 485 }
mkos@397 486 break;
mkos@397 487 case 395:
ohair@286 488 {
ohair@286 489 form = ((Boolean)$__result__).booleanValue();
ohair@286 490 action1();
ohair@286 491 $_ngcc_current_state = 14;
ohair@286 492 }
ohair@286 493 break;
mkos@397 494 case 381:
ohair@286 495 {
ohair@286 496 typeName = ((UName)$__result__);
ohair@286 497 action0();
ohair@286 498 $_ngcc_current_state = 4;
ohair@286 499 }
ohair@286 500 break;
ohair@286 501 }
ohair@286 502 }
ohair@286 503
ohair@286 504 public boolean accepted() {
mkos@397 505 return((($_ngcc_current_state == 0) || (($_ngcc_current_state == 1) || ($_ngcc_current_state == 7))));
ohair@286 506 }
ohair@286 507
ohair@286 508
ohair@286 509 private boolean form;
ohair@286 510 private boolean formSpecified = false;
ohair@286 511
ohair@286 512 private AttributeDeclImpl makeResult() {
ohair@286 513
ohair@286 514 if(type==null)
ohair@286 515 // type defaults to anySimpleType
ohair@286 516 type = $runtime.parser.schemaSet.anySimpleType;
ohair@286 517
ohair@286 518 if(!formSpecified) form = $runtime.attributeFormDefault;
ohair@286 519 // global attributes are always qualified
ohair@286 520 if(!isLocal) form = true;
ohair@286 521
ohair@286 522 String tns;
ohair@286 523 if(form==true) tns = $runtime.currentSchema.getTargetNamespace();
ohair@286 524 else tns = "";
ohair@286 525
ohair@286 526 // proper handling of anonymous types
ohair@286 527 return new AttributeDeclImpl( $runtime.document, tns, name,
ohair@286 528 annotation, locator, fa, isLocal,
ohair@286 529 $runtime.createXmlString(defaultValue),
ohair@286 530 $runtime.createXmlString(fixedValue),
ohair@286 531 type );
ohair@286 532 }
ohair@286 533 private Ref.SimpleType type;
ohair@286 534
ohair@286 535 }

mercurial