PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ is_kml_namespace()

static bool is_kml_namespace ( xmlNodePtr  xnode,
bool  is_strict 
)
static

Return false if current element namespace is not a KML one Return true otherwise.

Definition at line 142 of file lwgeom_in_kml.c.

143 {
144  xmlNsPtr *ns, *p;
145 
146  ns = xmlGetNsList(xnode->doc, xnode);
147  /*
148  * If no namespace is available we could return true anyway
149  * (because we work only on KML fragment, we don't want to
150  * 'oblige' to add namespace on the geometry root node)
151  */
152  if (ns == NULL) return !is_strict;
153 
154  for (p=ns ; *p ; p++)
155  {
156  if ((*p)->href == NULL || (*p)->prefix == NULL ||
157  xnode->ns == NULL || xnode->ns->prefix == NULL) continue;
158 
159  if (!xmlStrcmp(xnode->ns->prefix, (*p)->prefix))
160  {
161  if (!strcmp((char *) (*p)->href, KML_NS))
162  {
163  xmlFree(ns);
164  return true;
165  } else {
166  xmlFree(ns);
167  return false;
168  }
169  }
170  }
171 
172  xmlFree(ns);
173  return !is_strict; /* Same reason here to not return false */;
174 }
#define KML_NS
Definition: lwgeom_in_kml.c:67

References KML_NS.

Referenced by parse_kml(), parse_kml_coordinates(), parse_kml_multi(), and parse_kml_polygon().

Here is the caller graph for this function: