Hi all,
I am implementing a search page in my application, which queries an external exist db. I want to know is there a way to use the &= operator that is used in some of the sandbox examples that come with exist? (As i want to be able to search a node of the xml document by keyword) Currently the xslt processor to build the query I send to exist looks like this: <p:processor name="oxf:xslt"> <p:input name="data" href="#instance"/> <p:input name="config"> <xdb:query collection="/db" create-collection="true" xsl:version="2.0"> xquery version "1.0"; <document-infos> { for $d in /document-info[.//jelr:subject &= '<xsl:value-of select="instance//subject"/>'] order by xs:dateTime($d/document-date) descending return $d } </document-infos> </xdb:query> </p:input> <p:output name="data" id="query"/> </p:processor> This is throwing an XmlRpcException : unexpected char: '&' I have also tried enclosing &= in an xsl text element as follows: <xsl:text disable-output-escaping="yes">&=</xsl:text> but this doesnt work.. Any ideas? |
To get around this I normally assign & to a variable <xsl:variable name="amp">&</xsl:variable> then use value-of to apply it <xsl:value-of select="$amp"/> This might work in you case, otherwise you will have to double escape it with &amp; HTH Ryan
Ryan Puddephatt Fiona Murphy wrote: Hi all, I am implementing a search page in my application, which queries an external exist db. I want to know is there a way to use the &= operator that is used in some of the sandbox examples that come with exist? (As i want to be able to search a node of the xml document by keyword) Currently the xslt processor to build the query I send to exist looks like this: <!-- Dynamically build query --> <p:processor name="oxf:xslt"> <p:input name="data" href="#instance"/> <p:input name="config"> <xdb:query collection="/db" create-collection="true" xsl:version="2.0"> xquery version "1.0"; <document-infos> { for $d in /document-info[.//jelr:subject &= '<xsl:value-of select="instance//subject"/>'] order by xs:dateTime($d/document-date) descending return $d } </document-infos> </xdb:query> </p:input> <p:output name="data" id="query"/> </p:processor> This is throwing an XmlRpcException : unexpected char: '&' I have also tried enclosing &= in an xsl text element as follows: <xsl:text disable-output-escaping="yes">&=</xsl:text> but this doesnt work.. Any ideas? -- You receive this message as a subscriber of the [hidden email] mailing list. To unsubscribe: mailto:[hidden email] For general help: mailto:[hidden email]?subject=help ObjectWeb mailing lists service home page: http://www.objectweb.org/wws |
Ryan,
I've discovered that the xquery contains function achieves what I want as well. Thanks for your suggestions, Fiona Fiona
|
Free forum by Nabble | Edit this page |