xsl-list
[Top] [All Lists]

RE: Importing external XML documents into an XML doc?

2004-11-17 12:23:08
Thank you very much, and I've done it for myself too, as in separated out
the main menu of my website into a common file... it would really be an
unfortunate step back if this was not made possible...

-----Original Message-----
From: JBryant(_at_)s-s-t(_dot_)com [mailto:JBryant(_at_)s-s-t(_dot_)com] 
Sent: Thursday, November 18, 2004 2:51 AM
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: Re: [xsl] Importing external XML documents into an XML doc?

Hi, Wong,

I have a situation where I create a document that describes stored 
procedures for an SQL database. Some of the content (related procedures, 
related tables and so on for each procedure) comes from one XML file 
(dynamically generated by a script), but the actual procedure descriptions 
come from another file XML file (static and maintained by me). The 
document() function solves the problem for me, as shown below:

<xsl:apply-templates 
select="document($descFile)//procedure[(_at_)name=$name]/description"/>

As you can see, I've got some other things going on there (such as getting 
the name of the file from a stylesheet parameter and matching the name of 
the procedure in one document to the name of the procedure in the second 
document. Still, I hope it may give you an insight into one use of the 
document() function.

Jay Bryant
Bryant Communication Services




"Wong Chin Shin" <publicbbs(_at_)nascencetech(_dot_)com> 
11/17/2004 12:37 PM
Please respond to
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com


To
<xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
cc

Subject
[xsl] Importing external XML documents into an XML doc?






Hi,

According to http://www.w3.org/TR/1999/REC-xslt-19991116#function-document 
,
we're allowed to access XML docs other than the main source doc. I assume
that this means we can import an external set of nodes into the current 
node
tree? How would this be implemented? Searched around for examples but
haven't been able to find any so far. And I've been lousy at understanding
the W3C doc (I need real life samples, sigh).

This feature would be useful 'cos I would be able to segregate common info
such as a website's main menu into a common file w/o maintaining a 
different
set in each XML file. Yeah, I could do this at a separate layer such as 
the
PHP engine generating the XML files but for a simple static site I would
prefer to do this non-programatically.

Would appreciate any pointers on this, thanks in advance!
Wong




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






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