Skip to content
Permalink
Browse files

SLD parsing: handling ogc:Literal within CssParameter

  • Loading branch information
jgrocha committed Jan 15, 2017
1 parent 5abe66b commit 6ba303e3ad076a0286363d7ec78a9e50e804170f
Showing with 18 additions and 1 deletion.
  1. +18 −1 src/core/symbology-ng/qgssymbollayerutils.cpp
@@ -2566,14 +2566,31 @@ QDomElement QgsSymbolLayerUtils::createSvgParameterElement( QDomDocument &doc, c
QgsStringMap QgsSymbolLayerUtils::getSvgParameterList( QDomElement &element )
{
QgsStringMap params;
QString value;

QDomElement paramElem = element.firstChildElement();
while ( !paramElem.isNull() )
{
if ( paramElem.localName() == QLatin1String( "SvgParameter" ) || paramElem.localName() == QLatin1String( "CssParameter" ) )
{
QString name = paramElem.attribute( QStringLiteral( "name" ) );
QString value = paramElem.firstChild().nodeValue();
if (paramElem.firstChild().nodeType() == QDomNode::TextNode)
{
value = paramElem.firstChild().nodeValue();
}
else
{
if (paramElem.firstChild().nodeType() == QDomNode::ElementNode &&
paramElem.firstChild().localName() == QLatin1String("Literal"))
{
QgsDebugMsg(paramElem.firstChild().localName());
value = paramElem.firstChild().firstChild().nodeValue();
}
else
{
QgsDebugMsg(QString("unexpected child of %1").arg(paramElem.localName()));
}
}

if ( !name.isEmpty() && !value.isEmpty() )
params[ name ] = value;

0 comments on commit 6ba303e

Please sign in to comment.
You can’t perform that action at this time.