This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Problem Merging multiple XML files



hmm.. off the top of my head..  have you made sure March2001.dat is in the
same directory as picture.xml?

-----Original Message-----
From: owner-xsl-list@lists.mulberrytech.com
[mailto:owner-xsl-list@lists.mulberrytech.com]On Behalf Of Hewko, Doug
Sent: Wednesday, September 05, 2001 10:16 AM
To: 'xsl-list@lists.mulberrytech.com'
Subject: [xsl] Problem Merging multiple XML files


I'm building an XML-based photo album (for fun) and ran into a problem. I am
wondering what I am doing wrong. I converted a big XML file into multiple
ones and do not know why I am not getting any output.

I have an XML document that contains the information for the pictures. It
works great as one file. The problem is that there are over 200 pictures,
and this text file is becoming awkward to manage. Plus, I would like to put
it on the Internet (baby pictures) and I have to break the pictures up due
to size restrictions. I thought of converting my picture XML file into
multiple ones that I can import as I see fit.

When I look at the merged XML document in IE, the structure looks identical
to my original big file, with of course the exception of a DOCTYPE
declaration. My XSL remained the same.

Does merging the files create a new structure that is only internally
visible? Or does MSXML display merged files properly but cannot process
them?

I am using MSXML. I know, it's very limited, but it should still work.

Here's my original XML: picture.xml
<?xml version="1.0" standalone="no"?>
<PICTUREGALLERY>
<PICTURE>
<DATETAKEN>
<YEAR>2001</YEAR>
<MONTH>02</MONTH>
<DAY>03</DAY>
</DATETAKEN>
<THUMBNAIL>
<SOURCE>Thumbnail/20010203 - Baby Shower 2.JPG</SOURCE>
<CAPTION>Baby Shower</CAPTION>
</THUMBNAIL>
<BIGPHOTO>
<SOURCE>Photos/20010203 - Baby Shower 2.JPG</SOURCE>
<CAPTION>A friend held a baby shower for us at her home. The house was very
nicely decorated and it was very enjoyable.</CAPTION>
</BIGPHOTO>
</PICTURE>
<PICTURE>

Here is what I converted it to: picture.xml
<?xml version="1.0"?>
<!DOCTYPE PICTUREGALLERY [
<!ENTITY MARCH2001 SYSTEM "March2001.dat">
]>
<PICTUREGALLERY>
&MARCH2001;
</PICTUREGALLERY>

and here's the input file... March2001.dat
<PICTURE>
<DATETAKEN>
<YEAR>2001</YEAR>
<MONTH>02</MONTH>
<DAY>03</DAY>
</DATETAKEN>
<THUMBNAIL>
<SOURCE>Thumbnail/20010203 - Baby Shower 2.JPG</SOURCE>
<CAPTION>Baby Shower</CAPTION>
</THUMBNAIL>
<BIGPHOTO>
<SOURCE>Photos/20010203 - Baby Shower 2.JPG</SOURCE>
<CAPTION>A friend held a baby shower for us at her home. The house was very
nicely decorated and it was very enjoyable.</CAPTION>
</BIGPHOTO>
</PICTURE>
<PICTURE>

XSL file:
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="uri:xsl">

<xsl:template match="/">
<xsl:for-each select="PICTUREGALLERY/PICTURE" order-by="+DATETAKEN">
	    <center>
		<xsl:apply-templates />
		<hr /><br />
		</center>
</xsl:for-each>
</xsl:template>

<xsl:template match="THUMBNAIL">
     <img>
	 <xsl:attribute name="onmouseover">
	 showBig('&quot;<xsl:value-of
select="../BIGPHOTO/SOURCE"/>&quot;',&quot;<xsl:value-of
select="../BIGPHOTO/CAPTION"/>&quot;);
	 </xsl:attribute>
	 <xsl:attribute name="src">
     <xsl:value-of select="SOURCE"/>
 	 </xsl:attribute>
	 </img><br />
	 <xsl:value-of select="CAPTION"/><BR />
	 <small><small>Taken: (<xsl:value-of
select="../DATETAKEN"/>)</small></small>
</xsl:template>

</xsl:stylesheet>

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]