Hi,
I am tring to put together a simple XML based search engine. At the moment this is a cimbination of a XML file and some ASP to load and check the contents of the MXL for matches.
However I would like to somehow filter the data in the XML based on the search criteria entered by a user. so for example, if I searched on the keyword Error on the URL elements it would create XML with only one element:
<CODE>
<SOURCE ID="1">
<LANGUAGE>VB</LANGUAGE>
<KEYWORDS>ADO CONNECTION OBJECT</KEYWORDS>
<PATH>../Connection.html</PATH>
<URL>connection</URL>
<DESCRIPTION>Simple Source for a generic ADO connection to SQL Server</DESCRIPTION>
</SOURCE>
<SOURCE ID="2">
<LANGUAGE>VB</LANGUAGE>
<KEYWORDS>ADO COMMAND OBJECT</KEYWORDS>
<PATH>../Connection.html</PATH>
<URL>command</URL>
<DESCRIPTION>Simple Source for a generic ADO command with parameterised query variables</DESCRIPTION>
</SOURCE>
<SOURCE ID="3">
<LANGUAGE>VB</LANGUAGE>
<KEYWORDS>ERROR MODULE</KEYWORDS>
<PATH>../Connection.html</PATH>
<URL>Error</URL>
<DESCRIPTION>Source for a generic Error Module</DESCRIPTION>
</SOURCE>
</CODE>
I have tried a number of implementations.
1. Trying to use selectnode on the xml file. The problem here is syntax, I have tried everything I know to date with constant failure.
2. Try a conditional select in the XSL file. I hardcoded values into the XSL which worked.
<xsl:for-each select="CODE/SOURCE[URL$lt$'Error']">
<tr>
<td bgcolor = "Yellow"><xsl:value-of select="URL"/></td>
<td bgcolor = "Yellow"><xsl:value-of select="DESCRIPTION"/></td>
</tr>
</xsl:for-each>
However I don't know how to pass parameters ( the search string ) to XSL, or how to search for the occurence of the search string in a larger string ( similar to VB inst function )
Any help on any of these issues is greatly appreciated.
Lenin.
I am tring to put together a simple XML based search engine. At the moment this is a cimbination of a XML file and some ASP to load and check the contents of the MXL for matches.
However I would like to somehow filter the data in the XML based on the search criteria entered by a user. so for example, if I searched on the keyword Error on the URL elements it would create XML with only one element:
<CODE>
<SOURCE ID="1">
<LANGUAGE>VB</LANGUAGE>
<KEYWORDS>ADO CONNECTION OBJECT</KEYWORDS>
<PATH>../Connection.html</PATH>
<URL>connection</URL>
<DESCRIPTION>Simple Source for a generic ADO connection to SQL Server</DESCRIPTION>
</SOURCE>
<SOURCE ID="2">
<LANGUAGE>VB</LANGUAGE>
<KEYWORDS>ADO COMMAND OBJECT</KEYWORDS>
<PATH>../Connection.html</PATH>
<URL>command</URL>
<DESCRIPTION>Simple Source for a generic ADO command with parameterised query variables</DESCRIPTION>
</SOURCE>
<SOURCE ID="3">
<LANGUAGE>VB</LANGUAGE>
<KEYWORDS>ERROR MODULE</KEYWORDS>
<PATH>../Connection.html</PATH>
<URL>Error</URL>
<DESCRIPTION>Source for a generic Error Module</DESCRIPTION>
</SOURCE>
</CODE>
I have tried a number of implementations.
1. Trying to use selectnode on the xml file. The problem here is syntax, I have tried everything I know to date with constant failure.
2. Try a conditional select in the XSL file. I hardcoded values into the XSL which worked.
<xsl:for-each select="CODE/SOURCE[URL$lt$'Error']">
<tr>
<td bgcolor = "Yellow"><xsl:value-of select="URL"/></td>
<td bgcolor = "Yellow"><xsl:value-of select="DESCRIPTION"/></td>
</tr>
</xsl:for-each>
However I don't know how to pass parameters ( the search string ) to XSL, or how to search for the occurence of the search string in a larger string ( similar to VB inst function )
Any help on any of these issues is greatly appreciated.
Lenin.