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

Including Files

Subject: Including Files
From: Nathan Shaw <n8_shaw@xxxxxxxxx>
Date: Wed, 10 Jul 2002 05:51:37 -0700 (PDT)
with no containing element
They are indeed xml fragments. Most of them are valid
xml documents, as they contain a complete table, tr or
td, but some of them only contain a list of a href's
with no containing element.

I cannot put any kind of container element around
them, as they will be used as simple includes by other
applications. Well, I could and make the other apps
parse them, but why do that if I can avoid it
(Although now, I think I am going to make them valid
xml documents by moving some wrapping code -table, tr,
td - into the files so that I can use document())?

I did not want to use entities because I am trying to
keep the app as dynamic as possible. If I use
entities, and the client wants to add a new section to
the site that needs a new header, footer or
navigation, I have to go in and add them in as
entities to the XSLT.

Instead, I have chosen to use a naming convention
based off of the directory name to include the files.
Something like:

<xsl:copy-of
select="document(concat('http://xxx.xx.xxx.xxx/',$FileDir,'/TopNav_',$FileDir,'.xml'))/table"
/>

$FileDir is the parent directory of the file, which I
am getting by using the Saxon extension function
system-id() (Thanks Mike!).

If I do it this way, as long as the client sticks to
the naming convention, he can add new directories and
sections to the site without calling me! All he has to
do is create a new header, footer, topnav and leftnav
file for the new section.

I hope that clears it up a bit. Sorry for the delay in
responding, but I am a digester. If anyone can see
potential problems with this approach, please do let
me know! I want to do this right and I know that this
list is the place to find out what 'right' is when it
comes to XSL!

--Nate


> XHTML is an XML reformulation of HTML, and hence an
XHTML 
> document is an XML document.  What do you mean by
not having 
> a containing element?  Are you saying that the file
does not 
> have a root <html> element?  If so, it sounds like
your files 
> contain XML fragments, and there's no XSLT way to
load those. 
> You certainly could do so with an extension
function.

Well, he could load them as external entities. I can't
understand his
argument for not using that option.





__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.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.