Refine search
mStartTag.reinit(uri, localName, qname, mAttributeProxy, this);
public final String getDefaultedAttribute( String namespaceURI, String attrName, String defaultValue ) { String v = getAttribute(namespaceURI,attrName); if(v!=null) return v; else return defaultValue; } }
public final String getDefaultedAttribute( String namespaceURI, String attrName, String defaultValue ) { String v = getAttribute(namespaceURI,attrName); if(v!=null) return v; else return defaultValue; } }
protected void startSelf() { super.startSelf(); final String value = startTag.getAttribute("value"); if( value==null ) { reader.reportError( GrammarReader.ERR_MISSING_ATTRIBUTE, startTag.localName, "value" ); // recover by ignoring this facet. } else { try { ((FacetStateParent)parentState).getIncubator().addFacet( startTag.localName, value, "true".equals(startTag.getAttribute("fixed")), reader ); } catch( DatatypeException e ) { reader.reportError( e, GrammarReader.ERR_BAD_TYPE, e.getMessage() ); // recover by ignoring this facet } } } }
protected void startSelf() { final RELAXNGReader reader = (RELAXNGReader)this.reader; super.startSelf(); final String localName = startTag.getCollapsedAttribute("type"); if( localName==null ) { reader.reportError( RELAXNGReader.ERR_MISSING_ATTRIBUTE, "data", "type" ); } else { // create a type incubator baseTypeName = new StringPair( reader.datatypeLibURI, localName ); try { typeBuilder = reader.getCurrentDatatypeLibrary().createDatatypeBuilder(localName); } catch( DatatypeException dte ) { reader.reportError( RELAXNGReader.ERR_UNDEFINED_DATATYPE_1, localName, dte.getMessage() ); } } if( typeBuilder==null ) { // if an error is encountered, then typeIncubator field is left null. // In that case, set a dummy implementation so that the successive param // statements are happy. typeBuilder = ErrorDatatypeLibrary.theInstance; } }
public final void startElement( String namespaceURI, String localName, String qName, Attributes atts ) {// within the island of XSD, foreign namespaces are prohibited. final StartTagInfo tag = new StartTagInfo( namespaceURI,localName,qName,new AttributesImpl(atts),(IDContextProvider2)null); // we have to copy Attributes, otherwise it will be mutated by SAX parser State nextState = createChildState(tag); if(nextState!=null) { reader.pushState(nextState,this,tag); return; } // unacceptable element reader.reportError(GrammarReader.ERR_MALPLACED_ELEMENT, tag.qName ); // try to recover from error by just ignoring it. // element of a foreign namespace. skip subtree reader.pushState(new IgnoreState(),this,tag); } }
protected Expression castExpression( Expression halfCastedExpression, Expression newChildExpression ) { if( startTag.containsAttribute("ref") ) reader.reportError( XMLSchemaReader.ERR_MORE_THAN_ONE_CHILD_EXPRESSION ); if( halfCastedExpression==null ) return newChildExpression; // the first one. return reader.pool.createSequence( newChildExpression, halfCastedExpression ); }
/** * * @return null in case of error. */ protected ReferenceExp getReference() { final String name = startTag.getCollapsedAttribute("name"); if(name==null) { // name attribute is required. reader.reportError( TREXBaseReader.ERR_MISSING_ATTRIBUTE, "ref","name"); return null; } final TREXBaseReader reader = (TREXBaseReader)this.reader; return reader.grammar.namedPatterns.getOrCreate(name); }
protected Expression makeExpression() { final RELAXNGReader reader = (RELAXNGReader)this.reader; String typeName = startTag.getCollapsedAttribute("type"); e.printStackTrace(); throw new InternalError();
public final String getDefaultedAttribute( String attrName, String defaultValue ) { return getDefaultedAttribute("",attrName,defaultValue); }
protected void startSelf() { super.startSelf(); final String value = startTag.getAttribute("value"); if( value==null ) { reader.reportError( GrammarReader.ERR_MISSING_ATTRIBUTE, startTag.localName, "value" ); // recover by ignoring this facet. } else { try { ((FacetStateParent)parentState).getIncubator().addFacet( startTag.localName, value, "true".equals(startTag.getAttribute("fixed")), reader ); } catch( DatatypeException e ) { reader.reportError( e, GrammarReader.ERR_BAD_TYPE, e.getMessage() ); // recover by ignoring this facet } } } }
protected void startSelf() { final RELAXNGReader reader = (RELAXNGReader)this.reader; super.startSelf(); final String localName = startTag.getCollapsedAttribute("type"); if( localName==null ) { reader.reportError( RELAXNGReader.ERR_MISSING_ATTRIBUTE, "data", "type" ); } else { // create a type incubator baseTypeName = new StringPair( reader.datatypeLibURI, localName ); try { typeBuilder = reader.getCurrentDatatypeLibrary().createDatatypeBuilder(localName); } catch( DatatypeException dte ) { reader.reportError( RELAXNGReader.ERR_UNDEFINED_DATATYPE_1, localName, dte.getMessage() ); } } if( typeBuilder==null ) { // if an error is encountered, then typeIncubator field is left null. // In that case, set a dummy implementation so that the successive param // statements are happy. typeBuilder = ErrorDatatypeLibrary.theInstance; } }
public final void startElement( String namespaceURI, String localName, String qName, Attributes atts ) {// within the island of XSD, foreign namespaces are prohibited. final StartTagInfo tag = new StartTagInfo( namespaceURI,localName,qName,new AttributesImpl(atts)); // we have to copy Attributes, otherwise it will be mutated by SAX parser State nextState = createChildState(tag); if(nextState!=null) { reader.pushState(nextState,this,tag); return; } // unacceptable element reader.reportError(GrammarReader.ERR_MALPLACED_ELEMENT, tag.qName ); // try to recover from error by just ignoring it. // element of a foreign namespace. skip subtree reader.pushState(new IgnoreState(),this,tag); } }
protected Expression castExpression( Expression halfCastedExpression, Expression newChildExpression ) { if( startTag.containsAttribute("ref") ) reader.reportError( XMLSchemaReader.ERR_MORE_THAN_ONE_CHILD_EXPRESSION ); if( halfCastedExpression==null ) return newChildExpression; // the first one. return reader.pool.createSequence( newChildExpression, halfCastedExpression ); }
/** * * @return null in case of error. */ protected ReferenceExp getReference() { final String name = startTag.getCollapsedAttribute("name"); if(name==null) { // name attribute is required. reader.reportError( TREXBaseReader.ERR_MISSING_ATTRIBUTE, "ref","name"); return null; } final TREXBaseReader reader = (TREXBaseReader)this.reader; return reader.grammar.namedPatterns.getOrCreate(name); }
public final String getDefaultedAttribute( String attrName, String defaultValue ) { return getDefaultedAttribute("",attrName,defaultValue); }
protected void startSelf() { super.startSelf(); final String value = startTag.getAttribute("value"); if( value==null ) { reader.reportError( GrammarReader.ERR_MISSING_ATTRIBUTE, startTag.localName, "value" ); // recover by ignoring this facet. } else { try { ((FacetStateParent)parentState).getIncubator().addFacet( startTag.localName, value, "true".equals(startTag.getAttribute("fixed")), reader ); } catch( DatatypeException e ) { reader.reportError( e, GrammarReader.ERR_BAD_TYPE, e.getMessage() ); // recover by ignoring this facet } } } }
protected void startSelf() { final RELAXNGReader reader = (RELAXNGReader)this.reader; super.startSelf(); final String localName = startTag.getCollapsedAttribute("type"); if( localName==null ) { reader.reportError( RELAXNGReader.ERR_MISSING_ATTRIBUTE, "data", "type" ); } else { // create a type incubator baseTypeName = new StringPair( reader.datatypeLibURI, localName ); try { typeBuilder = reader.getCurrentDatatypeLibrary().createDatatypeBuilder(localName); } catch( DatatypeException dte ) { reader.reportError( RELAXNGReader.ERR_UNDEFINED_DATATYPE_1, localName, dte.getMessage() ); } } if( typeBuilder==null ) { // if an error is encountered, then typeIncubator field is left null. // In that case, set a dummy implementation so that the successive param // statements are happy. typeBuilder = ErrorDatatypeLibrary.theInstance; } }
/** @deprecated */ public StartTagInfo( String namespaceURI, String localName, String qName, Attributes attributes, IDContextProvider context ) { reinit(namespaceURI,localName,qName,attributes,context); }
public final void startElement( String namespaceURI, String localName, String qName, Attributes atts ) {// within the island of XSD, foreign namespaces are prohibited. final StartTagInfo tag = new StartTagInfo( namespaceURI,localName,qName,new AttributesImpl(atts)); // we have to copy Attributes, otherwise it will be mutated by SAX parser State nextState = createChildState(tag); if(nextState!=null) { reader.pushState(nextState,this,tag); return; } // unacceptable element reader.reportError(GrammarReader.ERR_MALPLACED_ELEMENT, tag.qName ); // try to recover from error by just ignoring it. // element of a foreign namespace. skip subtree reader.pushState(new IgnoreState(),this,tag); } }