Subject: Re: [xsl] Importing multiple XML files into one XML file From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Tue, 06 Apr 2004 13:31:36 -0400 |
I want to use XML as a template for an application data source. Now the problem I have come across is the increasing size of the XML files and I was wondering whether there is an elegant way in which I can organise my files.
For instance if I have a an XML file such as "employees.xml":
<?--employees.xml--> <EMPLOYEES>
<OFFICE name="Town Hall">
<EMPLOYEE> <NAME>Jo Blogs</NAME> <DOB>1-12-1980</DOB> </EMPLOYEE>
</OFFICE>
</EMPLOYEES>
Now say I would like to create another file "employee.xml" and use it to store the data currently in the <EMPLOYEE> tag instead of craming everything into the "employees.xml" file
and then (I dont know how...) call this file from the main file: "employees.xml" file.
Is there a way I could achieve this?
T:\ftemp>type employees.xml <!DOCTYPE EMPLOYEES [ <!ENTITY emp-stuff SYSTEM "employee.xml"> ]> <EMPLOYEES>
T:\ftemp>type employee.xml <EMPLOYEE> <NAME>Jo Blogs</NAME> <DOB>1-12-1980</DOB> </EMPLOYEE>
T:\ftemp>type chisanga.xsl <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="@*|node()"><!--identity for all other nodes--> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template>
</xsl:stylesheet> T:\ftemp>saxon employees.xml chisanga.xsl <?xml version="1.0" encoding="utf-8"?><EMPLOYEES>
<EMPLOYEE> <NAME>Jo Blogs</NAME> <DOB>1-12-1980</DOB> </EMPLOYEE>
</EMPLOYEES> T:\ftemp>
-- Public courses: Spring 2004 world tour of hands-on XSL instruction Each week: Monday-Wednesday: XSLT/XPath; Thursday-Friday: XSL-FO Hong Kong May 17-21; Bremen Germany May 24-28; Helsinki June 14-18
World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Selecting Top 10, Michael Kay | Thread | Re: [xsl] Importing multiple XML fi, Chisanga Mwelwa |
RE: [xsl] Comparing grouping techni, Michael Kay | Date | Re: [xsl] DOCTYPE causes appearance, Eliot Kimber |
Month |