public final String getDefaultedAttribute( String namespaceURI, String attrName, String defaultValue ) { String v = getAttribute(namespaceURI,attrName); if(v!=null) return v; else return defaultValue; } }
protected String getNamespace() { final String ns = startTag.getAttribute("ns"); final boolean global = "true".equals(startTag.getAttribute("global")); if( ns!=null ) return ns; // "ns" attribute always has precedence. // if global="true" is specified, it defaults to propagated ns attribute. if( global ) return ((TREXBaseReader)reader).targetNamespace; // otherwise, it defaults to "" return ""; }
public final String getCollapsedAttribute( String attrName ) { String s = getAttribute(attrName); if(s==null) return null; return WhiteSpaceProcessor.collapse(s); }
public final String getCollapsedAttribute( String attrName ) { String s = getAttribute(attrName); if(s==null) return null; return WhiteSpaceProcessor.collapse(s); }
public final String getCollapsedAttribute( String attrName ) { String s = getAttribute(attrName); if(s==null) return null; return WhiteSpaceProcessor.collapse(s); }
protected void startSelf() { super.startSelf(); // if memberTypes attribute is used, load it. String memberTypes = startTag.getAttribute("memberTypes"); if(memberTypes!=null) { StringTokenizer tokens = new StringTokenizer(memberTypes); while( tokens.hasMoreTokens() ) onEndChild( ((XSDatatypeResolver)reader) .resolveXSDatatype(tokens.nextToken()) ); } }
protected XSDatatypeExp annealType( final XSDatatypeExp dt ) { final String finalValueStr = startTag.getAttribute("final"); if(finalValueStr!=null) { final int finalValue = getFinalValue(finalValueStr); // create a new type by adding final constraint. return dt.createFinalizedType(finalValue,reader); } else return dt; }
protected State createChildState( StartTagInfo tag ) { // accepts elements from the same namespace only. if( !startTag.namespaceURI.equals(tag.namespaceURI) ) return null; final String name = startTag.getAttribute("name"); String uri = getTargetNamespaceUri(); if( tag.localName.equals("annotation") ) return new IgnoreState(); if( tag.localName.equals("restriction") ) return new RestrictionState(uri,name); if( tag.localName.equals("list") ) return new ListState(uri,name); if( tag.localName.equals("union") ) return new UnionState(uri,name); return null; // unrecognized }
protected State createChildState( StartTagInfo tag ) { // accepts elements from the same namespace only. if( !startTag.namespaceURI.equals(tag.namespaceURI) ) return null; final String name = startTag.getAttribute("name"); String uri = getTargetNamespaceUri(); if( tag.localName.equals("annotation") ) return new IgnoreState(); if( tag.localName.equals("restriction") ) return new RestrictionState(uri,name); if( tag.localName.equals("list") ) return new ListState(uri,name); if( tag.localName.equals("union") ) return new UnionState(uri,name); return null; // unrecognized }
protected State createChildState( StartTagInfo tag ) { // accepts elements from the same namespace only. if( !startTag.namespaceURI.equals(tag.namespaceURI) ) return null; final String name = startTag.getAttribute("name"); String uri = getTargetNamespaceUri(); if( tag.localName.equals("annotation") ) return new IgnoreState(); if( tag.localName.equals("restriction") ) return new RestrictionState(uri,name); if( tag.localName.equals("list") ) return new ListState(uri,name); if( tag.localName.equals("union") ) return new UnionState(uri,name); return null; // unrecognized }
protected void startSelf() { super.startSelf(); final RELAXCoreReader reader = (RELAXCoreReader)this.reader; // existance of type attribute has already checked before // this state is created. incubator = reader.resolveXSDatatype(startTag.getAttribute("type")) .createIncubator(); }
protected void startSelf() { super.startSelf(); // if the base attribute is used, try to load it. String base = startTag.getAttribute("base"); if(base!=null) onEndChild( ((XSDatatypeResolver)reader).resolveXSDatatype(base) ); }
protected void startSelf() { super.startSelf(); final RELAXCoreReader reader = (RELAXCoreReader)this.reader; // existance of type attribute has already checked before // this state is created. incubator = reader.resolveXSDatatype(startTag.getAttribute("type")) .createIncubator(); }
protected void startSelf() { super.startSelf(); final RELAXCoreReader reader = (RELAXCoreReader)this.reader; // existance of type attribute has already checked before // this state is created. incubator = reader.resolveXSDatatype(startTag.getAttribute("type")) .createIncubator(); }
protected void startSelf() { super.startSelf(); final RELAXCoreReader reader = (RELAXCoreReader)this.reader; String type = startTag.getAttribute("type"); if(type==null) type="string"; incubator = reader.resolveXSDatatype(type).createIncubator(); }
protected Expression annealExpression( Expression exp ) { final String name = startTag.getAttribute("name"); if(name!=null) { // name attribute is optional. ReferenceExp ref = getReader().grammar.namedPatterns.getOrCreate(name); ref.exp = exp; exp = ref; } getReader().grammar.exp = exp; return null; // return value is meaningless. } }
protected void startSelf() { super.startSelf(); // if the base attribute is used, try to load it. String base = startTag.getAttribute("base"); if(base!=null) onEndChild( ((XSDatatypeResolver)reader).resolveXSDatatype(base) ); }
protected void startSelf() { super.startSelf(); // if itemType attribute is used, use it. String itemType = startTag.getAttribute("itemType"); if(itemType!=null) onEndChild( ((XSDatatypeResolver)reader).resolveXSDatatype(itemType) ); }
protected void startSelf() { super.startSelf(); final RELAXCoreReader reader = (RELAXCoreReader)this.reader; String type = startTag.getAttribute("type"); if(type==null) type="string"; incubator = reader.resolveXSDatatype(type).createIncubator(); }
protected void switchSource( State sourceState, State newRootState ) throws AbortException { final String schemaLocation = sourceState.getStartTag().getAttribute("schemaLocation"); if(schemaLocation==null) { // schemaLocation attribute is required. reportError( ERR_MISSING_ATTRIBUTE, sourceState.getStartTag().qName, "schemaLocation" ); // recover by ignoring this element } else // parse specified file switchSource( sourceState, schemaLocation, newRootState ); }