OpenCms:如何从多个架构文件访问 xml 元素内容
我对 OpenCms 中的 xml 结构化内容有疑问。我有两个 XML 架构,一个用于编辑顶部菜单(所有页面的菜单都相同),另一个架构用于编辑页面内容。在模板 jsp 文件中,我需要从两个架构文件访问 xml 元素内容。该怎么做呢?我必须在 中指定一些内容吗?
I have a doubt regarding xml structured content in OpenCms. I have two XML schemas, one for editing the top menus (menus are same across all the pages) and another schema for editing the page content. In the template jsp file i need to access xml element contents from both the schema files. How to go for that? do i have to specify something in ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以将一个 xsd 嵌入到另一个 xsd 中。首先,通过 menu.xsd 定义菜单,然后将其包含在 ie page.xsd 中:
其中“OpenCmsMenu”需要是您在 menu.xsd 中定义的类型名称。
You can embed one xsd into another. First you define your menu via menu.xsd, then you include it like this in your i.e. page.xsd:
where 'OpenCmsMenu' needs to be the type name as you defined it in your menu.xsd.
另一种解决方案可能是从文件夹结构生成菜单。这是 OpenCms 中处理菜单的常用方法。
An alternative solution might be to generate the menus from the folder structure. That is the usual method to deal with menus in OpenCms.