[mapguide-users] Custom Search
Kenneth Skovhede, GEOGRAF A/S
ks at geograf.dk
Fri Jan 30 03:50:44 EST 2009
Yes, but once you have the full Xml, you can load it into an Xml parser.
It looks like you are using C#, so the code would be:
XmlDocument doc = new XmlDocument();
XmlNode node = doc.SelectSingleNode("xs:Filter", namespacemanager);
//You need to setup the namespace manager.
string filter = node.InnerText; //Here it is
If you are using C#, you may want to look at the MaestroAPI:
Using the MaestroAPI, you can read the filter like this:
ServerConnectionI con; //Read the docs on how to initialize this
LayerDefinition ldef = con.GetLayerDefinition("Library://" +
myLayer.GetLayerDefinition().GetPath() + "/" + myLayer.GetName() +
VectorLayerDefinition vldef = ldef.Item as VectorLayerDefinition;
string filter = vldef.Filter; //Here it is
IMO, much easier, and no use of the Mg* classes.
Regards, Kenneth Skovhede, GEOGRAF A/S
> Thanks for the response, I am still working on my programming I am unsure on
> how to read through what I belive is a mgByteReader that the resource
> perhaps I can use the mgLayer.SelectFeatures(mgQueryOptions) however this
> returns a null exception... :(
> MgResourceIdentifier myresrc = new
> MgResourceIdentifier("Library://" + myLayer.GetLayerDefinition().GetPath() +
> "/" + myLayer.GetName() + ".LayerDefinition");
> MgByteReader rd = resourceSrvc.GetResourceContent(myresrc);
> This writes out the entire XML File... how can I just return the Filter ? or
> do I have to do some string work here?
More information about the mapguide-users