[opencms-dev] How to get HTML from a file in VFS

Tom Wolf twb15 at hotmail.com
Fri Mar 18 21:38:29 CET 2011


looks like you are running from within a jsp file - the standard way of doing it is with the: cms:include or cms:contentload and cms:contentshow tags




 
> Date: Fri, 18 Mar 2011 14:50:29 +0000
> From: bteixeira666 at gmail.com
> To: opencms-dev at opencms.org
> Subject: [opencms-dev] How to get HTML from a file in VFS
> 
> Hello there
> 
> I'm developing a feature that extracts some info from an HTML file in the VFS.
> This is an example of how I'm reading the file contents:
> 
> <%
> String path = "path/to/file.html";
> CmsFile menuFile = cmsObj.readFile(path);
> out.print(new String(menuFile.getContents()));
> %>
> 
> The problem: I don't see the full HTML content of the file; instead I
> see something like:
> 
> <pages xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="http://www.opencms.org/dtd/6.0/xmlpage.xsd">
> <page language="pt">
> <element name="body">
> <links>
> <link name="link8" internal="false" type="A">
> <target><![CDATA[...]]></target>
> </link>
> <link name="link9" internal="false" type="A">
> <target><![CDATA[...]]></target>
> </link>
> </links>
> <content><![CDATA[ ....... the actual HTML contents, but
> without the links....... ]]></content>
> </element>
> </page>
> </pages>
> 
> I think you get the idea.
> Is there any built-in way of getting the HTML contents as they are see
> in the workplace editor?
> 
> Thank you.
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20110318/94f672a2/attachment.htm>


More information about the opencms-dev mailing list