Hi Antonio,

Could you attach your SLD?... i'll try to reproduce the issue and figure 
out what the offending code is.

Thanks,
Cory.

----

Antonio Grassi wrote:

> Hello. I've a problem generating the XML of a SLD from instances of 
> styles using the SLDTransformer. In some point in my code, I have 
> something like this:
>
> SLDParser sldParser = new SLDParser(new StyleFactoryImpl());
> FilterFactory ff = new FilterFactoryImpl();
> FeatureTypeStyle fts;
> Style style;
> SLDTransformer sldTransformer = new SLDTransformer();
>
>
> CompareFilter f = ff.createCompareFilter(Filter.COMPARE_NOT_EQUALS);
> LiteralExpression val = 
> ff.createLiteralExpression(DELETED_ATTRIBUTE);   // DELETED_ATTRIBUTE 
> and MODIFIED_ATTR are constants defined elsewhere
> f.addLeftValue(ff.createAttributeExpression(MODIFIED_ATTR));
> f.addRightValue(val);
>
>
> sldParser.setInput(url);                    // A predefined URL
> style = sldParser.readXML()[0];
>
> fts = style.getFeatureTypeStyles()[0];
> rule = fts.getRules()[0];
> rule.setFilter(f);
>
> sldTransformer.transform(style, fileWriter); // fileWriter created 
> elsewhere
>
>
> Well, when I look into the generated XML, in the section corresponding 
> to the added filter, i get
>
> <ogc:Filter>
>    <ogc:null>
>       <ogc:PropertyName>modified</ogc:PropertyName>
>       <ogc:Literal>3</ogc:Literal>
>    </ogc:null>
> </ogc:Filter>
>
> where, I think, <ogc:null> should be <ogc:PropertyIsEqualTo>
>
> When I parse the XML, an exception is thrown and I can't load the style.
>
> Has anyone ever had this problem before? I have no idea if it's 
> something i'm making wrong or no. I'm using geotools 2.2RC3.
>
> Thanks very much,
> Antonio Grassi




-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to