From cullenr at imagemattersllc.com Thu Jun 15 14:38:45 2017 From: cullenr at imagemattersllc.com (Cullen Rombach) Date: Thu, 15 Jun 2017 17:38:45 -0400 Subject: [geotk] How to Get Namespaces from SLD API Message-ID: Hello all, I am currently working with the Geotoolkit SLD API, and I would like to know if it is possible to get the namespace context of an SLD or SE document, specifically Expression and Filter elements, either in a key-value map or otherwise. In instances where there is a PropertyName present, there is often an XPath with a namespace prefix. I would like to be able to access the associated namespace declaration so that I can resolve the XPath later on. Thank you, Cullen Rombach -- Cullen Rombach Image Matters LLC www.imagemattersllc.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From johann.sorel at geomatys.com Fri Jun 16 02:20:01 2017 From: johann.sorel at geomatys.com (johann sorel) Date: Fri, 16 Jun 2017 11:20:01 +0200 Subject: [geotk] How to Get Namespaces from SLD API In-Reply-To: References: Message-ID: Hello Cullen, Thank you for using GeotoolKit (and for the metadata work on SIS). The current SLD/SE decoder (and API) do not provide the namespace/prefix mapping sorry. Rather then providing a Map (or similar) on the root style objects I think i would be more appropriate to resolve the prefixes in the PropertyName value when the xml is parsed. This way the PropertyName would be self-sufficient. This operation would happen in the two classes : - org.geotoolkit.ogc.xml.OGC100toGTTransformer#visitPropertyName - org.geotoolkit.ogc.xml.OGC110toGTTransformer#visitPropertyName The problem is with JAXB, we need to find a way to grab the namespace/prefix map for the object somehow, I haven't search for a long time but if you found out how to do it that would make thinks easier (Maybe there is something more to explore with com.sun.xml.bind.marshaller.NamespacePrefixMapper). In the mean time you can use the expanded form for your xpath. example : /{http://test.com}attCpx/{http://test.com}attString Johann On 15/06/2017 23:38, Cullen Rombach wrote: > Hello all, > > I am currently working with the Geotoolkit SLD API, and I would like > to know if it is possible to get the namespace context of an SLD or SE > document, specifically Expression and Filter elements, either in a > key-value map or otherwise. > > In instances where there is a PropertyName present, there is often an > XPath with a namespace prefix. I would like to be able to access the > associated namespace declaration so that I can resolve the XPath later on. > > Thank you, > Cullen Rombach > > -- > Cullen Rombach > Image Matters LLC > www.imagemattersllc.com > > > _______________________________________________ > Geotoolkit mailing list > Geotoolkit at lists.osgeo.org > https://lists.osgeo.org/mailman/listinfo/geotoolkit -- -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature_Agro2.png Type: image/png Size: 46154 bytes Desc: not available URL: