Skip to content
Permalink
Browse files
SLD parsing: handling ogc:Literal within CssParameter
  • Loading branch information
jgrocha authored and rldhont committed Jan 23, 2017
1 parent 538b7c9 commit 6f09793c465ae5629e62a68a4d2e3474e765333a
Showing with 18 additions and 1 deletion.
  1. +18 −1 src/core/symbology-ng/qgssymbollayerv2utils.cpp
@@ -2655,14 +2655,31 @@ QDomElement QgsSymbolLayerV2Utils::createSvgParameterElement( QDomDocument &doc,
QgsStringMap QgsSymbolLayerV2Utils::getSvgParameterList( QDomElement &element )
{
QgsStringMap params;
QString value;

QDomElement paramElem = element.firstChildElement();
while ( !paramElem.isNull() )
{
if ( paramElem.localName() == "SvgParameter" || paramElem.localName() == "CssParameter" )
{
QString name = paramElem.attribute( "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() == "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 6f09793

Please sign in to comment.