[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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('"<xsl:value-of select="../BIGPHOTO/SOURCE"/>"',"<xsl:value-of select="../BIGPHOTO/CAPTION"/>"); </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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|