[opencms-dev] xmlcontent - api access

Siegfried Puchbauer siegfried.puchbauer at gmail.com
Fri Dec 9 12:02:39 CET 2005


hi list,

I currently use xmlcontent items defined by my own xsd's. Its a complex
structure of nested contents. I access these items using the
org.opencms.xmlapi in the way:

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

String varX = config.getStringValue(cmsObject,xPath,locale);

Doing it that way enables me reading from XPaths like:


   - "AnElement"
   - "AnElement[1]"
   - "AnElement/ANestedElement"

but not

   - "AnElement/ANestedElement[1]"

It is possible to get the values by config.getStringValue(cmsObject,
"AnElement/ANestedElement", locale, (int)index), but the method
getIndexCount("AnElement/ANestedElement",
locale) allways returns 0.

Is there a way to figure out how much elements of nested content is
available?

Any hints would be helpfull

kind regards

--
Mit freundlichen Grüßen

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


More information about the opencms-dev mailing list