public Resource parse ( XmlPullParser xpp ) throws IOException , FHIRFormatError , XmlPullParserException { if ( xpp . getNamespace ( ) == null ) throw new FHIRFormatError ( "This does not appear to be a FHIR resource (no namespace '" + xpp . getNamespace ( ) + "') (@ /) " + Integer . toString ( xpp . getEventType ( ) ) ) ; if ( ! xpp . getNamespace ( ) . equals ( FHIR_NS ) ) throw new FHIRFormatError ( "This does not appear to be a FHIR resource (wrong namespace '" + xpp . getNamespace ( ) + "') (@ /)" ) ; return parseResource ( xpp ) ; }
parse xml that is known to be a resource and that is already being read by an XML Pull Parser This is if a resource is in a bigger piece of XML .