[opencms-dev] Accessing XML-Contents via Scriptlet?

Siegfried Puchbauer siegfried.puchbauer at gmail.com
Wed Feb 15 14:12:35 CET 2006


have a look at the org.opencms.xml.content package

CmsFile configFile = cmsObject.readFile(resourcePath);
CmsXmlContent config = CmsXmlContentFactory.unmarshal(cmsObject, configFil
e);

String varX = config.getStringValue(cmsObject,xPath,locale);
// xPath is for example "MyElement[1]/MySubElement[2]"

hth

Sigi

On 2/15/06, pascal.hollenbrock at bayerbbs.com <pascal.hollenbrock at bayerbbs.com>
wrote:
>
>
> Hello all!
>
> How can I access elements of XML-documents via Scriptlet-Code?
>
> With cms-Tags I would write <cms:contentshow
> element="MyElement[1]/MySubElement[2]"/> as an example.
> How can I read out the value of MySubElement[2] using Scriptlet-Code?
>
> Thanks for in advance your help and
>
> regards
> Pascal
>
> _______________________________________________
> 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
>
>


--
Mit freundlichen Grüßen

Siegfried Puchbauer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20060215/24740f7c/attachment.htm>


More information about the opencms-dev mailing list