/** Imports the specified schema. */ public void importSchema( String ns, String schemaLocation ) throws SAXException { NGCCRuntimeEx newRuntime = new NGCCRuntimeEx(parser,false,this); InputSource source = resolveRelativeURL(ns,schemaLocation); if(source!=null) newRuntime.parseEntity( source, false, ns, getLocator() ); // if source == null, // we can't locate this document. Let's just hope that // we already have the schema components for this schema // or we will receive them in the future. }
public BaseContentRef(final NGCCRuntimeEx $runtime, Ref.Type _baseType) { this.baseType = _baseType; $runtime.addPatcher(this); $runtime.addErrorChecker(new Patch() { public void run() throws SAXException { XSType t = baseType.getType(); if (t.isComplexType() && t.asComplexType().getContentType().asParticle()!=null) { $runtime.reportError( Messages.format(Messages.ERR_SIMPLE_CONTENT_EXPECTED, t.getTargetNamespace(), t.getName()), loc); } } }); this.loc = $runtime.copyLocator(); }
private void action0()throws SAXException { locator = $runtime.copyLocator(); parser = $runtime.createAnnotationParser(); $runtime.redirectSubtree(parser.getContentHandler( context, $runtime.getAnnotationContextElementName(), $runtime.getErrorHandler(), $runtime.parser.getEntityResolver() ), $uri, $localName, $qname ); }
public void text(String $value) throws SAXException { int $ai; switch($_ngcc_current_state) { case 2: { $_ngcc_current_state = 1; $runtime.sendText(super._cookie, $value); } break; case 0: { revertToParentFromText(this, super._cookie, $value); } break; case 5: { schemaLocation = $value; $_ngcc_current_state = 4; } break; case 6: { if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) { $runtime.consumeAttribute($ai); $runtime.sendText(super._cookie, $value); } } break; } }
public ForeignAttributesImpl parseForeignAttributes( ForeignAttributesImpl next ) { ForeignAttributesImpl impl = new ForeignAttributesImpl(createValidationContext(),copyLocator(),next); Attributes atts = getCurrentAttributes(); for( int i=0; i<atts.getLength(); i++ ) { if(atts.getURI(i).length()>0) { impl.addAttribute( atts.getURI(i), atts.getLocalName(i), atts.getQName(i), atts.getType(i), atts.getValue(i) ); } } return impl; }
private void action0()throws SAXException { result = new FacetImpl( $runtime.document, annotation, locator, fa, $localName/*name of the facet*/, $runtime.createXmlString(value), $runtime.parseBoolean(fixed) ); }
private XPathImpl makeResult() { return new XPathImpl($runtime.document,ann,$runtime.copyLocator(),fa, $runtime.createXmlString(xpath)); }
private void action3()throws SAXException { $runtime.checkDoubleDefError( $runtime.currentSchema.getAttributeDecl(ad.getName()) ); $runtime.currentSchema.addAttributeDecl(ad); }
private void action7()throws SAXException { locator=$runtime.copyLocator(); use=null; defaultValue=null; fixedValue=null; decl=null; annotation=null; }
private void action4()throws SAXException { if("prohibited".equals(use)) owner.addProhibitedAttribute(attDeclName); else owner.addAttributeUse(attDeclName, new AttributeUseImpl( $runtime.document, annotation,locator,fa,decl, $runtime.createXmlString(defaultValue), $runtime.createXmlString(fixedValue), "required".equals(use))); }
public XmlString createXmlString(String value) { if(value==null) return null; else return new XmlString(value,createValidationContext()); }
public NGCCRuntimeEx newNGCCRuntime() { return new NGCCRuntimeEx(this); }
public void text(String $value) throws SAXException { int $ai; switch($_ngcc_current_state) { case 2: { $_ngcc_current_state = 1; $runtime.sendText(super._cookie, $value); } break; case 0: { revertToParentFromText(this, super._cookie, $value); } break; case 5: { schemaLocation = $value; $_ngcc_current_state = 4; } break; case 6: { if(($ai = $runtime.getAttributeIndex("","schemaLocation"))>=0) { $runtime.consumeAttribute($ai); $runtime.sendText(super._cookie, $value); } } break; } }
public ForeignAttributesImpl parseForeignAttributes( ForeignAttributesImpl next ) { ForeignAttributesImpl impl = new ForeignAttributesImpl(createValidationContext(),copyLocator(),next); Attributes atts = getCurrentAttributes(); for( int i=0; i<atts.getLength(); i++ ) { if(atts.getURI(i).length()>0) { impl.addAttribute( atts.getURI(i), atts.getLocalName(i), atts.getQName(i), atts.getType(i), atts.getValue(i) ); } } return impl; }
private void action0()throws SAXException { result = new FacetImpl( $runtime.document, annotation, locator, fa, $localName/*name of the facet*/, $runtime.createXmlString(value), $runtime.parseBoolean(fixed) ); }
private XPathImpl makeResult() { return new XPathImpl($runtime.document,ann,$runtime.copyLocator(),fa, $runtime.createXmlString(xpath)); }
private void action6()throws SAXException { $runtime.checkDoubleDefError( $runtime.currentSchema.getType(st.getName()) ); $runtime.currentSchema.addSimpleType(st,false); }
private void action4()throws SAXException { locator = $runtime.copyLocator(); defaultValue = null; fixedValue = null; }
private void action4()throws SAXException { if("prohibited".equals(use)) owner.addProhibitedAttribute(attDeclName); else owner.addAttributeUse(attDeclName, new AttributeUseImpl( $runtime.document, annotation,locator,fa,decl, $runtime.createXmlString(defaultValue), $runtime.createXmlString(fixedValue), "required".equals(use))); }
public XmlString createXmlString(String value) { if(value==null) return null; else return new XmlString(value,createValidationContext()); }