xsl-list
[Top] [All Lists]

Re: [xsl] multiple input document question

2008-07-16 19:23:26
I am trying to allow the first document to supply a path to the second
document.  For example, all @menu elements from the first document have
an attribute @id.  That could be /complete/xpath/here.  So the concatenation
I'm looking for in that example is document('f1.xml')/complete/xpath/here, which
does work when the xpath is not a variable.

-g


On Wed, Jul 16, 2008 at 9:20 PM, Tony Nassar 
<tnassar(_at_)palantirtech(_dot_)com> wrote:
What are you actually trying to do? The document f1.xml has only one document 
element, so what is $id supposed to mean in document('f1.xml')/$id? If, 
alternately, you want an element with the same name as $id, that's 
*[local-name() eq $id]

-----Original Message-----
From: Greg Fausak [mailto:lgfausak(_at_)gmail(_dot_)com]
Sent: Wednesday, July 16, 2008 7:17 PM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] multiple input document question

Hi,

I'm wondering if there is any way to do the following:

<xsl:template match="*[(_at_)menu]">
       <xsl:variable name="id" select="@id"/>
       <xsl:for-each select="document('f1.xml')/$id">
...

I've tried all sorts of combinations.

I guess I can create an xslt output document
with the for-each statement selecting by the
value of the other document and just run
it through xslt twice.  It just starts getting a little
weird then!

Thanks!
-g


--
Greg Fausak
greg(_at_)thursday(_dot_)com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





-- 
Greg Fausak
greg(_at_)thursday(_dot_)com

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--