You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andrew Chamberlain <an...@comsine.co.uk> on 2008/06/27 18:47:58 UTC

Tags in the value of an XSLT variable?

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:

    <xsl:variable name="gml">
      <xsl:copy-of select="."/>
    </xsl:variable>

Can anyone help?  Is there a trick for this?

Many thanks,

Andy

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


Re: Tags in the value of an XSLT variable?

Posted by Betty Harvey <ha...@eccnet.com>.
Hi Andy:

I am not sure how JAVA handles an XML snippet but if you are passing the
snippet as variable you should be able to cast it as a string.  If
not you could try encapsulating it at CDATA section and the parser
will ignore anything in the CDATA section:

<![CDATA[
<a>My XML</a>
]]>

Betty

<quote who="Andrew Chamberlain">
>         Hi Betty/Derek,
>
>  Thanks for getting back.
>
>  Yes, that's certainly helped.  I'm now confident that my variable also
> contains the tags in addition to the values.  It was by changing the "."
> for "@* | node()" that did it.
>
>  So my xslt looks like this:
>                    However, I now believe this variable is still a
> Node-Tree, and not a String.  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).
>
>  Is there a way of casting/translating a node tree into a String?
>
>  Best regards,
>
>  Andy
>
>
>  Derek Hohls wrote:    And that is not a "trick", but standard XSLT; see:
> http://www.dpawson.co.uk/xsl/sect2/N1930.html#d3389e91 as select="." only
> selects the value (string) inside the tag/s.
> On 2008/06/27 at 06:48, in message , "Betty Harvey"  wrote:
>             Try this for your xsl:copy:               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:                    Can anyone help?  Is there a
> trick for this?  Many thanks,  Andy              -- 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 http://www.csir.co.za/disclaimer.html.
>  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: 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


/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Betty Harvey                         | Phone: 410-787-9200 FAX: 9830
Electronic Commerce Connection, Inc. |
harvey@eccnet.com                    | Washington,DC SGML/XML Users Grp
URL:  http://www.eccnet.com          | http://www.eccnet.com/xmlug/
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
Help Mac fight MLD (http://www.macsteam.org)
Mark your calendar for October 28th (http://www.macsteam.org/BullROast.aspx)

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


Re: Tags in the value of an XSLT variable?

Posted by Derek Hohls <DH...@csir.co.za>.
Andy

This is confusing.  In your original post, you said you wanted to:
"capture a tree fragment in the value of variable ... including the tags themselves"
This is now what you have.

I am also not sure how you differentiate between a Node Tree vs a String.
At the end, XML is just plain text.  The fact that it has pointy brackets in it
is because we assume that the processing software will be able to make use
of it.  So I think the answer lies in the Java code you have written - if it treats
the incoming variable as just having plain text, then the brackets should make
no difference.  Maybe you need to expand more on what you want to happen
on the Java side.... (tho' that is probably outside my scope of expertise)

Derek

>>> On 2008/06/30 at 01:15, in message <48...@comsine.co.uk>, Andrew Chamberlain <an...@comsine.co.uk> wrote:
Hi Betty/Derek,

Thanks for getting back.

Yes, that's certainly helped.  I'm now confident that my variable also contains the tags in addition to the values.  It was by changing the "." for "@* | node()" that did it.

So my xslt looks like this:
<xsl:variable name="gml">      <xsl:copy-of select="@* | node()"/>    </xsl:variable>
However, I now believe this variable is still a Node-Tree, and not a String. 
 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).

Is there a way of casting/translating a node tree into a String?

Best regards,

Andy


Derek Hohls wrote: 

And that is not a "trick", but standard XSLT; see:http://www.dpawson.co.uk/xsl/sect2/N1930.html#d3389e91as select="." only selects the value (string) inside the tag/s.


On 2008/06/27 at 06:48, in message <24...@www.eccnet.com> ( mailto:2415.207.168.47.25.1214585293.squirrel@www.eccnet.com ), "Betty Harvey" <ha...@eccnet.com> ( mailto:harvey@eccnet.com ) wrote:
        Try this for your xsl:copy:
<xsl:copy><xsl:apply-templates select="@* | node()" /></xsl:copy><quote who="Andrew Chamberlain">  

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:

    <xsl:variable name="gml">      <xsl:copy-of select="."/>    </xsl:variable>
Can anyone help?  Is there a trick for this?

Many thanks,

Andy



-- 
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 http://www.csir.co.za/disclaimer.html.

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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Passing a node-set from XSLT to Java

Posted by Luca Morandini <lm...@ieee.org>.
Andrew Chamberlain wrote:
> 
> The last line (which uses the getTextContent() method) throws the 
> following exception:
> 
> javax.xml.transform.TransformerException: java.lang.AbstractMethodError: 
> org.apache.xml.dtm.ref.DTMNodeProxy.getTextContent()Ljava/lang/String;
>        at 
> org.apache.xalan.extensions.ExtensionHandlerJavaClass.callFunction(ExtensionHandlerJavaClass.java:396) 

For a better understanding, you should look at the portion of the stack 
trace following "caused by".


> Firstly, I was expecting the Class to be "org.w3c.dom.Node", so does 
> anyone know how I can enable this?  

Rather difficult, since org.w3c.dom.Node is an interface, not a class: 
the object that is passed to the addGML function is an instance of 
org.apache.xml.dtm.ref.DTMNodeProxy, an actual class which happens to 
implement org.w3c.dom.Node.


> I was also expecting the name of the 
> first child to be "gml:exterior" instead of a "#text". 

Understandable, since your XML has newlines and blanks before 
gml:exterior: try stripping all this baggage before parsing.

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


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


Re: Passing a node-set from XSLT to Java

Posted by Derek Hohls <DH...@csir.co.za>.
Andy

I think you stumbled across one of the "gotchas" of XML; what looks simple
and obvious is not always - at least, not to a machine.  For more in-depth 
understanding of XML, I can recommend Ken Sall to explain it.  There is a
sample chapter from his book on-line:
http://wdvl.internet.com/Authoring/Languages/XML/XMLFamily/XMLSyntax/
For example; see:
http://wdvl.internet.com/Authoring/Languages/XML/XMLFamily/XMLSyntax/sall2_4.html
where he explicitly says:
"In contrast to HTML, in which a sequence of white space characters is collapsed 
into a single white space and in which newlines are ignored, in XML 
all white space is taken literally. "

HTH
Derek


>>> On 2008/07/04 at 12:48, in message <48...@comsine.co.uk>, Andrew Chamberlain <an...@comsine.co.uk> wrote:
Hi Luca, Jascon,

Thanks very much - you've set me straight.  I hadn't imagined that the blank space would constitute a seperate node.

Andy



-- 
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 http://www.csir.co.za/disclaimer.html.

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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Passing a node-set from XSLT to Java

Posted by Jason Johnston <jj...@apache.org>.
Andrew Chamberlain wrote:
> Hi Luca/All,
> 
> Sorry.  On further testing, we're still not getting through the full 
> tree fragment to Java.
> 
> I've adapted the java method to give details of what it receives:
> 
>  public String addGML(org.w3c.dom.Node myNode)
>  {
>       System.out.println("Class = "+node.getClass().getName());
>       System.out.println("Name = "+node.getNodeName());
>       System.out.println("Has children = 
> "+(node.hasChildNodes()?"Yes":"No"));
>       System.out.println("First Child Name = 
> "+node.getFirstChild().getNodeName());
>       System.out.println("First Child Text = 
> "+node.getFirstChild().getTextContent());
>  }
> 
> and from this comes the following output:
> 
>  Class = org.apache.xml.dtm.ref.DTMNodeProxy
>  Name = gml:Polygon
>  Has children = Yes
>  First Child Name = #text
> 
> The last line (which uses the getTextContent() method) throws the 
> following exception:
> 
> javax.xml.transform.TransformerException: java.lang.AbstractMethodError: 
> org.apache.xml.dtm.ref.DTMNodeProxy.getTextContent()Ljava/lang/String;
>        at 
> org.apache.xalan.extensions.ExtensionHandlerJavaClass.callFunction(ExtensionHandlerJavaClass.java:396) 
> 
>        ...
> 
> Firstly, I was expecting the Class to be "org.w3c.dom.Node", so does 
> anyone know how I can enable this? 

DTMNodeProxy is the concrete implementation class, so it makes sense 
that you get that.  org.w3c.dom.Node would just be one of the (possibly 
many) interfaces it implements so I wouldn't expect getClass().getName() 
to return it.  I think what you're really wanting is node.getNodeType() 
which returns one of the node type constants (see the Node javadoc).

> I was also expecting the name of the 
> first child to be "gml:exterior" instead of a "#text".  The XML I'm 
> sending is given below:
> 
>    <gml:Polygon gml:id="GATS1153_10">
>      <gml:exterior>
>        <gml:LinearRing>
>          <gml:posList srsDimension="2">-155.42 55.58</gml:posList>
>        </gml:LinearRing>
>      </gml:exterior>
>    </gml:Polygon>

My guess is that the first child of gml:Polygon is actually the 
whitespace text node before the gml:exterior element.  Pretty easy to 
test by looking at the length of getChildNodes() which would be 3.  To 
get straight to the gml:exterior you could use getElementsByTagNameNS, 
or check each child node's nodeType for ELEMENT_NODE.

> 
> Is it possible I actually need to pass a tree fragment, rather than a 
> node-set?
> 
> As a reminder, the XSLT given below.  Any help would me greatly 
> appreciated.  In simple terms, I'm just trying to pass the above XML 
> from XSLT to Java, preferably as a w3c Node.
> 
> Kind regards,
> 
> Andy
> 
> The XSLT:
> 
>  <xsl:stylesheet ... myClass="xalan://my.package.name.MyClass">
>    ...
>    <xsl:variable name="gmlAdder" select="myClass:new()"/>
> 
>    <xsl:variable name="gml">
>      <xsl:copy-of select="@* | node()"/>
>    </xsl:variable>
> 
>    <xsl:variable name="result" select="myClass:addGML($gmlAdder,$gml)"/>
>    ...
>  </xsl:stylesheet>
> 
> 
> ---------------------------------------------------------------------
> 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


Re: Passing a node-set from XSLT to Java

Posted by Andrew Chamberlain <an...@comsine.co.uk>.
Hi Luca/All,

Sorry.  On further testing, we're still not getting through the full 
tree fragment to Java.

I've adapted the java method to give details of what it receives:

  public String addGML(org.w3c.dom.Node myNode)
  {
       System.out.println("Class = "+node.getClass().getName());
       System.out.println("Name = "+node.getNodeName());
       System.out.println("Has children = "+(node.hasChildNodes()?"Yes":"No"));
       System.out.println("First Child Name = "+node.getFirstChild().getNodeName());
       System.out.println("First Child Text = "+node.getFirstChild().getTextContent());
  }

and from this comes the following output:

  Class = org.apache.xml.dtm.ref.DTMNodeProxy
  Name = gml:Polygon
  Has children = Yes
  First Child Name = #text

The last line (which uses the getTextContent() method) throws the 
following exception:

javax.xml.transform.TransformerException: java.lang.AbstractMethodError: 
org.apache.xml.dtm.ref.DTMNodeProxy.getTextContent()Ljava/lang/String;
        at 
org.apache.xalan.extensions.ExtensionHandlerJavaClass.callFunction(ExtensionHandlerJavaClass.java:396)
        ...

Firstly, I was expecting the Class to be "org.w3c.dom.Node", so does 
anyone know how I can enable this?  I was also expecting the name of the 
first child to be "gml:exterior" instead of a "#text".  The XML I'm 
sending is given below:

    <gml:Polygon gml:id="GATS1153_10">
      <gml:exterior>
        <gml:LinearRing>
          <gml:posList srsDimension="2">-155.42 55.58</gml:posList>
        </gml:LinearRing>
      </gml:exterior>
    </gml:Polygon>

Is it possible I actually need to pass a tree fragment, rather than a 
node-set?

As a reminder, the XSLT given below.  Any help would me greatly 
appreciated.  In simple terms, I'm just trying to pass the above XML 
from XSLT to Java, preferably as a w3c Node.

Kind regards,

Andy

The XSLT:

  <xsl:stylesheet ... myClass="xalan://my.package.name.MyClass">
    ...
    <xsl:variable name="gmlAdder" select="myClass:new()"/>

    <xsl:variable name="gml">
      <xsl:copy-of select="@* | node()"/>
    </xsl:variable>

    <xsl:variable name="result" select="myClass:addGML($gmlAdder,$gml)"/>
    ...
  </xsl:stylesheet>


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


Re: Passing a node-set from XSLT to Java

Posted by Luca Morandini <lm...@ieee.org>.
Andrew Chamberlain wrote:
> Hi All,
> 
> I'm trying to pass a tree fragment from XSLT to Java in the following 
> way, and I'm not sure if the node-set is getting through correctly.  The 
> XML is:
...
> 
> This gives the 'result' variable the value of "#text", but when I was 
> expecting "gml:Polygon".

Not all XML fragments are nodesets in XSLT 1.0 (XSLT 2.0 is way better 
in this respect), hence you could try using the node extension of Xalan.

I haven't tried passing nodeset() to Java, but I presume this example 
may help you:

Pass this expression: xalan:nodeset($y-vector)

Where y-vector comes from an ordinary XML fragment like this:
   <xsl:template name="get-y-vector">
     <xsl:param name="geom"/>
     <vector>
       <xsl:for-each select="str:tokenize($geom, ' ')">
       <xsl:if test="string-length(substring-before(., ','))!=0">
         <y><xsl:value-of select="substring-before(., ',')"/></y>
         </xsl:if>
       </xsl:for-each>
     </vector>
   </xsl:template>

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


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


Passing a node-set from XSLT to Java

Posted by Andrew Chamberlain <an...@comsine.co.uk>.
Hi All,

I'm trying to pass a tree fragment from XSLT to Java in the following 
way, and I'm not sure if the node-set is getting through correctly.  The 
XML is:

  <gml:Polygon>
   ...
  </gml:Polygon>

and the XSLT is:

  <xsl:stylesheet ... myClass="xalan://my.package.name.MyClass">
    ...
    <xsl:variable name="gmlAdder" select="myClass:new()"/>

    <xsl:variable name="gml">
      <xsl:copy-of select="@* | node()"/>
    </xsl:variable>

    <xsl:variable name="result" select="myClass:addGML($gmlAdder,$gml)"/>
    ...
  </xsl:stylesheet>

where the addGML method is:

  public String addGML(org.w3c.dom.Node myNode)
  {
     ...
     return (myNode.getNodeName());
  }


This gives the 'result' variable the value of "#text", but when I was 
expecting "gml:Polygon".

Has anyone else managed to transfer a node-set to Java?  If so, did you 
use xalan?

Any tips would be greatly appreciated.

Thanks,

Andy

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


Re: Tags in the value of an XSLT variable?

Posted by Andreas Hartmann <an...@apache.org>.
Andrew Chamberlain schrieb:
> Hi Betty/Derek,
> 
> Thanks for getting back.
> 
> Yes, that's certainly helped.  I'm now confident that my variable also 
> contains the tags in addition to the values.  It was by changing the "." 
> for "@* | node()" that did it.
> 
> So my xslt looks like this:
> 
>     <xsl:variable name="gml">
>       <xsl:copy-of select="@* | node()"/>
>     </xsl:variable>
> 
> However, I now believe this variable is still a Node-Tree, and not a 
> String.  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).
> 
> Is there a way of casting/translating a node tree into a String?

That would be XML serializing. AFAIK XSLT is not capable of this (I 
don't know about XSLT 2.0, though). Why do you have to convert the 
fragment to a string? Wouldn't it be more straightforward to pass the 
fragment to the Java code, so that it doesn't have to be parsed again?

-- Andreas


> 
> Best regards,
> 
> Andy
> 
> ------------------------------------------------------------------------
> 
> Derek Hohls wrote:
>> And that is not a "trick", but standard XSLT; see:
>> http://www.dpawson.co.uk/xsl/sect2/N1930.html#d3389e91
>> as select="." only selects the value (string) inside the tag/s.
>>
>>   
>>>>> On 2008/06/27 at 06:48, in message <24...@www.eccnet.com>, "Betty Harvey" <ha...@eccnet.com> wrote:
>>>>>         
>> Try this for your xsl:copy:
>>
>> <xsl:copy><xsl:apply-templates select="@* | node()" /></xsl:copy>
>>
>> <quote who="Andrew Chamberlain">
>>   
>>> 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:
>>>
>>>     <xsl:variable name="gml">
>>>       <xsl:copy-of select="."/>
>>>     </xsl:variable>
>>>
>>> Can anyone help?  Is there a trick for this?
>>>
>>> Many thanks,
>>>
>>> Andy
>>>     
>>
>>
>>
>> --
>> 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 http://www.csir.co.za/disclaimer.html.
>>
>> 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: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>> .
>>
>>   


-- 
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


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


Re: Tags in the value of an XSLT variable?

Posted by Derek Hohls <DH...@csir.co.za>.
And that is not a "trick", but standard XSLT; see:
http://www.dpawson.co.uk/xsl/sect2/N1930.html#d3389e91 
as select="." only selects the value (string) inside the tag/s.

>>> On 2008/06/27 at 06:48, in message <24...@www.eccnet.com>, "Betty Harvey" <ha...@eccnet.com> wrote:
Try this for your xsl:copy:

<xsl:copy><xsl:apply-templates select="@* | node()" /></xsl:copy>

<quote who="Andrew Chamberlain">
> 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:
>
>     <xsl:variable name="gml">
>       <xsl:copy-of select="."/>
>     </xsl:variable>
>
> Can anyone help?  Is there a trick for this?
>
> Many thanks,
>
> Andy



-- 
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 http://www.csir.co.za/disclaimer.html.

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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Tags in the value of an XSLT variable?

Posted by Betty Harvey <ha...@eccnet.com>.
Try this for your xsl:copy:

<xsl:copy><xsl:apply-templates select="@* | node()" /></xsl:copy>

<quote who="Andrew Chamberlain">
> 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:
>
>     <xsl:variable name="gml">
>       <xsl:copy-of select="."/>
>     </xsl:variable>
>
> Can anyone help?  Is there a trick for this?
>
> Many thanks,
>
> Andy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Betty Harvey                         | Phone: 410-787-9200 FAX: 9830
Electronic Commerce Connection, Inc. |
harvey@eccnet.com                    | Washington,DC SGML/XML Users Grp
URL:  http://www.eccnet.com          | http://www.eccnet.com/xmlug/
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\\/\/
Help Mac fight MLD (http://www.macsteam.org)
Mark your calendar for October 28th (http://www.macsteam.org/BullROast.aspx)

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