cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Chamberlain <>
Subject Re: Tags in the value of an XSLT variable?
Date Mon, 30 Jun 2008 11:15:23 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
Hi Betty/Derek,<br>
Thanks for getting back.<br>
Yes, that's certainly helped.&nbsp; I'm now confident that my variable also
contains the tags in addition to the values.&nbsp; It was by changing the
"." for "@* | node()" that did it.<br>
So my xslt looks like this:<br>
<pre wrap="">    &lt;xsl:variable name="gml"&gt;
      &lt;xsl:copy-of select="@* | node()"/&gt;
However, I now believe this variable is still a Node-Tree, and not a
String.&nbsp; I need it to be the latter so I can pass the XML excerpt to
the Java method I mentioned earlier (using xalan to do so).<br>
Is there a way of casting/translating a node tree into a String?<br>
Best regards,<br>
<hr size="2" width="100%"><br>
Derek Hohls wrote:
<blockquote cite="" type="cite">
  <pre wrap="">And that is not a "trick", but standard XSLT; see:
<a class="moz-txt-link-freetext"
as select="." only selects the value (string) inside the tag/s.

  <blockquote type="cite">
    <blockquote type="cite">
      <blockquote type="cite">
        <pre wrap="">On 2008/06/27 at 06:48, in message <a
"Betty Harvey" <a
 class="moz-txt-link-rfc2396E" href="">&lt;;</a>
  <pre wrap=""><!---->Try this for your xsl:copy:

&lt;xsl:copy&gt;&lt;xsl:apply-templates select="@* | node()" /&gt;&lt;/xsl:copy&gt;

&lt;quote who="Andrew Chamberlain"&gt;
  <blockquote type="cite">
    <pre wrap="">Hi All,

It's quite possible that this is more XSLT-related than Cocoon itself,
but wasn't sure where else to post.

I'm using an XSL transformer and need to capture a tree fragment in the
value of variable ... including the tags themselves.  The reason for
this is because I need to pass the XML excerpt (as a string) to a Java
class which is specifically written to parse it.

I'm trying the following, but this only seems to include the values, and
not the tags:

    &lt;xsl:variable name="gml"&gt;
      &lt;xsl:copy-of select="."/&gt;

Can anyone help?  Is there a trick for this?

Many thanks,

  <pre wrap=""><!---->

This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice,
and implemented Open Document Format (ODF) standard.
The full disclaimer details can be found at <a

This message has been scanned for viruses and dangerous content by MailScanner,
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.

To unsubscribe, e-mail: <a class="moz-txt-link-abbreviated"
For additional commands, e-mail: <a class="moz-txt-link-abbreviated"



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message