[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Evaluating an expression as an XPath expression
A familiar problem: What's the difference between: <xsl:variable name="oexpr">//PO</xsl:variable> <xsl:if test="saxon:eval(saxon:expression($oexpr))"> <p>Found it: <xsl:value-of select="$oexpr"/></p> </xsl:if> and <xsl:for-each select="document(VC.xml')//Expr"> <xsl:variable name="expr"><xsl:value-of select="."/></xsl:variable> <xsl:if test="saxon:eval(saxon:expression($expr))"> <p>Found it: <xsl:value-of select="$expr"/></p> </xsl:if> </xsl:for-each> where VC.xml contains <Exprs> <Expr>//PO</Expr> </Exprs> ? I can't seem to make the two tests come out the same (both positive when the XML file being processed has a PO element and both negative when it doesn't). The first seems to work; the second (with document()) fails. As usual, I suspect that I'm hitting the familiar node-set versus tree-fragment versus string-value-of-text-node thing. So my question is, what kind of thing is in $oexpr and which is in $expr? Thanks Mark ---------------------------------------------------------------------------- ---- Mark Feblowitz [t] 617.715.7231 Frictionless Commerce Incorporated [f] 617.495.0188 XML Architect [e] mfeblowitz@xxxxxxxxxxxxxxxx 400 Technology Square, 9th Floor Cambridge, MA 02139 www.frictionless.com XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|