xsl-list
[Top] [All Lists]

Re: [xsl] xsltproc and multiple input files

2006-04-10 09:01:38
xsltproc   ../xslt/update-phys-interfaces.xsl    /tmp/foo2.xml 
../etc/server.xml

So you're applying the transformation to both files and producing the
result I believe.  I'm not an expert in xsltproc.

I want to access elements in the first XML file from templates matching
elements in the second XML file.

Ok, so if I'm picturing this right you would have two trees in memory
and you want to process just one via the templates and use the other
as some sort of reference.

 I'd like to use syntax like this while
processing templates matching elements in the <server> node tree:
  <xsl:when test="(physInterfaceBus =
//physDiscoveredInterfaceTable/physDiscoveredInterfaceTableRow/physDiscoveredInterfaceBus)">
 rather than use the document() function to load a file directly.

Ummm, well, you could use modes and documents to do what you want. 
But if you're not allowing the use of document I'm not sure that
there's any way to do what you want.  (Not that it's necessarily a bad
idea)  There might be a way to do this in XSLT 2.0.

Any help is greatly appreciated.

If you're worried about not specifying the file name until runtime,
you could do one of two things: pass the filename in as a parameter or
generate the stylesheet and then run the xml input against it.

So the param approach might be something like <xsl:value-of
select='document($myfile)/foo/bar' />

If xsltproc does have the functionality two load in two XML docs at
one time but you can't get it to work you might want to try the
resources on their "Getting Help" page
(http://xmlsoft.org/XSLT/bugs.html).

=================================================================
For small problems you can try to get help on IRC, the #xml channel on
irc.gnome.org (port 6667) usually have a few person subscribed which
may help (but there is no garantee and if a real issue is raised it
should go on the mailing-list for archival).

There is also a mailing-list xslt(_at_)gnome(_dot_)org for libxslt, with an
on-line archive. To subscribe to this list, please visit the
associated Web page and follow the instructions.

==================================================================

If you want advice on how to do this via XSLT (most likely the
document command you've already ruled out) this is the place to do it.
 If you're trying to figure out some sort of xsltproc-only behavior,
some other resources might be more useful to you.

Jon Gorman

--~------------------------------------------------------------------
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>
--~--

<Prev in Thread] Current Thread [Next in Thread>