struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Krueger" <jkrue...@pathfire.com>
Subject RE: XSLTResult problem
Date Wed, 02 Jul 2008 19:50:56 GMT
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


Mime
View raw message