cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lincoln" <lincoln.mitch...@oracle.com>
Subject RE: sourcefragment
Date Thu, 05 Jan 2006 07:40:38 GMT
Ran XIncludeTransformer before the SourceWritingTransformer as you mentioned
and works a treat! Thx a million.

I am now trying copy-of as follows:
<source:fragment>
  <xsl:variable name="svg" select="'&lt;svg&gt;&lt;/svg&gt;'"/>
  <xsl:copy-of select="$svg"/>
</source:fragment>

...But get a "java.lang.NullPointerException" Failed to process pipeline
error. 

I am only assigning the xml to a variable here to see if copy-of will work.
Is that the problem? Are variables definitions not allowed here.

Linc

> -----Original Message-----
> From: Jason Johnston [mailto:cocoon@lojjic.net]
> Sent: Thursday, January 05, 2006 1:56 PM
> To: users@cocoon.apache.org
> Subject: Re: sourcefragment
> 
> Lincoln wrote:
> > How do I get source:fragment in SourceWritingTransformer to contain:
> >
> > 1. A document on the file system. I have tried:
> > <source:fragment>
> >   <xi:include href="rect.svg"
> xmlns:xi="http://www.w3.org/2001/XInclude"/>
> > </source:fragment>
> 
> It seems like this should work, as long as you have the
> XIncludeTransformer run before the SourceWritingTransformer in your
> pipeline so the xi:include gets expanded.
> 
> >
> > and I tied...
> >
> > <source:fragment>
> >   <xsl:value-of select="document(rect.svg)"/>
> > </source:fragment>
> >
> >
> > 2. A xml nodeset at run time. I have tried
> > <source:fragment>
> >   <xsl:value-of select="$mySvg"/>
> > </source:fragment>
> 
> Neither of these will work because xsl:value-of only writes out the
> descendant text nodes.  xsl:copy-of should work better.
> 
> > Currently I can only write a file to the file system if its pasted
> inside
> > <source:fragment>
> >   <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
> >     <rect width="100" height="100" />
> >   </svg>
> > </source:fragment>
> 
> If you place a <map:serialize type="xml"/> directly before the
> SourceWritingTransformer stage (or use a cocoon view) it will show you
> what that transformer is getting as input.  It should look the same
> whether it comes from the source XML or an XInclude etc. so this will
> allow you to verify that.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message