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 <[EMAIL PROTECTED]> wrote:

> From: Eric Hamacher <[EMAIL PROTECTED]>
> Subject: XSLTResult problem
> To: "Struts Users Mailing List" <user@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 [EMAIL PROTECTED]
> *******************************

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to