PostGIS  3.3.9dev-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 159 of file lwgeom_in_kml.c.

160 {
161  xmlNsPtr *ns, *p;
162 
163  ns = xmlGetNsList(xnode->doc, xnode);
164  /*
165  * If no namespace is available we could return true anyway
166  * (because we work only on KML fragment, we don't want to
167  * 'oblige' to add namespace on the geometry root node)
168  */
169  if (ns == NULL) return !is_strict;
170 
171  for (p=ns ; *p ; p++)
172  {
173  if ((*p)->href == NULL || (*p)->prefix == NULL ||
174  xnode->ns == NULL || xnode->ns->prefix == NULL) continue;
175 
176  if (!xmlStrcmp(xnode->ns->prefix, (*p)->prefix))
177  {
178  if (!strcmp((char *) (*p)->href, KML_NS))
179  {
180  xmlFree(ns);
181  return true;
182  } else {
183  xmlFree(ns);
184  return false;
185  }
186  }
187  }
188 
189  xmlFree(ns);
190  return !is_strict; /* Same reason here to not return false */;
191 }
#define KML_NS
Definition: lwgeom_in_kml.c:64

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: