<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
What do you mean?<br>
<br>
The result of that operation is a string.<br>
All strings can be encoded into xml.<br>
<pre class="moz-signature" cols="72">Regards, Kenneth Skovhede, GEOGRAF A/S
</pre>
<br>
<br>
irwan skrev:
<blockquote cite="mid:1232001637742-2161106.post@n2.nabble.com"
type="cite">
<pre wrap="">Kenneth,
howdy...everything is fine but, i can't encode 'ID IN ('.$res.')'. What
should i do now
irwan wrote:
</pre>
<blockquote type="cite">
<pre wrap="">wow many thanks!! you help me a lot.
Kenneth Skovhede, GEOGRAF A/S wrote:
</pre>
<blockquote type="cite">
<pre wrap="">This is the filter:
$QueryFilter='Drawing+%3D+%26apos%3B74%26apos%3B+AND+Dept+%3D+%26apos%3B136%26apos%3B'
For some reason the PHP xml system does not seem to autoencode the
stuff, you must xml encode your input.
I don't know why the above is url encoded though.
The un-encoded filter should look like:
$QueryFilter = 'Drawing = "3B74" AND Dept = "3B136"'
The Xml encoded version should look like this:
$QueryFilter = 'Drawing = &quot;3B74&quot; AND Dept = &quot;3B136&quot;'
No expert on PHP functions, but I found this to help you out:
<a class="moz-txt-link-freetext" href="http://vantol.org/node/31">http://vantol.org/node/31</a>
The $QueryFilter is the string you should change to match your list of
values.
Build the list like this:
$res = '';
while(odbc_fetch_row($rs))
{
        $bl_id=odbc_result($rs,"bl_id");
        $res .= $bl_id;
        $res .= ',';
}
$res = substr($res, 0, -1); //Remove the last ,
$QueryFilter = xmlencode('ID IN ('.$res.')');
(Note: If the values are not integers, they have to be surrounded with
quotes).
(Note: You filter column in the SDF may not be called ID).
(Note: xmlencode is the function from the link given)
Regards, Kenneth Skovhede, GEOGRAF A/S
irwan skrev:
</pre>
<blockquote type="cite">
<pre wrap="">Kenneth Skovhede, GEOGRAF A/S wrote:
</pre>
<blockquote type="cite">
<pre wrap="">IIRC, something is broken, so you can't filter on a joined database.
Instead, you can select keys from the database with an sql like this:
select distinct key from table where somecolumn = 'somecriteria';
The sql should then give you a list of keys.
You can then set the layer filter like this:
"ID" IN (...comma seperated key list...)
ea: "ID" IN ('1','A')
Regards, Kenneth Skovhede, GEOGRAF A/S
</pre>
</blockquote>
<pre wrap=""> i really stucked! really dont have an idea to change Filter element in
xml.what i want to know here is how to pass a value that i get from sql
query(php) to xml?i have create a php script, a very simple one to query
data from database.
$wr_selected="SELECT * FROM wr WHERE bl_id = 'Rev";
$rs=odbc_exec($conn,$wr_selected);
while(odbc_fetch_row($rs))
{
$bl_id=odbc_result($rs,"bl_id");
}
currently $bl_id hold a value that satisfy a query. So i want this value
put
into the <Filter></Filter> element in xml file such as <Filter>BL_ID IN
$bl_id</Filter> but i know this is something we cannot do.
I look at this code from
$QueryFilter='Drawing+%3D+%26apos%3B74%26apos%3B+AND+Dept+%3D+%26apos%3B136%26apos%3B'
// Load the Query Match Layer Definition template into a PHP DOM
object
and
// modify its Filter node so we're displaying the right building and
floor.
$doc = DOMDocument::load('QueryMatch.LayerDefinition.xml');
$FilterNode = $doc->getElementsByTagName('Filter')->item(0);
$FilterNode->nodeValue = $QueryFilter;
$LayerDefinition = $doc->saveXML();
$byteSource = new MgByteSource($LayerDefinition,
strlen($LayerDefinition));
$byteSource->SetMimeType(MgMimeType::Xml);
$tempResourceID = new
MgResourceIdentifier("Library://HumboldtFM/Layers/QueryMatch.LayerDefinition");
$resourceService->SetResource($tempResourceID,
$byteSource->GetReader(),
null);
but i really dont know that to do with this code. Can someone here
assist
me?
</pre>
</blockquote>
<pre wrap="">_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>