xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] divide info in several output files


Subject: Re: [xsl] divide info in several output files
From: cutlass <cutlass@xxxxxxxxxxx>
Date: Thu, 01 Mar 2001 16:35:59 +0000

hello everybody;

I don`t know how to face this problem:

one xml file with a long list of items (28 i.e.)
<whatever>
  <anything>ryur54wrthigyuif</anything>
  <anything>ryureicnsd45gkjuif</anything>
  <anything>ihdftuiwtusd78yrt</anything>
  <anything>..................
</whatever


there are a few methods for this, i will give you some places to start (there are certainely better ways, but it sounds like you are just starting )


A) arrange your xml file in the format ( or break them up ) in the way you want, with your first stylesheet so the output looks like below and then parse with a 2nd stylesheet to create your display ( this is a 2 pass solution)


-----------------------------------------------------------------------
xml file 1
<page>

 <anything>ryur54wrthigyuif</anything>
 <anything>ryureicnsd45gkjuif</anything>
 <anything>ihdftuiwtusd78yrt</anything>
 <anything>..................</anything>
</page>

xml file 2
<page>

 <anything>ryur54wrthigyuif</anything>
 <anything>ryureicnsd45gkjuif</anything>
 <anything>ihdftuiwtusd78yrt</anything>
 <anything>..................</anything>
</page>

-----------------------------------------------------------------------

B) supply your stylesheet with a parameter (u can supply a param to a stylesheet, depends on which parser u are using, then use test condition in your
<xsl:apply-templates> to select whatever elements which are greater then or less then 'start' and 'end' ( remember u cant use < or > use &lt or &gt entities in tests )



xsl ------------------------------- <xsl:param name="start"></xsl:param> <xsl:param name="end"></xsl:param>


xml -------------------------------- <whatever>

 <anything n="1">ryur54wrthigyuif</anything>
 <anything n="2">ryureicnsd45gkjuif</anything>
 <anything n="3">ihdftuiwtusd78yrt</anything>
 <anything n="4">..................</anything>

</whatever>

you can use method A ( with one xml output ) by supplying a parameter to display stylesheet such as <xsl:param name="page"></xsl:param>
<page n="1">


 <anything>ryur54wrthigyuif</anything>
 <anything>ryureicnsd45gkjuif</anything>
 <anything>ihdftuiwtusd78yrt</anything>
 <anything>..................</anything>
</page>
<page n="2">

 <anything>ryur54wrthigyuif</anything>
 <anything>ryureicnsd45gkjuif</anything>
 <anything>ihdftuiwtusd78yrt</anything>
 <anything>..................</anything>
</page>


once u get it with these examples, there are other xsl techniques using ID, IDREFs and Keys.



cheers,jim



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




Current Thread
Keywords
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor