You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by jason heddings <Ja...@Sun.COM> on 2001/05/09 16:08:41 UTC

XSLT Extensions

Hello!

I have two questions regarding XSL Extensions in Xalan...

I have created my own extension element (xmlns=foo -- of course).  That
element has an instruction called "bar" and takes some attributes:
<foo:bar att1="val1" ... />

That all works great, but here's my question:  I want to be able to
process all the children in the element --
<foo:bar att1="val1">
  <xsl:value-of select="." />
</foo:bar>

But rather than send the output to the result tree, I want to hold onto
it and allow foo:bar to process it.  I've tried using a
ByteArrayOutputStream along with a StreamResult to get what I thought
would be an appropriate ContentHandler, but nothing is sent to the
ByteArrayOutputStream when I call executeChildTemplates.

My second question is:

I have an extension that returns a String.  If that string contains HTML
(or any reserved XML characters), they are escaped before going to the
result tree.  I'd like to send it straight to the output like
<xsl:value-of ... disable-output-escaping="yes" /> does.

So that's a lot of me babbling...  Anyone who can make sense of it and
solve my problem has my upmost respect :)  Sorry, no real prizes...

--jah


 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      \\\|///                 Jason Heddings             ((
     \\ ~ ~ //                303.272.5166 (x75166)    C|~~|
     (/ @ @ /)                Jason.Heddings@Sun.COM    `__'
 ~~oOOo~(_)~oOOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Re: XSLT Extensions

Posted by Gary L Peskin <ga...@firstech.com>.
Hi, Jason --

On number 1, can you send a copy of your code, XML, and XSLT to
xalan-dev (which is where Xalan questions belong)?  I'll play around
with it but I don't have too much time at the moment but I'll try.  Your
sample will save me some time in trying to recreate what you're trying
to do.

On number 2, is the String being returned from an extension function or
an extension element?  If from a function, is that being called from an
xsl:value-of element or how?  Additional details, please.

Thanks,
Gary

jason heddings wrote:
> 
> Hello!
> 
> I have two questions regarding XSL Extensions in Xalan...
> 
> I have created my own extension element (xmlns=foo -- of course).  That
> element has an instruction called "bar" and takes some attributes:
> <foo:bar att1="val1" ... />
> 
> That all works great, but here's my question:  I want to be able to
> process all the children in the element --
> <foo:bar att1="val1">
>   <xsl:value-of select="." />
> </foo:bar>
> 
> But rather than send the output to the result tree, I want to hold onto
> it and allow foo:bar to process it.  I've tried using a
> ByteArrayOutputStream along with a StreamResult to get what I thought
> would be an appropriate ContentHandler, but nothing is sent to the
> ByteArrayOutputStream when I call executeChildTemplates.
> 
> My second question is:
> 
> I have an extension that returns a String.  If that string contains HTML
> (or any reserved XML characters), they are escaped before going to the
> result tree.  I'd like to send it straight to the output like
> <xsl:value-of ... disable-output-escaping="yes" /> does.
> 
> So that's a lot of me babbling...  Anyone who can make sense of it and
> solve my problem has my upmost respect :)  Sorry, no real prizes...
> 
> --jah
> 
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       \\\|///                 Jason Heddings             ((
>      \\ ~ ~ //                303.272.5166 (x75166)    C|~~|
>      (/ @ @ /)                Jason.Heddings@Sun.COM    `__'
>  ~~oOOo~(_)~oOOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org


Re: XSLT Extensions

Posted by Gary L Peskin <ga...@firstech.com>.
Hi, Jason --

On number 1, can you send a copy of your code, XML, and XSLT to
xalan-dev (which is where Xalan questions belong)?  I'll play around
with it but I don't have too much time at the moment but I'll try.  Your
sample will save me some time in trying to recreate what you're trying
to do.

On number 2, is the String being returned from an extension function or
an extension element?  If from a function, is that being called from an
xsl:value-of element or how?  Additional details, please.

Thanks,
Gary

jason heddings wrote:
> 
> Hello!
> 
> I have two questions regarding XSL Extensions in Xalan...
> 
> I have created my own extension element (xmlns=foo -- of course).  That
> element has an instruction called "bar" and takes some attributes:
> <foo:bar att1="val1" ... />
> 
> That all works great, but here's my question:  I want to be able to
> process all the children in the element --
> <foo:bar att1="val1">
>   <xsl:value-of select="." />
> </foo:bar>
> 
> But rather than send the output to the result tree, I want to hold onto
> it and allow foo:bar to process it.  I've tried using a
> ByteArrayOutputStream along with a StreamResult to get what I thought
> would be an appropriate ContentHandler, but nothing is sent to the
> ByteArrayOutputStream when I call executeChildTemplates.
> 
> My second question is:
> 
> I have an extension that returns a String.  If that string contains HTML
> (or any reserved XML characters), they are escaped before going to the
> result tree.  I'd like to send it straight to the output like
> <xsl:value-of ... disable-output-escaping="yes" /> does.
> 
> So that's a lot of me babbling...  Anyone who can make sense of it and
> solve my problem has my upmost respect :)  Sorry, no real prizes...
> 
> --jah
> 
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       \\\|///                 Jason Heddings             ((
>      \\ ~ ~ //                303.272.5166 (x75166)    C|~~|
>      (/ @ @ /)                Jason.Heddings@Sun.COM    `__'
>  ~~oOOo~(_)~oOOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Re: XSLT Extensions

Posted by Arnaud Vandyck <ar...@ressource-toi.org>.
On Wed, 9 May 2001, jason heddings wrote:

> Hello!
> 
> I have two questions regarding XSL Extensions in Xalan...
> 
> I have created my own extension element (xmlns=foo -- of course).  That
> element has an instruction called "bar" and takes some attributes:
> <foo:bar att1="val1" ... />
> 
> That all works great, but here's my question:  I want to be able to
> process all the children in the element --
> <foo:bar att1="val1">
>   <xsl:value-of select="." />
> </foo:bar>

isn't it <xsl:apply-templates/> instead of xsl:value-of
 
> But rather than send the output to the result tree, I want to hold onto
> it and allow foo:bar to process it.  I've tried using a
> ByteArrayOutputStream along with a StreamResult to get what I thought
> would be an appropriate ContentHandler, but nothing is sent to the
> ByteArrayOutputStream when I call executeChildTemplates.
> 
> My second question is:
> 
> I have an extension that returns a String.  If that string contains HTML
> (or any reserved XML characters), they are escaped before going to the
> result tree.  I'd like to send it straight to the output like
> <xsl:value-of ... disable-output-escaping="yes" /> does.

<![CDATA[ &amp; &nbsp; ]]>
?
 
> So that's a lot of me babbling...  Anyone who can make sense of it and
> solve my problem has my upmost respect :)  Sorry, no real prizes...
> 
> --jah
> 
> 
>  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>       \\\|///                 Jason Heddings             ((
>      \\ ~ ~ //                303.272.5166 (x75166)    C|~~|
>      (/ @ @ /)                Jason.Heddings@Sun.COM    `__'
>  ~~oOOo~(_)~oOOo~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org
> 
> 

Arnaud Vandyck <http://www.ressource-toi.org/>

"(7 mai 2001) 0.3.3  Chapitre 1 presque parfait."
- http://bibliocosme.com/actualite.html




---------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
For additional commands, e-mail: general-help@xml.apache.org