You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Eric Hamacher <er...@enetrix.com> on 2008/07/01 21:30:59 UTC

XSLTResult problem

Struts 2.0.11

 

Hello:

 

 

 

It appears that XSLTResult is having trouble transforming a simple
Document:

 

<?xml version="1.0" ?>

<buidInfo>

<buid>999999</buid>

<buid>9999x99</buid>

</buidInfo>

 

 

My action is producing valid XML.  I don't think it's the action causing
the problem.  The error message printed on the screen:

 

XML Parsing Error: no element found

Location:
http://111.222.33.444:8989/ImageManager/download/BUDropdownAjaxAction.ac
tion?schema=XXXXX

Line Number 1, Column 1:

 

 

Here is the action execute method which creates the Document:

 

    public String execute() throws ParserConfigurationException {

            ImageManagerProperties props = new ImageManagerProperties();

            props.load();

            

            DocumentBuilderFactory dbfac = 

                DocumentBuilderFactory.newInstance();

            DocumentBuilder docBuilder = dbfac.newDocumentBuilder();

            doc = docBuilder.newDocument();

    

            Element root = doc.createElement("buidInfo");

            doc.appendChild(root);

            

            File directory = new File(props.getBaseDownloadDir() + "/" +
schema);

            File[] buids = directory.listFiles();

            for (File f: buids) {

                if (f.isDirectory()) {

                    Element buid = doc.createElement("buid");

                    Text name = doc.createTextNode(f.getName());

                    buid.appendChild(name);

                    root.appendChild(buid);

                }

            }

            

            return SUCCESS;

}

 

The configuration is as such:

 

<action name="BUDropdownAjaxAction"
class="download.BUDropdownAjaxAction">

            <result type="xslt">

                <param name="exposedValue">doc</param>        

            </result>

 </action>

 

I assume that XSLTResult is available through the struts default
settings.

 

Can anybody see something obvious?

 

Regards,

Eric Hamacher

 

******************************

THIS EMAIL IS INTENDED ONLY FOR THE REVIEW OF THE ADDRESSEE(S), AND MAY
CONTAIN CONFIDENTIAL AND LEGALLY PRIVILEGED INFORMATION. INTERCEPTION,
COPYING, DISSEMINATION, OR OTHER USE BY OTHER THAN THE ADDRESSEE(S) IS
PROHIBITED AND MAY BE PENALIZED UNDER APPLICABLE PRIVACY LAWS. IF YOU
RECEIVED THIS EMAIL IN ERROR, PLEASE DELETE IT AND NOTIFY ME BY RETURN
EMAIL TO eric.hamacher@enetrix.com *******************************

 


RE: XSLTResult problem

Posted by John Krueger <jk...@pathfire.com>.
Are you using Java 6?

I tried your example and it works for me with Java 5 but not with Java
6.  

I ran it through the debugger and the problem is in the struts class
SimpleAdapterDocument.  The getXmlStandalone method always throws the
operationNotSupported exception.  

    public boolean getXmlStandalone() {
        throw operationNotSupported();
    }

I assume the transformer in Java 6 calls this method but not the 
transformer in Java 5.



As a workaround, if your just looking for the xml you could specify 
the result as follows using an identity transformation.  This
should output the same xml.

<action name="BUDropdownAjaxAction"
class="download.BUDropdownAjaxAction">
    <result type="xslt">
        <param name="stylesheetLocation">/identity.xsl</param>
        <param name="exposedValue">doc</param>        
    </result>
</action>


You can probably find other identity stylesheets on the web but
here is one that worked for us.


<?xml version="1.0" encoding="ISO-8859-1"?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" >
<xsl:output method="xml" indent="yes" encoding="ISO-8859-1"/>

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

</xsl:stylesheet>





> -----Original Message-----
> From: Eric Hamacher [mailto:eric.hamacher@enetrix.com] 
> Sent: Wednesday, July 02, 2008 4:00 PM
> To: Struts Users Mailing List
> Subject: RE: XSLTResult problem
> 
> Thanks for the response.  Yes, it's there.  I am starting to doubt
> whether XSLTResult will in fact transform my Document.  I am 
> looking at:
> 
> http://cse-mjmcl.cse.bris.ac.uk/blog/2007/09/10/1189430125294.html
> 
> as a reference for using XSLTResult without stylesheets.  I was hoping
> that somebody else might be using it this way.
> 
> -----Original Message-----
> From: John Krueger [mailto:jkrueger@pathfire.com] 
> Sent: Wednesday, July 02, 2008 2:51 PM
> To: Struts Users Mailing List
> Subject: RE: XSLTResult problem
> 
> Do you have a public getDoc() method on your action?
> 
> John 
> 
> > -----Original Message-----
> > From: Eric Hamacher [mailto:eric.hamacher@enetrix.com] 
> > Sent: Tuesday, July 01, 2008 3:31 PM
> > To: Struts Users Mailing List
> > Subject: XSLTResult problem
> > 
> > Struts 2.0.11
> > 
> >  
> > 
> > Hello:
> > 
> >  
> > 
> >  
> > 
> >  
> > 
> > It appears that XSLTResult is having trouble transforming a simple
> > Document:
> > 
> >  
> > 
> > <?xml version="1.0" ?>
> > 
> > <buidInfo>
> > 
> > <buid>999999</buid>
> > 
> > <buid>9999x99</buid>
> > 
> > </buidInfo>
> > 
> >  
> > 
> >  
> > 
> > My action is producing valid XML.  I don't think it's the 
> > action causing
> > the problem.  The error message printed on the screen:
> > 
> >  
> > 
> > XML Parsing Error: no element found
> > 
> > Location:
> > http://111.222.33.444:8989/ImageManager/download/BUDropdownAja
> > xAction.ac
> > tion?schema=XXXXX
> > 
> > Line Number 1, Column 1:
> > 
> >  
> > 
> >  
> > 
> > Here is the action execute method which creates the Document:
> > 
> >  
> > 
> >     public String execute() throws ParserConfigurationException {
> > 
> >             ImageManagerProperties props = new 
> > ImageManagerProperties();
> > 
> >             props.load();
> > 
> >             
> > 
> >             DocumentBuilderFactory dbfac = 
> > 
> >                 DocumentBuilderFactory.newInstance();
> > 
> >             DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
> > 
> >             doc = docBuilder.newDocument();
> > 
> >     
> > 
> >             Element root = doc.createElement("buidInfo");
> > 
> >             doc.appendChild(root);
> > 
> >             
> > 
> >             File directory = new 
> > File(props.getBaseDownloadDir() + "/" +
> > schema);
> > 
> >             File[] buids = directory.listFiles();
> > 
> >             for (File f: buids) {
> > 
> >                 if (f.isDirectory()) {
> > 
> >                     Element buid = doc.createElement("buid");
> > 
> >                     Text name = doc.createTextNode(f.getName());
> > 
> >                     buid.appendChild(name);
> > 
> >                     root.appendChild(buid);
> > 
> >                 }
> > 
> >             }
> > 
> >             
> > 
> >             return SUCCESS;
> > 
> > }
> > 
> >  
> > 
> > The configuration is as such:
> > 
> >  
> > 
> > <action name="BUDropdownAjaxAction"
> > class="download.BUDropdownAjaxAction">
> > 
> >             <result type="xslt">
> > 
> >                 <param name="exposedValue">doc</param>        
> > 
> >             </result>
> > 
> >  </action>
> > 
> >  
> > 
> > I assume that XSLTResult is available through the struts default
> > settings.
> > 
> >  
> > 
> > Can anybody see something obvious?
> > 
> >  
> > 
> > Regards,
> > 
> > Eric Hamacher
> > 
> >  
> > 
> > ******************************
> > 
> > THIS EMAIL IS INTENDED ONLY FOR THE REVIEW OF THE 
> > ADDRESSEE(S), AND MAY
> > CONTAIN CONFIDENTIAL AND LEGALLY PRIVILEGED INFORMATION. 
> INTERCEPTION,
> > COPYING, DISSEMINATION, OR OTHER USE BY OTHER THAN THE 
> ADDRESSEE(S) IS
> > PROHIBITED AND MAY BE PENALIZED UNDER APPLICABLE PRIVACY 
> LAWS. IF YOU
> > RECEIVED THIS EMAIL IN ERROR, PLEASE DELETE IT AND NOTIFY 
> ME BY RETURN
> > EMAIL TO eric.hamacher@enetrix.com *******************************
> > 
> >  
> > 
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: XSLTResult problem

Posted by Eric Hamacher <er...@enetrix.com>.
Thanks for the response.  Yes, it's there.  I am starting to doubt
whether XSLTResult will in fact transform my Document.  I am looking at:

http://cse-mjmcl.cse.bris.ac.uk/blog/2007/09/10/1189430125294.html

as a reference for using XSLTResult without stylesheets.  I was hoping
that somebody else might be using it this way.

-----Original Message-----
From: John Krueger [mailto:jkrueger@pathfire.com] 
Sent: Wednesday, July 02, 2008 2:51 PM
To: Struts Users Mailing List
Subject: RE: XSLTResult problem

Do you have a public getDoc() method on your action?

John 

> -----Original Message-----
> From: Eric Hamacher [mailto:eric.hamacher@enetrix.com] 
> Sent: Tuesday, July 01, 2008 3:31 PM
> To: Struts Users Mailing List
> Subject: XSLTResult problem
> 
> Struts 2.0.11
> 
>  
> 
> Hello:
> 
>  
> 
>  
> 
>  
> 
> It appears that XSLTResult is having trouble transforming a simple
> Document:
> 
>  
> 
> <?xml version="1.0" ?>
> 
> <buidInfo>
> 
> <buid>999999</buid>
> 
> <buid>9999x99</buid>
> 
> </buidInfo>
> 
>  
> 
>  
> 
> My action is producing valid XML.  I don't think it's the 
> action causing
> the problem.  The error message printed on the screen:
> 
>  
> 
> XML Parsing Error: no element found
> 
> Location:
> http://111.222.33.444:8989/ImageManager/download/BUDropdownAja
> xAction.ac
> tion?schema=XXXXX
> 
> Line Number 1, Column 1:
> 
>  
> 
>  
> 
> Here is the action execute method which creates the Document:
> 
>  
> 
>     public String execute() throws ParserConfigurationException {
> 
>             ImageManagerProperties props = new 
> ImageManagerProperties();
> 
>             props.load();
> 
>             
> 
>             DocumentBuilderFactory dbfac = 
> 
>                 DocumentBuilderFactory.newInstance();
> 
>             DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
> 
>             doc = docBuilder.newDocument();
> 
>     
> 
>             Element root = doc.createElement("buidInfo");
> 
>             doc.appendChild(root);
> 
>             
> 
>             File directory = new 
> File(props.getBaseDownloadDir() + "/" +
> schema);
> 
>             File[] buids = directory.listFiles();
> 
>             for (File f: buids) {
> 
>                 if (f.isDirectory()) {
> 
>                     Element buid = doc.createElement("buid");
> 
>                     Text name = doc.createTextNode(f.getName());
> 
>                     buid.appendChild(name);
> 
>                     root.appendChild(buid);
> 
>                 }
> 
>             }
> 
>             
> 
>             return SUCCESS;
> 
> }
> 
>  
> 
> The configuration is as such:
> 
>  
> 
> <action name="BUDropdownAjaxAction"
> class="download.BUDropdownAjaxAction">
> 
>             <result type="xslt">
> 
>                 <param name="exposedValue">doc</param>        
> 
>             </result>
> 
>  </action>
> 
>  
> 
> I assume that XSLTResult is available through the struts default
> settings.
> 
>  
> 
> Can anybody see something obvious?
> 
>  
> 
> Regards,
> 
> Eric Hamacher
> 
>  
> 
> ******************************
> 
> THIS EMAIL IS INTENDED ONLY FOR THE REVIEW OF THE 
> ADDRESSEE(S), AND MAY
> CONTAIN CONFIDENTIAL AND LEGALLY PRIVILEGED INFORMATION. INTERCEPTION,
> COPYING, DISSEMINATION, OR OTHER USE BY OTHER THAN THE ADDRESSEE(S) IS
> PROHIBITED AND MAY BE PENALIZED UNDER APPLICABLE PRIVACY LAWS. IF YOU
> RECEIVED THIS EMAIL IN ERROR, PLEASE DELETE IT AND NOTIFY ME BY RETURN
> EMAIL TO eric.hamacher@enetrix.com *******************************
> 
>  
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: XSLTResult problem

Posted by John Krueger <jk...@pathfire.com>.
Do you have a public getDoc() method on your action?

John 

> -----Original Message-----
> From: Eric Hamacher [mailto:eric.hamacher@enetrix.com] 
> Sent: Tuesday, July 01, 2008 3:31 PM
> To: Struts Users Mailing List
> Subject: XSLTResult problem
> 
> Struts 2.0.11
> 
>  
> 
> Hello:
> 
>  
> 
>  
> 
>  
> 
> It appears that XSLTResult is having trouble transforming a simple
> Document:
> 
>  
> 
> <?xml version="1.0" ?>
> 
> <buidInfo>
> 
> <buid>999999</buid>
> 
> <buid>9999x99</buid>
> 
> </buidInfo>
> 
>  
> 
>  
> 
> My action is producing valid XML.  I don't think it's the 
> action causing
> the problem.  The error message printed on the screen:
> 
>  
> 
> XML Parsing Error: no element found
> 
> Location:
> http://111.222.33.444:8989/ImageManager/download/BUDropdownAja
> xAction.ac
> tion?schema=XXXXX
> 
> Line Number 1, Column 1:
> 
>  
> 
>  
> 
> Here is the action execute method which creates the Document:
> 
>  
> 
>     public String execute() throws ParserConfigurationException {
> 
>             ImageManagerProperties props = new 
> ImageManagerProperties();
> 
>             props.load();
> 
>             
> 
>             DocumentBuilderFactory dbfac = 
> 
>                 DocumentBuilderFactory.newInstance();
> 
>             DocumentBuilder docBuilder = dbfac.newDocumentBuilder();
> 
>             doc = docBuilder.newDocument();
> 
>     
> 
>             Element root = doc.createElement("buidInfo");
> 
>             doc.appendChild(root);
> 
>             
> 
>             File directory = new 
> File(props.getBaseDownloadDir() + "/" +
> schema);
> 
>             File[] buids = directory.listFiles();
> 
>             for (File f: buids) {
> 
>                 if (f.isDirectory()) {
> 
>                     Element buid = doc.createElement("buid");
> 
>                     Text name = doc.createTextNode(f.getName());
> 
>                     buid.appendChild(name);
> 
>                     root.appendChild(buid);
> 
>                 }
> 
>             }
> 
>             
> 
>             return SUCCESS;
> 
> }
> 
>  
> 
> The configuration is as such:
> 
>  
> 
> <action name="BUDropdownAjaxAction"
> class="download.BUDropdownAjaxAction">
> 
>             <result type="xslt">
> 
>                 <param name="exposedValue">doc</param>        
> 
>             </result>
> 
>  </action>
> 
>  
> 
> I assume that XSLTResult is available through the struts default
> settings.
> 
>  
> 
> Can anybody see something obvious?
> 
>  
> 
> Regards,
> 
> Eric Hamacher
> 
>  
> 
> ******************************
> 
> THIS EMAIL IS INTENDED ONLY FOR THE REVIEW OF THE 
> ADDRESSEE(S), AND MAY
> CONTAIN CONFIDENTIAL AND LEGALLY PRIVILEGED INFORMATION. INTERCEPTION,
> COPYING, DISSEMINATION, OR OTHER USE BY OTHER THAN THE ADDRESSEE(S) IS
> PROHIBITED AND MAY BE PENALIZED UNDER APPLICABLE PRIVACY LAWS. IF YOU
> RECEIVED THIS EMAIL IN ERROR, PLEASE DELETE IT AND NOTIFY ME BY RETURN
> EMAIL TO eric.hamacher@enetrix.com *******************************
> 
>  
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Re: XSLTResult problem

Posted by Chris Pratt <th...@gmail.com>.
It sounds like what you really want to do is get the OutputStream from
the response and stream the XML to it, then return null from your
action.
  (*Chris*)

On Wed, Jul 2, 2008 at 12:31 PM, Eric Hamacher
<er...@enetrix.com> wrote:
> I have an org.w3c.dom.Document which needs to be streamed as XML.  I
> originally got the idea of using XSLTResult to achieve this from a blog:
>
> http://cse-mjmcl.cse.bris.ac.uk/blog/2007/09/10/1189430125294.html
>
> which claims that it could done with no stylesheet.  In a way, this
> doesn't surprise me . . . it seems hard to believe that there is no
> out-of-the-box
> result for doing this.  It is essential for Ajax.  There should be
> something that will take in a Document and stream it.
>
> Anyway, that's how the thread started.  Eventually, Chris sent me
> something he wrote.  I thought that it was understood that I didn't need
> a stylesheet.
>
> Eric.
>
> -----Original Message-----
> From: news [mailto:news@ger.gmane.org] On Behalf Of Laurie Harper
> Sent: Wednesday, July 02, 2008 2:11 PM
> To: user@struts.apache.org
> Subject: Re: XSLTResult problem
>
> You don't have a stylesheet? What are you expecting the XSLTResult to
> do, if you don't have any XSLT to process?
>
> L.
>
> Eric Hamacher wrote:
>> I took your last attachment, altered it (we don't use JDOM only the
>> org.w3c.dom stuff . . . but it looks like it should work for
>> org.w3c.dom.Document).  Now when I use it within an <action> as a
> result
>> .. . .
>>
>> <result type="xsl">?????</result>
>>
>> Does ????? need to be the location of a stylesheet?  I don't have one,
>> so can I just say:
>>
>> <result type="xsl"/>
>>
>> Thanks.
>>
>> -----Original Message-----
>> From: Chris Pratt [mailto:thechrispratt@gmail.com]
>> Sent: Wednesday, July 02, 2008 11:02 AM
>> To: Struts Users Mailing List
>> Subject: Re: XSLTResult problem
>>
>> The mail list software must have scraped it off.  I'll send it to you
>> offline.
>>   (*Chris*)
>>
>> On Wed, Jul 2, 2008 at 5:28 AM, Eric Hamacher
>> <er...@enetrix.com> wrote:
>>> Thanks Dave and Chris.  Chris, there was no attachment on your email.
>>> Could you send it again?  Thanks again.
>>>
>>> -----Original Message-----
>>> From: Chris Pratt [mailto:thechrispratt@gmail.com]
>>> Sent: Tuesday, July 01, 2008 11:40 PM
>>> To: Struts Users Mailing List; newton.dave@yahoo.com
>>> Subject: Re: XSLTResult problem
>>>
>>> You could try something like the attached Result instead.
>>>  (*Chris*)
>>>
>>>
>>> On Tue, Jul 1, 2008 at 9:03 PM, Dave Newton <ne...@yahoo.com>
>>> wrote:
>>>> --- On Wed, 7/2/08, Dave Newton <ne...@yahoo.com> wrote:
>>>>> That's how the XSLT result works--see the XSLT result [...]
>>>> I did, of course, mean "that's *not* how the XSLT result works..."
>>>>
>>>> Dave
>>>>
>>>>
>>>>
> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>>> For additional commands, e-mail: user-help@struts.apache.org
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: Re: XSLTResult problem

Posted by Eric Hamacher <er...@enetrix.com>.
I have an org.w3c.dom.Document which needs to be streamed as XML.  I
originally got the idea of using XSLTResult to achieve this from a blog:

http://cse-mjmcl.cse.bris.ac.uk/blog/2007/09/10/1189430125294.html

which claims that it could done with no stylesheet.  In a way, this
doesn't surprise me . . . it seems hard to believe that there is no
out-of-the-box
result for doing this.  It is essential for Ajax.  There should be
something that will take in a Document and stream it.

Anyway, that's how the thread started.  Eventually, Chris sent me
something he wrote.  I thought that it was understood that I didn't need
a stylesheet.

Eric. 

-----Original Message-----
From: news [mailto:news@ger.gmane.org] On Behalf Of Laurie Harper
Sent: Wednesday, July 02, 2008 2:11 PM
To: user@struts.apache.org
Subject: Re: XSLTResult problem

You don't have a stylesheet? What are you expecting the XSLTResult to 
do, if you don't have any XSLT to process?

L.

Eric Hamacher wrote:
> I took your last attachment, altered it (we don't use JDOM only the
> org.w3c.dom stuff . . . but it looks like it should work for
> org.w3c.dom.Document).  Now when I use it within an <action> as a
result
> .. . .  
> 
> <result type="xsl">?????</result>
> 
> Does ????? need to be the location of a stylesheet?  I don't have one,
> so can I just say:
> 
> <result type="xsl"/>
> 
> Thanks.
> 
> -----Original Message-----
> From: Chris Pratt [mailto:thechrispratt@gmail.com] 
> Sent: Wednesday, July 02, 2008 11:02 AM
> To: Struts Users Mailing List
> Subject: Re: XSLTResult problem
> 
> The mail list software must have scraped it off.  I'll send it to you
> offline.
>   (*Chris*)
> 
> On Wed, Jul 2, 2008 at 5:28 AM, Eric Hamacher
> <er...@enetrix.com> wrote:
>> Thanks Dave and Chris.  Chris, there was no attachment on your email.
>> Could you send it again?  Thanks again.
>>
>> -----Original Message-----
>> From: Chris Pratt [mailto:thechrispratt@gmail.com]
>> Sent: Tuesday, July 01, 2008 11:40 PM
>> To: Struts Users Mailing List; newton.dave@yahoo.com
>> Subject: Re: XSLTResult problem
>>
>> You could try something like the attached Result instead.
>>  (*Chris*)
>>
>>
>> On Tue, Jul 1, 2008 at 9:03 PM, Dave Newton <ne...@yahoo.com>
>> wrote:
>>> --- On Wed, 7/2/08, Dave Newton <ne...@yahoo.com> wrote:
>>>> That's how the XSLT result works--see the XSLT result [...]
>>> I did, of course, mean "that's *not* how the XSLT result works..."
>>>
>>> Dave
>>>
>>>
>>>
---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: XSLTResult problem

Posted by Laurie Harper <la...@holoweb.net>.
You don't have a stylesheet? What are you expecting the XSLTResult to 
do, if you don't have any XSLT to process?

L.

Eric Hamacher wrote:
> I took your last attachment, altered it (we don't use JDOM only the
> org.w3c.dom stuff . . . but it looks like it should work for
> org.w3c.dom.Document).  Now when I use it within an <action> as a result
> .. . .  
> 
> <result type="xsl">?????</result>
> 
> Does ????? need to be the location of a stylesheet?  I don't have one,
> so can I just say:
> 
> <result type="xsl"/>
> 
> Thanks.
> 
> -----Original Message-----
> From: Chris Pratt [mailto:thechrispratt@gmail.com] 
> Sent: Wednesday, July 02, 2008 11:02 AM
> To: Struts Users Mailing List
> Subject: Re: XSLTResult problem
> 
> The mail list software must have scraped it off.  I'll send it to you
> offline.
>   (*Chris*)
> 
> On Wed, Jul 2, 2008 at 5:28 AM, Eric Hamacher
> <er...@enetrix.com> wrote:
>> Thanks Dave and Chris.  Chris, there was no attachment on your email.
>> Could you send it again?  Thanks again.
>>
>> -----Original Message-----
>> From: Chris Pratt [mailto:thechrispratt@gmail.com]
>> Sent: Tuesday, July 01, 2008 11:40 PM
>> To: Struts Users Mailing List; newton.dave@yahoo.com
>> Subject: Re: XSLTResult problem
>>
>> You could try something like the attached Result instead.
>>  (*Chris*)
>>
>>
>> On Tue, Jul 1, 2008 at 9:03 PM, Dave Newton <ne...@yahoo.com>
>> wrote:
>>> --- On Wed, 7/2/08, Dave Newton <ne...@yahoo.com> wrote:
>>>> That's how the XSLT result works--see the XSLT result [...]
>>> I did, of course, mean "that's *not* how the XSLT result works..."
>>>
>>> Dave
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: XSLTResult problem

Posted by Chris Pratt <th...@gmail.com>.
If you don't have a stylesheet, what were you expecting the XSL result to do?
  (*Chris*)

On Wed, Jul 2, 2008 at 10:46 AM, Eric Hamacher
<er...@enetrix.com> wrote:
> I took your last attachment, altered it (we don't use JDOM only the
> org.w3c.dom stuff . . . but it looks like it should work for
> org.w3c.dom.Document).  Now when I use it within an <action> as a result
> . . .
>
> <result type="xsl">?????</result>
>
> Does ????? need to be the location of a stylesheet?  I don't have one,
> so can I just say:
>
> <result type="xsl"/>
>
> Thanks.
>
> -----Original Message-----
> From: Chris Pratt [mailto:thechrispratt@gmail.com]
> Sent: Wednesday, July 02, 2008 11:02 AM
> To: Struts Users Mailing List
> Subject: Re: XSLTResult problem
>
> The mail list software must have scraped it off.  I'll send it to you
> offline.
>  (*Chris*)
>
> On Wed, Jul 2, 2008 at 5:28 AM, Eric Hamacher
> <er...@enetrix.com> wrote:
>> Thanks Dave and Chris.  Chris, there was no attachment on your email.
>> Could you send it again?  Thanks again.
>>
>> -----Original Message-----
>> From: Chris Pratt [mailto:thechrispratt@gmail.com]
>> Sent: Tuesday, July 01, 2008 11:40 PM
>> To: Struts Users Mailing List; newton.dave@yahoo.com
>> Subject: Re: XSLTResult problem
>>
>> You could try something like the attached Result instead.
>>  (*Chris*)
>>
>>
>> On Tue, Jul 1, 2008 at 9:03 PM, Dave Newton <ne...@yahoo.com>
>> wrote:
>>> --- On Wed, 7/2/08, Dave Newton <ne...@yahoo.com> wrote:
>>>> That's how the XSLT result works--see the XSLT result [...]
>>>
>>> I did, of course, mean "that's *not* how the XSLT result works..."
>>>
>>> Dave
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>>> For additional commands, e-mail: user-help@struts.apache.org
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: XSLTResult problem

Posted by Eric Hamacher <er...@enetrix.com>.
I took your last attachment, altered it (we don't use JDOM only the
org.w3c.dom stuff . . . but it looks like it should work for
org.w3c.dom.Document).  Now when I use it within an <action> as a result
. . .  

<result type="xsl">?????</result>

Does ????? need to be the location of a stylesheet?  I don't have one,
so can I just say:

<result type="xsl"/>

Thanks.

-----Original Message-----
From: Chris Pratt [mailto:thechrispratt@gmail.com] 
Sent: Wednesday, July 02, 2008 11:02 AM
To: Struts Users Mailing List
Subject: Re: XSLTResult problem

The mail list software must have scraped it off.  I'll send it to you
offline.
  (*Chris*)

On Wed, Jul 2, 2008 at 5:28 AM, Eric Hamacher
<er...@enetrix.com> wrote:
> Thanks Dave and Chris.  Chris, there was no attachment on your email.
> Could you send it again?  Thanks again.
>
> -----Original Message-----
> From: Chris Pratt [mailto:thechrispratt@gmail.com]
> Sent: Tuesday, July 01, 2008 11:40 PM
> To: Struts Users Mailing List; newton.dave@yahoo.com
> Subject: Re: XSLTResult problem
>
> You could try something like the attached Result instead.
>  (*Chris*)
>
>
> On Tue, Jul 1, 2008 at 9:03 PM, Dave Newton <ne...@yahoo.com>
> wrote:
>> --- On Wed, 7/2/08, Dave Newton <ne...@yahoo.com> wrote:
>>> That's how the XSLT result works--see the XSLT result [...]
>>
>> I did, of course, mean "that's *not* how the XSLT result works..."
>>
>> Dave
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: XSLTResult problem

Posted by Chris Pratt <th...@gmail.com>.
The mail list software must have scraped it off.  I'll send it to you offline.
  (*Chris*)

On Wed, Jul 2, 2008 at 5:28 AM, Eric Hamacher <er...@enetrix.com> wrote:
> Thanks Dave and Chris.  Chris, there was no attachment on your email.
> Could you send it again?  Thanks again.
>
> -----Original Message-----
> From: Chris Pratt [mailto:thechrispratt@gmail.com]
> Sent: Tuesday, July 01, 2008 11:40 PM
> To: Struts Users Mailing List; newton.dave@yahoo.com
> Subject: Re: XSLTResult problem
>
> You could try something like the attached Result instead.
>  (*Chris*)
>
>
> On Tue, Jul 1, 2008 at 9:03 PM, Dave Newton <ne...@yahoo.com>
> wrote:
>> --- On Wed, 7/2/08, Dave Newton <ne...@yahoo.com> wrote:
>>> That's how the XSLT result works--see the XSLT result [...]
>>
>> I did, of course, mean "that's *not* how the XSLT result works..."
>>
>> Dave
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


RE: XSLTResult problem

Posted by Eric Hamacher <er...@enetrix.com>.
Thanks Dave and Chris.  Chris, there was no attachment on your email.
Could you send it again?  Thanks again.

-----Original Message-----
From: Chris Pratt [mailto:thechrispratt@gmail.com] 
Sent: Tuesday, July 01, 2008 11:40 PM
To: Struts Users Mailing List; newton.dave@yahoo.com
Subject: Re: XSLTResult problem

You could try something like the attached Result instead.
  (*Chris*)


On Tue, Jul 1, 2008 at 9:03 PM, Dave Newton <ne...@yahoo.com>
wrote:
> --- On Wed, 7/2/08, Dave Newton <ne...@yahoo.com> wrote:
>> That's how the XSLT result works--see the XSLT result [...]
>
> I did, of course, mean "that's *not* how the XSLT result works..."
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: XSLTResult problem

Posted by Chris Pratt <th...@gmail.com>.
You could try something like the attached Result instead.
  (*Chris*)


On Tue, Jul 1, 2008 at 9:03 PM, Dave Newton <ne...@yahoo.com> wrote:
> --- On Wed, 7/2/08, Dave Newton <ne...@yahoo.com> wrote:
>> That's how the XSLT result works--see the XSLT result [...]
>
> I did, of course, mean "that's *not* how the XSLT result works..."
>
> Dave
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


Re: XSLTResult problem

Posted by Dave Newton <ne...@yahoo.com>.
--- On Wed, 7/2/08, Dave Newton <ne...@yahoo.com> wrote:
> That's how the XSLT result works--see the XSLT result [...]

I did, of course, mean "that's *not* how the XSLT result works..."

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: XSLTResult problem

Posted by Dave Newton <ne...@yahoo.com>.
That's how the XSLT result works--see the XSLT result type page [1] for further explanation. In a nutshell *you* don't create the XML--you send an action to the XSLT.

Dave

[1] http://struts.apache.org/2.x/docs/xsl-result.html

--- On Tue, 7/1/08, Eric Hamacher <er...@enetrix.com> wrote:

> From: Eric Hamacher <er...@enetrix.com>
> Subject: XSLTResult problem
> To: "Struts Users Mailing List" <us...@struts.apache.org>
> Date: Tuesday, July 1, 2008, 3:30 PM
> Struts 2.0.11
> 
>  
> 
> Hello:
> 
>  
> 
>  
> 
>  
> 
> It appears that XSLTResult is having trouble transforming a
> simple
> Document:
> 
>  
> 
> <?xml version="1.0" ?>
> 
> <buidInfo>
> 
> <buid>999999</buid>
> 
> <buid>9999x99</buid>
> 
> </buidInfo>
> 
>  
> 
>  
> 
> My action is producing valid XML.  I don't think
> it's the action causing
> the problem.  The error message printed on the screen:
> 
>  
> 
> XML Parsing Error: no element found
> 
> Location:
> http://111.222.33.444:8989/ImageManager/download/BUDropdownAjaxAction.ac
> tion?schema=XXXXX
> 
> Line Number 1, Column 1:
> 
>  
> 
>  
> 
> Here is the action execute method which creates the
> Document:
> 
>  
> 
>     public String execute() throws
> ParserConfigurationException {
> 
>             ImageManagerProperties props = new
> ImageManagerProperties();
> 
>             props.load();
> 
>             
> 
>             DocumentBuilderFactory dbfac = 
> 
>                 DocumentBuilderFactory.newInstance();
> 
>             DocumentBuilder docBuilder =
> dbfac.newDocumentBuilder();
> 
>             doc = docBuilder.newDocument();
> 
>     
> 
>             Element root =
> doc.createElement("buidInfo");
> 
>             doc.appendChild(root);
> 
>             
> 
>             File directory = new
> File(props.getBaseDownloadDir() + "/" +
> schema);
> 
>             File[] buids = directory.listFiles();
> 
>             for (File f: buids) {
> 
>                 if (f.isDirectory()) {
> 
>                     Element buid =
> doc.createElement("buid");
> 
>                     Text name =
> doc.createTextNode(f.getName());
> 
>                     buid.appendChild(name);
> 
>                     root.appendChild(buid);
> 
>                 }
> 
>             }
> 
>             
> 
>             return SUCCESS;
> 
> }
> 
>  
> 
> The configuration is as such:
> 
>  
> 
> <action name="BUDropdownAjaxAction"
> class="download.BUDropdownAjaxAction">
> 
>             <result type="xslt">
> 
>                 <param
> name="exposedValue">doc</param>        
> 
>             </result>
> 
>  </action>
> 
>  
> 
> I assume that XSLTResult is available through the struts
> default
> settings.
> 
>  
> 
> Can anybody see something obvious?
> 
>  
> 
> Regards,
> 
> Eric Hamacher
> 
>  
> 
> ******************************
> 
> THIS EMAIL IS INTENDED ONLY FOR THE REVIEW OF THE
> ADDRESSEE(S), AND MAY
> CONTAIN CONFIDENTIAL AND LEGALLY PRIVILEGED INFORMATION.
> INTERCEPTION,
> COPYING, DISSEMINATION, OR OTHER USE BY OTHER THAN THE
> ADDRESSEE(S) IS
> PROHIBITED AND MAY BE PENALIZED UNDER APPLICABLE PRIVACY
> LAWS. IF YOU
> RECEIVED THIS EMAIL IN ERROR, PLEASE DELETE IT AND NOTIFY
> ME BY RETURN
> EMAIL TO eric.hamacher@enetrix.com
> *******************************

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org