RE: [xsl] document function issue...

Subject: RE: [xsl] document function issue...
From: "Markus Gamperl" <markus.gamperl@xxxxxx>
Date: Tue, 8 Jun 2004 11:24:43 +0200 (MEST)
Hello Michael!

Here is the xml-file which should be processed (index.xml):

<?xml version="1.0" encoding="UTF-8"?>
<index>
  <h1>
   <h2>
    <h3>
     <url page_id="tcm:581-3711964">
       ./chapter1/subchapter1/section1/page.xml
     </url>
    </h3>
    <h3>
     <url page_id="tcm:581-37120-64">
       ./chapter1/subchapter1/section2/page.xml</url>
    </h3>
   </h2>
</h1>
</index>

And here is the Stylesheet which is used (merge_xml.xslt):

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:saxon="http://saxon.sf.net/"; extension-element-prefixes="saxon"
xmlns:fo="http://www.w3.org/1999/XSL/Format";
xmlns:tcm="http://www.tridion.com/ContentManager/5.0";
xmlns:xlink="http://www.w3.org/1999/xlink";>
	
        <xsl:template match="index">
		<xsl:apply-templates/>
	</xsl:template>
	<!--
	-->
	<xsl:template match="h1|h2|h3|h4|h5|h6|h7|h8|h9|h10">
		<xsl:copy>
			<xsl:copy-of select="@*"/>
			<xsl:apply-templates/>
		</xsl:copy>
	</xsl:template>
	<!--
	-->
	<xsl:template match="url">
		<xsl:copy-of select="document(.)/page/*"/>
	</xsl:template>
	<!--
	-->
</xsl:stylesheet>

And here is a sample page (all pages have the same structure only other
segments on it):

<?xml version="1.0" encoding="iso-8859-1"?>
<page>
	<paragraph>
		<segment id="tcm:581-37138">
      		</segment>
	</paragraph>
	<paragraph>
		<segment id="tcm:581-37139">
      </segment>
	</paragraph>
	<paragraph>
		<segment id="tcm:581-37140">
      </segment>
	</paragraph>
</page>

I think i have found the SOLUTION for my problem - In Saxon 7.4 all works
well - but in Saxon 7.9 it works too when i write the <url> tag like:

<url>./chapter1/subchapter1/section1/page.xml</url>

and not like:
<url>
     ./chapter1/subchapter1/section1/page.xml
</url>

XML Spy puts some tabs into it when i split up the tag. For the second case
i have to use "normalize-space" then it WORKS WELL TOO!!!
PROBLEM SOLVED!

Thanks!
Markus

> It would be useful to see your source document, and the actual error
> message
> rather than a paraphrase of it. It's also relevant to know how you invoked
> the transformation (because the base URIs of source document and
> stylesheet
> depend on this).
> 
> Remember that document(.) interprets the URI relative to the source
> document, while document(string(.)) interprets it relative to the
> stylesheet.
> 
> Michael Kay 
> 
> > -----Original Message-----
> > From: Markus Gamperl [mailto:markus.gamperl@xxxxxx] 
> > Sent: 08 June 2004 07:13
> > To: XSL-List@xxxxxxxxxxxxxxxxxxxxxx
> > Subject: [xsl] document function issue...
> > 
> > Hello!
> > 
> > I'm still trying and trying to get the document function 
> > running with Saxon
> > 7.9.1
> > I have opened a lot of threads in other lists and forums but the
> > informations is unhelpfully...
> > 
> > The following template:
> > 
> > <xsl:template match="url">
> >    <xsl:copy-of select="document(.)/page/*"/>
> > </xsl:template>
> > 
> > The URL has the following relative path value: 
> > ./dir1/dir2/dir3/file.xml
> > 
> > The document function in the template above throws and 
> > invalid URI error.
> > But the following works well:
> > <xsl:copy-of select="document('./dir1/dir2/dir3/file.xml')/page/*"/>
> > 
> > So i tried to circumvent Saxon and tried the following (also 
> > not working):
> > <xsl:copy-of select="document(string(.))/page/*"/>
> > or
> > <xsl:variable name="help" select="."/>
> > <xsl:copy-of select="document(concat('''',&help,''''))/page/*"/>
> > 
> > Has anybody an idea what else i could try?
> > 
> > Thanks very much!
> > Markus
> > 
> > -- 
> > +++ Jetzt WLAN-Router f|r alle DSL-Einsteiger und Wechsler +++
> > GMX DSL-Powertarife zudem 3 Monate gratis* http://www.gmx.net/dsl
> > 
> > 
> > --+------------------------------------------------------------------
> > XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> > or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> > --+--
> > 
> > 
> 
> 
> 
> --+------------------------------------------------------------------
> XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
> or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx>
> --+--
> 

-- 
"Sie haben neue Mails!" - Die GMX Toolbar informiert Sie beim Surfen!
Jetzt aktivieren unter http://www.gmx.net/info


Current Thread