[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Evaluating an expression as an XPath expression

Subject: Evaluating an expression as an XPath expression
From: Mark Feblowitz <mfeblowitz@xxxxxxxxxxxxxxxx>
Date: Fri, 21 Dec 2001 16:40:27 -0500
evaluating the 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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.