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

RE: seamless processing of multiple XML fragments

Subject: RE: seamless processing of multiple XML fragments
From: "Sullivan, Dan" <dsullivan@xxxxxxxxxxx>
Date: Mon, 3 Sep 2001 12:05:20 -0700
include xml fragments
You can just add a template to your stylesheet that processes your
include elements. Here, for example, is a stylesheet that does an
identity transform with any depth of includes in your sample files.
Replace the identity transform with your own templates and you need not
be concerned about the include elements. 

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0">

  <xsl:output method="xml" indent="yes" />
  <xsl:strip-space elements="*"/>

  <xsl:template match="include">
    <xsl:apply-templates select="document(@file)/*"/>
  </xsl:template>

  <xsl:template match="node()|@*">
    <xsl:copy>
      <xsl:apply-templates select="node()|@*"/>
    </xsl:copy>
  </xsl:template>
</xsl:stylesheet>


Dan

-----Original Message-----
From: Dan Diebolt [mailto:dandiebolt@xxxxxxxxx]
Sent: Monday, September 03, 2001 2:28 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  seamless processing of multiple XML fragments


I have some xml that looks like this conceptually:

 <root>
  <a>
   <b>B</b>
   <c>
    <d>D</d>
    <e>E</e>
    <f>F</f>
   </c>
  </a>
  <g>
   <h>H</h>
   <i>I</i>
  </g>
 </root>

However, the XML is actually stored in two files:

 File1.xml:
 <root>
  <a>
   <b>B</b>
   <include file="File2.xml"/>
  </a>
  <g>
   <h>H</h>
   <i>I</i>
  </g>
 </root>

 File2.xml:
 <c>
  <d>D</d>
  <e>E</e>
  <f>F</f>
 </c>

The tag <include file="File2.xml"/> conceptually shows where the xml 
fragment in the second file should be inserted into xml fragment in 
the first file. I could accept any mechanism that allows this type
of insertion. Here is my questions to the list: Is there a way to
implement this so that the XSLT processing is seamless? I don;t
want to concern myself with tracing nested includes in writing the
XSLT. Your help is appreciated.

Regards,

Dan


__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo!
Messenger
http://im.yahoo.com

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


 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.