public QName getRequiredNodeAsQName( OMElement context, XPath xpath ) throws XMLParsingException { QName value = getNodeAsQName( context, xpath, null ); if ( value == null ) { String msg = "Required element/node '" + xpath + "' (starting from '" + context.getQName() + "') is missing."; throw new XMLParsingException( this, context, msg ); } return value; }
private QName determineTargetElementXGml( XMLAdapter annotationXML ) { NamespaceBindings nsContext = new NamespaceBindings(); nsContext.addNamespace( "xs", CommonNamespaces.XSNS ); QName refElement = annotationXML.getNodeAsQName( annotationXML.getRootElement(), new XPath( "xs:appinfo[@source='urn:x-gml:targetElement']/text()", nsContext ), null ); if ( refElement != null ) { LOG.trace( "Identified a target element annotation (urn:x-gml style)." ); } return refElement; }
private QName determineTargetElementGml32( XMLAdapter annotationXML ) { NamespaceBindings nsContext = new NamespaceBindings(); nsContext.addNamespace( "xs", CommonNamespaces.XSNS ); nsContext.addNamespace( "gml", GML3_2_NS ); QName refElement = annotationXML.getNodeAsQName( annotationXML.getRootElement(), new XPath( "xs:appinfo/gml:targetElement/text()", nsContext ), null ); if ( refElement != null ) { LOG.trace( "Identified a target element annotation (GML 3.2 style)." ); } return refElement; }
private QName determineTargetElementAdv( XMLAdapter annotationXML ) { NamespaceBindings nsContext = new NamespaceBindings(); nsContext.addNamespace( "xs", CommonNamespaces.XSNS ); nsContext.addNamespace( "adv", "http://www.adv-online.de/nas" ); QName refElement = annotationXML.getNodeAsQName( annotationXML.getRootElement(), new XPath( "xs:appinfo/adv:referenziertesElement/text()", nsContext ), null ); if ( refElement != null ) { LOG.trace( "Identified a target element annotation (adv style)." ); } return refElement; }
private FeaturePropertyType buildFeaturePropertyTypeXGml( QName ptName, XSElementDeclaration elementDecl, XSComplexTypeDefinition typeDef, int minOccurs, int maxOccurs, List<PropertyType> ptSubstitutions, XMLAdapter annotationXML ) { // handle schemas that use a source="urn:x-gml:targetElement" attribute // for defining the referenced feature type // inside the annotation element (e.g. CITE examples for WFS 1.1.0) NamespaceBindings nsContext = new NamespaceBindings(); nsContext.addNamespace( "xs", CommonNamespaces.XSNS ); QName refElement = annotationXML.getNodeAsQName( annotationXML.getRootElement(), new XPath( "xs:appinfo[@source='urn:x-gml:targetElement']/text()", nsContext ), null ); if ( refElement != null ) { LOG.debug( "Identified a feature property (urn:x-gml:targetElement)." ); FeaturePropertyType pt = new FeaturePropertyType( ptName, minOccurs, maxOccurs, elementDecl, ptSubstitutions, refElement, ValueRepresentation.BOTH ); return pt; } return null; }
private FeaturePropertyType buildFeaturePropertyTypeAdv( QName ptName, XSElementDeclaration elementDecl, XSComplexTypeDefinition typeDef, int minOccurs, int maxOccurs, List<PropertyType> ptSubstitutions, XMLAdapter annotationXML ) { // handle adv schemas (referenced feature type inside annotation // element) NamespaceBindings nsContext = new NamespaceBindings(); nsContext.addNamespace( "xs", CommonNamespaces.XSNS ); nsContext.addNamespace( "adv", "http://www.adv-online.de/nas" ); QName refElement = annotationXML.getNodeAsQName( annotationXML.getRootElement(), new XPath( "xs:appinfo/adv:referenziertesElement/text()", nsContext ), null ); if ( refElement != null ) { LOG.trace( "Identified a feature property (adv style)." ); FeaturePropertyType pt = new FeaturePropertyType( ptName, minOccurs, maxOccurs, elementDecl, ptSubstitutions, refElement, ValueRepresentation.BOTH ); return pt; } return null; }
private FeaturePropertyType buildFeaturePropertyTypeGML32( QName ptName, XSElementDeclaration elementDecl, XSComplexTypeDefinition typeDef, int minOccurs, int maxOccurs, List<PropertyType> ptSubstitutions, XMLAdapter annotationXML ) { // handle GML 3.2 schemas (referenced feature type inside annotation element) NamespaceBindings nsContext = new NamespaceBindings(); nsContext.addNamespace( "xs", CommonNamespaces.XSNS ); nsContext.addNamespace( "gml", GML3_2_NS ); QName refElement = annotationXML.getNodeAsQName( annotationXML.getRootElement(), new XPath( "xs:appinfo/gml:targetElement/text()", nsContext ), null ); if ( refElement != null ) { LOG.trace( "Identified a feature property (GML 3.2 style)." ); // TODO determine this properly ValueRepresentation vp = ValueRepresentation.REMOTE; FeaturePropertyType pt = new FeaturePropertyType( ptName, minOccurs, maxOccurs, elementDecl, ptSubstitutions, refElement, vp ); return pt; } return null; }