You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Rainer Häner <ra...@gfz-potsdam.de> on 2002/08/16 13:51:40 UTC

including fragments of xml-documents

hallo,
i want to include single-nodes or fragments of xml-documents.

simply i can do this with a stylesheet

<xsl:template match="xlink">
...
<!-- show attributes -->
<xsl:value-of select="@pathToFile"/>
<!-- => docs/samples/xml-file.xml -->
<xsl:value-of select="@xpathExpression"/>
<!-- => /document/title -->

<xsl:copy-of select="document(@pathToFile)/document/title"/>
<!-- okay -->

<xsl:copy-of select="document(@pathToFile)/@xpathExpression"/>
<!-- dosn't work -->
...
</xsl:template>

the xpathExpression is variable, depending on the xml-document, which
is transformed by the stylesheet:

suggestions? i there a way do handle this problem with logicsheets, for example:
XSPUtil.includeSource(<xsl:copy-of select="$pathToFile"/>, null, this.resolver, this.contentHandler);

the complete file is included



thanks for your help in advance

rainer








Re: including fragments of xml-documents

Posted by Rainer Häner <ra...@gfz-potsdam.de>.
thanks, this works fine,

sorry, i did not read most of the documentation

the idea behind my question was to write a logicsheet
which "simulates" xlink and xpointer
have a nice weekend,
rainer


----- Original Message -----
From: "Vadim Gritsenko" <va...@verizon.net>
To: <co...@xml.apache.org>
Sent: Friday, August 16, 2002 2:24 PM
Subject: Re: including fragments of xml-documents


> Rainer Häner wrote:
>
> > hallo,
> > i want to include single-nodes or fragments of xml-documents.
> >
> > simply i can do this with a stylesheet
> >
> > <xsl:template match="xlink">
> > ...
> > <!-- show attributes -->
> > <xsl:value-of select="@pathToFile"/>
> > <!-- => docs/samples/xml-file.xml -->
> > <xsl:value-of select="@xpathExpression"/>
> > <!-- => /document/title -->
> >
> > <xsl:copy-of select="document(@pathToFile)/document/title"/>
> > <!-- okay -->
> >
> > <xsl:copy-of select="document(@pathToFile)/@xpathExpression"/>
> > <!-- dosn't work -->
> > ...
> > </xsl:template>
> >
> > the xpathExpression is variable, depending on the xml-document, which
> > is transformed by the stylesheet:
> >
> > suggestions? i there a way do handle this problem with logicsheets,
> > for example:
> >
> > XSPUtil.includeSource(<xsl:copy-of select="$pathToFile"/>, null,
> > this.resolver, this.contentHandler);
> >
> > the complete file is included
> >
>
> XInclude transformer can include only part of the document.
>
> <xinclude:include href="path/to/file#xpointer(/xpath/expression)"/>
>
> Vadim
>
>
> > thanks for your help in advance
> >
> > rainer
> >
>
>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <co...@xml.apache.org>
> For additional commands, e-mail:   <co...@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: including fragments of xml-documents

Posted by Vadim Gritsenko <va...@verizon.net>.
Rainer Häner wrote:

> hallo,
> i want to include single-nodes or fragments of xml-documents.
>  
> simply i can do this with a stylesheet
>  
> <xsl:template match="xlink">
> ...
> <!-- show attributes -->
> <xsl:value-of select="@pathToFile"/>
> <!-- => docs/samples/xml-file.xml -->
> <xsl:value-of select="@xpathExpression"/>
> <!-- => /document/title -->
>  
> <xsl:copy-of select="document(@pathToFile)/document/title"/>
> <!-- okay -->
>  
> <xsl:copy-of select="document(@pathToFile)/@xpathExpression"/>
> <!-- dosn't work -->
> ...
> </xsl:template>
>  
> the xpathExpression is variable, depending on the xml-document, which
> is transformed by the stylesheet:
>  
> suggestions? i there a way do handle this problem with logicsheets, 
> for example:
>
> XSPUtil.includeSource(<xsl:copy-of select="$pathToFile"/>, null, 
> this.resolver, this.contentHandler);
>
> the complete file is included
>

XInclude transformer can include only part of the document.

<xinclude:include href="path/to/file#xpointer(/xpath/expression)"/>

Vadim


> thanks for your help in advance
>
> rainer
>




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>